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

Unable to parse RGBA no comma alpha value in percentage. #257

Open
deadlyjack opened this issue Jul 8, 2023 · 6 comments
Open

Unable to parse RGBA no comma alpha value in percentage. #257

deadlyjack opened this issue Jul 8, 2023 · 6 comments

Comments

@deadlyjack
Copy link

Unable to parse rgba(0 0 0 26%) color where it is a valid color and should be parsed. When passed the same color value including it comma or alpha value as ratio it is parsed correctly.

@Qix-
Copy link
Owner

Qix- commented Jul 8, 2023

Are you sure this is a valid part of the spec?

@deadlyjack
Copy link
Author

Yes I'm sure.

Here is specification of rgb(a) color on MDN

<rgb()> = 
  rgb( [ <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )  |
  rgb( [ <number> | none ]{3} [ / [ <alpha-value> | none ] ]? )  

<alpha-value> = 
  <number>      |
  <percentage>  

@Qix-
Copy link
Owner

Qix- commented Jul 9, 2023

Ah it's a new syntax change, fun. PR is welcome, both syntaxes need to be supported.

@deadlyjack
Copy link
Author

Sure. Thanks for replying 🙂

@yyuneko
Copy link

yyuneko commented Sep 10, 2024

Unable to parse rgba(0 0 0 26%) color where it is a valid color and should be parsed. When passed the same color value including it comma or alpha value as ratio it is parsed correctly.

rgba(0 0 0 26%) isn't supported by browsers,rgba(0 0 0 / 26%) is ok.

@Qix-
Copy link
Owner

Qix- commented Sep 10, 2024

There's technically nothing about this package that mandates it's an exact parity of browser support. I think as long as this package is a superset of what the browsers support, so long as what is supported is to an official spec, then it's acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants