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

RGBA to HSLA #418

Open
Snowball-V opened this issue Jun 9, 2020 · 1 comment
Open

RGBA to HSLA #418

Snowball-V opened this issue Jun 9, 2020 · 1 comment

Comments

@Snowball-V
Copy link

Snowball-V commented Jun 9, 2020

Paste here : https://css.github.io/csso/csso.html (version 4.0.3)

The following css :

 .test1 {
   background: rgba(255,255,255,.9);
 }

in Beautify’s mode you get something like :

 .test1 {
   background: rgba(255,255,255,.9)
 }

According to the last Chrome’s or Firefox’s code inspector, when we switch from RGBA to HSLA we see that rgba (255, 255, 255, .9) is converted to hsla (0deg, 0%, 100%, .9) in the inpector.

As combining HSLA + optional zero unit, don’t rgba(255,255,255,.9) (20 bytes) would be the same as hsla(0,0,100%,.9) (17 bytes) ?

Edit : removed flex question according to #410

@Snowball-V Snowball-V changed the title For zero lengths the unit identifier is optional + RGBA to HSLA RGBA to HSLA Jun 10, 2020
@lahmatiy
Copy link
Member

There is currently no assumption in CSSO that hsl / hsla may be shorter than the rgb / rgba version. Such optimisation can be added. Personally I have no time for this now, but a PR is very welcome :)

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

No branches or pull requests

2 participants