-
Notifications
You must be signed in to change notification settings - Fork 144
CSS rgb and rgba functions can't accept custom property #257
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
Comments
Actually, it appears that any custom property passed as an argument to body {
color: rgb(var(--color-red), var(--color-green), var(--color-blue));
} results in |
I believe this is a duplicate of #186. |
I noticed that NitroPack:fix/css4-rgb-parsing corrects this bug (at least for my use case). Is it possible to merge it? |
Never mind. I was using the latest release of PHP-CSS-Parser (8.3.1), and this issue seems to be resolved on the master branch. I did run into another problem where the |
The following CSS results in the parser stripping the value.
It seems that the parser thinks the value is invalid since
rgb
expects three arguments and is only receiving one. However, the CSS works correctly in every major browser.The reason I am using this syntax is because I'm passing the
--my-color
variable to variousrgba
functions throughout the style sheet, and while the color might change, the alpha value of eachrgba
function is defined separately. I.e., I can't set--my-color
torgba(255, 0, 0, .5)
as I'd require hundreds of variables for each opacity.The text was updated successfully, but these errors were encountered: