cssutils
cssutils copied to clipboard
Implement CSS Colors level 4
In #28, a user reported an issue parsing colors with the / symbol in them. Here's a minimum reproducer:
python -m cssutils.scripts.cssparse -s '.any{color:rgb(0 0 0 / 0.4)}'
ERROR COLOR_VALUE: Missing token for production end FUNC ")": ('CHAR', '/', 1, 22)
ERROR PropertyValue: No match: ('CHAR', ')', 1, 27)
ERROR PropertyValue: Unknown syntax or no value: rgb(0 0 0 / 0.4)
ERROR CSSStyleDeclaration: Syntax Error in Property: color:rgb(0 0 0 / 0.4)
b''
Apparently this syntax is part of CSS Colors Level 4. It would be great if someone would look into implementing this syntax and any other syntax required for colors level 4.