Skip to content

Commit

Permalink
Allow Color 4 functions in plain CSS (#2505)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Feb 5, 2025
1 parent aed7839 commit d973e3e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
22 changes: 14 additions & 8 deletions lib/src/parse/css.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d973e3e

Please sign in to comment.