From d973e3eaf3f976d06de479b1eee3c281449ba07f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Wed, 5 Feb 2025 15:32:31 -0800 Subject: [PATCH] Allow Color 4 functions in plain CSS (#2505) --- CHANGELOG.md | 3 +++ lib/src/parse/css.dart | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 342499a81..6c7659150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## 1.83.5-dev +* Fix a bug in which various Color Level 4 functions weren't allowed in plain + CSS. + * Fix the error message for `@extend` without a selector and possibly other parsing edge-cases in contexts that allow interpolation. diff --git a/lib/src/parse/css.dart b/lib/src/parse/css.dart index 4b28dd3e1..a8dcec0d9 100644 --- a/lib/src/parse/css.dart +++ b/lib/src/parse/css.dart @@ -14,19 +14,25 @@ import 'scss.dart'; final _disallowedFunctionNames = globalFunctions.map((function) => function.name).toSet() ..add("if") - ..remove("rgb") - ..remove("rgba") + ..remove("abs") + ..remove("alpha") + ..remove("color") + ..remove("grayscale") ..remove("hsl") ..remove("hsla") - ..remove("grayscale") + ..remove("hwb") ..remove("invert") - ..remove("alpha") - ..remove("opacity") - ..remove("saturate") - ..remove("min") + ..remove("lab") + ..remove("lch") ..remove("max") + ..remove("min") + ..remove("oklab") + ..remove("oklch") + ..remove("opacity") + ..remove("rgb") + ..remove("rgba") ..remove("round") - ..remove("abs"); + ..remove("saturate"); class CssParser extends ScssParser { bool get plainCss => true;