-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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() support for cleanupListOfValues #628
Comments
Isn't this CSS? The minifyStyles plugin uses csso which can also minify color values like |
Yep, it's defined in CSS Colors Module level 3 and many browser supports it, but it wasn't defined in SVG 1 and thus not supported in SVGO. |
So does that mean that the SVGO's CSS colors minifier couldn't be augmented with this feature? Given that there are a very limited number of color formats in this scenario, couldn't this just be written from scratch pretty quickly? Just remove spaces, round numbers to specified level of precision, and remove any zeros preceeding decimals? |
@GreLI: So plain CSS is optimized by CSSO in minifyStyles plugin. - |
@peternowell, it totally can, I just described reason why it doesn't now. @strarsis, it doesn't supported for now in SVGO. What processed through CSSO depends on CSSO support (I guess it does.) |
@peternowell : But because CSSO handles the CSS minification, it already minifies rgba values. So this issue makes no sense then? |
I believe the issue is about rgba values outside of CSS or |
It is possible reusing the CSSO routines, also for other attribute values than just for color, For color values, besides minifying rgba(...) values, CSSO also replaces generic colors with There is already the convertColors plugin but it doesn't support rgba yet. |
It would be nice if cleanupListOfValues could work on
rgba()
values... removing unnecessary spaces and leading zeros. Not sure if rounding to the specified precision would be necessary, but it would be nice ifrgba(10, 20, 30, 0.4)
could turn intorgba(10,20,30,.4)
.The text was updated successfully, but these errors were encountered: