-
Notifications
You must be signed in to change notification settings - Fork 144
Parsing RGB with alpha is broken #755
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
Hi @masoudnkh, thanks for reporting this issue. I still don't quite understand the problem. Could you please post the exact CSS you parse, the code you execute, and the CSS you get back, and the CSS you'd expect to get back? Thanks! |
Also, could you please post which version of PHP-CSS-Parser you're using? |
PHP-CSS-Parser v 8.7.0 It appears as though the parser doesn't support rgb with alpha
or
yields:
Switching to rgba works:
|
This may be due to incorrect parsing order of 'separators' within values, where |
AFAIK the mentioned |
That's what I thought. I just noticed that the slashes seemed to be causing the problem. Will need looking into in more detail... |
This covers expected behaviour for CSS level 3 (some of which is also covered by more general tests) Also included are some commented-out tests for CSS Color Module Level 4, support for which is yet to be implemented, as well as for some syntaxes that should be rejected (but currently are not). Precursor to resolving #755 and supporting CSS Color Module Level 4.
This covers expected behaviour for CSS level 3 (some of which is also covered by more general tests). Also included are some commented-out tests for CSS Color Module Level 4, support for which is yet to be implemented, as well as for some syntaxes that should be rejected (but currently are not). Precursor to resolving #755 and supporting CSS Color Module Level 4.
This covers expected behaviour for CSS level 3 (some of which is also covered by more general tests). Also included are some commented-out tests for CSS Color Module Level 4, support for which is yet to be implemented, as well as for some syntaxes that should be rejected (but currently are not). Precursor to resolving #755 and supporting CSS Color Module Level 4.
Yes, that's the case. It only supports CSS level 3 for colors at the moment. Since it parses colors specifically (and not as some generic CSS function), we'll need to update it to support the level 4 (and then level 5) syntax. I added some tests in #793 to help identify what currently works, and what doesn't. I think support for level 4 at first, then level 5, are not too onerous. The alternative is to drop specific handling of the color functions, instead treating them as a generic CSS function. But that could be even more messy, and result in removal of a valuable feature. If you'd like to get involved with W3C, and perpahps propose syntaxes that are more parsable, you can do so here: https://www.w3.org/get-involved/ |
This covers expected behaviour for CSS level 3 (some of which is also covered by more general tests). Also included are some commented-out tests for CSS Color Module Level 4, support for which is yet to be implemented, as well as for some syntaxes that should be rejected (but currently are not). Precursor to resolving #755 and supporting CSS Color Module Level 4.
This covers expected behaviour for CSS level 3 (some of which is also covered by more general tests). Also included are some commented-out tests for CSS Color Module Level 4, support for which is yet to be implemented, as well as for some syntaxes that should be rejected (but currently are not). Precursor to resolving #755 and supporting CSS Color Module Level 4. Co-authored-by: Jake Hotson <jake.github@qzdesign.co.uk>
Also include tests for color functions with CSS variable substitutions where they use the "legacy" syntax. Resolves #755.
i use php-css-parser but not coverage this code:
remove unused css code and good work for all code but when i exclude ".wp-block-table.is-style-stripes" the output is empty like:
The text was updated successfully, but these errors were encountered: