diff --git a/cssutils/profiles.py b/cssutils/profiles.py index 42e88048..1175f3a5 100644 --- a/cssutils/profiles.py +++ b/cssutils/profiles.py @@ -88,8 +88,8 @@ class Profiles: 'color': r'{namedcolor}|{hexcolor}|{rgbcolor}|{uicolor}', # 'color': r'(maroon|red|orange|yellow|olive|purple|fuchsia|white|lime|green|navy|blue|aqua|teal|black|silver|gray|ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)|#[0-9a-f]{3}|#[0-9a-f]{6}|rgb\({w}{int}{w},{w}{int}{w},{w}{int}{w}\)|rgb\({w}{num}%{w},{w}{num}%{w},{w}{num}%{w}\)', 'integer': r'{int}', - 'length': r'0|{num}(em|ex|px|in|cm|mm|pt|pc)', - 'positivelength': r'0|{positivenum}(em|ex|px|in|cm|mm|pt|pc)', + 'length': r'0|{num}(em|ex|rem|ch|px|in|cm|mm|pt|pc|vh|vw|vmin|vmax)', + 'positivelength': r'0|{positivenum}(em|ex|rem|ch|px|in|cm|mm|pt|pc|vh|vw|vmin|vmax)', 'angle': r'0|{num}(deg|grad|rad)', 'time': r'0|{num}m?s', 'frequency': r'0|{num}k?Hz', diff --git a/cssutils/tests/test_properties.py b/cssutils/tests/test_properties.py index cbc42e7b..fd74fdee 100644 --- a/cssutils/tests/test_properties.py +++ b/cssutils/tests/test_properties.py @@ -23,6 +23,12 @@ def setup_method(self): 'IN': '1.2in', 'PT': '1.2pt', 'PC': '1.2pc', + 'REM': '1.2rem', + 'CH': '1.2ch', + 'VH': '1.2vh', + 'VW': '1.2vw', + 'VMIN': '1.2vmin', + 'VMAX': '1.2vmax', 'ANGLES': ('1deg', '1rad', '1grad'), 'TIMES': ('1s', '1ms'), 'FREQUENCIES': ('1hz', '1khz'), @@ -62,7 +68,8 @@ def expanded(*keys): # combined values, only keys of V may be used! self.V['LENGTHS'] = expanded( - '0', 'EM', 'EX', 'PX', 'CM', 'MM', 'IN', 'PT', 'PC' + '0', 'EM', 'EX', 'REM', 'CH', 'PX', 'CM', 'MM', 'IN', 'PT', 'PC', + 'VH', 'VW', 'VMIN', 'VMAX' ) self.V['COLORS'] = expanded('HEX3', 'HEX6', 'RGB', 'RGB100') self.V['COLORS3'] = expanded('RGBA', 'RGBA100', 'HSL', 'HSLA')