Skip to content

[FEATURE] Support rgba and rgb (etc.) being aliases #797

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

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

JakeQZ
Copy link
Collaborator

@JakeQZ JakeQZ commented Jan 20, 2025

As of CSS Color Module Level 4, rgba is an alias of rgb; likewise, hsla is an alias of hsl.

This change allows any of the above color functions to contain either three or four arguments, with alpha assumed as the fourth, and allowed to be absent.

@JakeQZ JakeQZ added enhancement css4 Relating to features introduced in CSS4 labels Jan 20, 2025
@JakeQZ JakeQZ self-assigned this Jan 20, 2025
@JakeQZ
Copy link
Collaborator Author

JakeQZ commented Jan 20, 2025

I don't consider this a bug, because it wasn't a problem until CSS Color Module Level 4 came along.

@coveralls
Copy link

coveralls commented Jan 20, 2025

Coverage Status

coverage: 41.373% (+0.4%) from 40.95%
when pulling 95ce6d1 on feature/css-color-4/function-synonyms
into bc511bb on main.

@JakeQZ
Copy link
Collaborator Author

JakeQZ commented Jan 20, 2025

Another precursor to #755.

@oliverklee
Copy link
Collaborator

Also, is this something to backport?

@JakeQZ JakeQZ marked this pull request as draft January 20, 2025 23:55
@JakeQZ
Copy link
Collaborator Author

JakeQZ commented Jan 21, 2025

Blocked by #798. I've pushed changes suggested in review, and included the #798 change in those, just to confirm that all CI tests would pass. Once #798 is merged, and this is rebased, that change should drop out of this.

@JakeQZ JakeQZ added the blocked Needs another issue to be resolved first label Jan 21, 2025
@JakeQZ
Copy link
Collaborator Author

JakeQZ commented Jan 21, 2025

Also, is this something to backport?

If 9.0 is still some way off, then yes, but see below.

This is mutlipart change. The key change to support space-separated arguments with a forward-slash separating the alpha argument is yet to come. It's an enhancement rather than a bugfix, but one that is needed sooner rather than later, since the CSS syntax has evolved.

I noted in a recent backport that some syntaxes had to be changed to support PHP 5.6. OTOH, I recently saw a message from my hosting provider saying that if I wanted to continue using a PHP version below 8.0, I'd have to pay an additional premium.

The current main requires PHP >= 7.2, which itself is well beyond EOL.

I think it would be more than reasonable to cut a 9.0 release fairly soon, regardless of not having completed all that we planned for it, and stop wasting time on the backports (focusing on something more interesting instead).

As of CSS Color Module Level 4, `rgba` is an alias of `rgb`;
likewise, `hsla` is an alias of `hsl`.

This change allows any of the above color functions to contain either three or
four arguments, with alpha assumed as the fourth, and allowed to be absent.
@JakeQZ JakeQZ force-pushed the feature/css-color-4/function-synonyms branch from 7814474 to 3f54b77 Compare January 21, 2025 18:47
@JakeQZ JakeQZ marked this pull request as ready for review January 21, 2025 18:49
@JakeQZ JakeQZ requested a review from oliverklee January 21, 2025 18:50
@JakeQZ JakeQZ removed the blocked Needs another issue to be resolved first label Jan 21, 2025
@JakeQZ JakeQZ requested a review from oliverklee January 22, 2025 17:51
@oliverklee oliverklee merged commit f3ea6a7 into main Jan 22, 2025
21 checks passed
@oliverklee oliverklee deleted the feature/css-color-4/function-synonyms branch January 22, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css4 Relating to features introduced in CSS4 enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants