PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

Fix/css4 rgb parsing

Open raxbg opened this issue 5 years ago • 4 comments

In CSS Level 4 rgba() and hsla() are aliases for rgb() and hsl() which now accept the alpha argument. This PR reflects this behavior and makes the parser understand the syntax. Source: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()

Example:

#css4-rgba {
	background-color: rgb(242 245 249 / 45%);
}

raxbg avatar Nov 06 '20 20:11 raxbg

+1 for this PR, encountered the issue today!

remyperona avatar Jun 18 '21 10:06 remyperona

Bump

raxbg avatar Sep 17 '22 18:09 raxbg

Hi, I've updated the PR to include the recommended stricter checks for rgb and hsl color modes.

raxbg avatar Jul 10 '24 14:07 raxbg

Hi,

I am using this library for the first time in https://www.drupal.org/project/ui_styles/issues/3453784.

I am encountering the same issue has https://github.com/MyIntervals/PHP-CSS-Parser/issues/357.

And I confirm that the changes in this PR are fixing the bug.

Thanks!

What remains to be done to have it merged and shipped in a new release?

FlorentTorregrosa avatar Aug 07 '24 08:08 FlorentTorregrosa