You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm only using this Package to validate CSS-Values, but I've stumbled upon the case where a color value is set to 'unset' and the profile validation (cssutils.profile.validate) returns a false for this.
Expected Behavior
cssutils.profile.validate('color', 'unset') is True
Actual Behavior
cssutils.profile.validate('color', 'unset') is False
The values are validated against the profile regexes, and the CSS-wide keywords only appear in the regexes where they were spelled out per property.
Per CSS Values 4 the CSS-wide keywords (initial, inherit, unset, revert) are valid in place of the value of any property, so I would like to accept them for every property rather than only for color.
My plan:
accept the CSS-wide keywords for every property (they are added where the property regexes are compiled, so the per-property definitions stay untouched),
keep invalid values invalid — only those four keywords are added,
update the one existing expectation that relied on an @font-face descriptor rejecting inherit,
Activity
jaraco commentedon Feb 23, 2022
Looks like
unsetis a legitimate setting. I welcome a patch to fix it.Madin-H23 commentedon Oct 21, 2026
Hi @Thokas — thanks for the report. You are right: on current main
cssutils.profile.validate('color', 'unset')isFalse, whileinheritis accepted:The values are validated against the profile regexes, and the CSS-wide keywords only appear in the regexes where they were spelled out per property.
Per CSS Values 4 the CSS-wide keywords (
initial,inherit,unset,revert) are valid in place of the value of any property, so I would like to accept them for every property rather than only forcolor.My plan:
@font-facedescriptor rejectinginherit,I will open a PR with the change.