Closed volkanceylan closed 2 years ago
Thanks for your work on this
Can you split this PR up? The RGB with spaces change can be merged straight away.
The variables var
feature should probably be more broadly tested, do they really only not work inside rgb? i expect other "functions" like calc
might also suffer this, if we can get confidence around this at least whilst we're at it that would be great
OK, i have removed css var related change from this branch, will send a separate pull req after this is merged. And you are right, although not very common it is possible to use other functions inside rgb which Nuglify should simply ignore.
I also added support for 4 part rgb with/without spaces which is supported in CSS Color Module Level 4:
Published in 1.17.6
CSS minifier reports syntax error with statements like "rgb(var(--rgb-nums))" while it is valid as long as the variable is in an expected format like "1 2 3", "1, 2, 3", "#357", "#335577" etc. It is not possible to validate the variable itself in Nuglify though as its value might be defined elsewhere. This just ignores rgb function with a var function inside.
This pull request also handles the rgb function with spaces, e.g.
rgb(3 5 7)
as most browsers support this syntax now.