diff --git a/configurations/standard.json b/configurations/standard.json index 782d028..f2fc27f 100644 --- a/configurations/standard.json +++ b/configurations/standard.json @@ -156,14 +156,14 @@ "no-unknown-custom-media": [ true, { - "severity": "error", + "severity": "warning", "message": "Unknown custom media query \u201c%s\u201d" } ], "no-unknown-custom-properties": [ true, { - "severity": "error", + "severity": "warning", "message": "Unknown custom property \u201c%s\u201d" } ], diff --git a/tools/update_stylelint.py b/tools/update_stylelint.py index b30b1f4..11c8a9f 100644 --- a/tools/update_stylelint.py +++ b/tools/update_stylelint.py @@ -43,6 +43,14 @@ def update_stylelint_rules(): break if 'no-unknown' in rule_name: + # Unknown custom properties/media reference values that are + # frequently defined where static analysis can't see them (set at + # runtime via JS, in inline style attributes, on a page that wasn't + # crawled, or built at compile time by PostCSS). A missing one + # degrades gracefully to the initial/inherited value rather than + # producing invalid CSS, so report it as a warning, not an error. + if rule_name in ('no-unknown-custom-properties', 'no-unknown-custom-media'): + rule_config["severity"] = "warning" rules[rule_name] = [rule_enable, rule_config] elif 'no-deprecated' in rule_name: rule_config["severity"] = "warning"