Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgba() is not necessarily legacy. #32735

Closed
wants to merge 5 commits into from
Closed

rgba() is not necessarily legacy. #32735

wants to merge 5 commits into from

Conversation

estelle
Copy link
Member

@estelle estelle commented Mar 19, 2024

rgba() is an alias for rgb().

the example isn't using the legacy syntax of using commas, so i updated the text, title, and live sample function call to remove the "legacy" lingo.

rgba() is an alias for rgb().
@estelle estelle requested a review from a team as a code owner March 19, 2024 00:14
@estelle estelle requested review from bsmth and removed request for a team March 19, 2024 00:14
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/s 6-50 LoC changed labels Mar 19, 2024
Copy link
Contributor

github-actions bot commented Mar 19, 2024

Preview URLs

(comment last updated: 2024-03-21 02:55:03)

@bsmth
Copy link
Member

bsmth commented Mar 19, 2024

Thanks, Estelle - taking a look now 👀

@bsmth
Copy link
Member

bsmth commented Mar 19, 2024

files/en-us/web/accessibility/understanding_colors_and_luminance/index.md has a couple of places to fix:

L69:

/* legacy rgba notation */
color: rgba(100%, 0%, 100%, 100%);
color: rgba(255, 0, 255, 1);

L96 has a broken xref and uses "legacy" wording (maybe you have better phrasing for this):

-The examples also show the legacy [`rgba()`](/en-US/docs/Web/CSS/color_value/rgb#legacy_syntax_rgba) syntax. The older syntax for color functions was comma-separated, with separate functions for when the alpha channel was included. New color functions only have one syntax with space-separated (rather than comma-separated) values, with the alpha channel, if present, being preceded by a slash.
+The examples also show the [`rgba()`](/en-US/docs/Web/CSS/color_value/rgb#rgba_syntax) syntax which is an alias for `rgb()`- it accepts the same parameters and behaves the same way. The legacy syntax for color functions is comma-separated and relies on using separate functions when you need to use the alpha channel. New color functions use space-separated values, and a slash precedes an optional alpha channel.

@bsmth bsmth self-requested a review March 19, 2024 08:48
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Estelle! A couple of comments for you to consider 🙌🏻

@estelle estelle requested a review from a team as a code owner March 19, 2024 16:31
@estelle estelle requested review from scottaohara and removed request for a team March 19, 2024 16:31
@github-actions github-actions bot added the Content:Accessibility Accessibility docs label Mar 19, 2024
@estelle estelle requested a review from bsmth March 19, 2024 16:33
@estelle
Copy link
Member Author

estelle commented Mar 19, 2024

Thanks @bsmth
I changed much more than that line to be in line with #32004 that was merged earlier today.

@bsmth
Copy link
Member

bsmth commented Mar 20, 2024

Thanks @bsmth I changed much more than that line to be in line with #32004 that was merged earlier today.

Sure thing, taking a look now 👀

@bsmth
Copy link
Member

bsmth commented Mar 20, 2024

There's two other places saying "legacy <rgba()>", we might want to get those, too:

In CSS Values and Units (files/en-us/web/css/css_values_and_units/index.md):

Some legacy functional notations such as rgba() use commas,

In files/en-us/web/css/color/index.md:

/* <rgb()> values and legacy <rgba()> values*/
color: rgb(34, 12, 64, 0.6);
color: rgba(34, 12, 64, 0.6);
color: rgb(34 12 64 / 0.6);
color: rgba(34 12 64 / 0.6);
color: rgb(34.6 12 64 / 60%);
color: rgba(34.6 12 64 / 60%);

I don't know if something like this helps, it would be nice to use the same format for the rest of the functions (we can do in a follow-up if we decide on a good format for this code block):

/* <rgb()> and <rgba()> values*/
color: rgb(34 12 64);
/* with an alpha channel */
color: rgb(34.6 12 64 / 60%);
color: rgba(34.6 12 64 / 60%);
/* legacy comma-separated syntax */
color: rgb(34, 12, 64, 0.6);
color: rgba(34, 12, 64, 0.6);

What do you think?

@bsmth bsmth assigned estelle and unassigned bsmth Mar 20, 2024
@bsmth
Copy link
Member

bsmth commented Mar 20, 2024

Thanks, Estelle, two files for us to check with 'legacy' wording, but passing it back over to you to have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Accessibility Accessibility docs Content:CSS Cascading Style Sheets docs size/s 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants