Qix-/color

Do you want to work on this issue?

You can request for a bounty in order to promote it!

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

deadlyjack posted onGitHub

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.


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

posted by Qix- over 1 year ago

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>  
posted by deadlyjack over 1 year ago

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

posted by Qix- over 1 year ago

Sure. Thanks for replying 🙂

posted by deadlyjack over 1 year ago

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.

posted by yyuneko 7 months ago

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.

posted by Qix- 7 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests