Skip to content

Commit d973e3e

Browse files
authored
Allow Color 4 functions in plain CSS (#2505)
1 parent aed7839 commit d973e3e

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.83.5-dev
22

3+
* Fix a bug in which various Color Level 4 functions weren't allowed in plain
4+
CSS.
5+
36
* Fix the error message for `@extend` without a selector and possibly other
47
parsing edge-cases in contexts that allow interpolation.
58

lib/src/parse/css.dart

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ import 'scss.dart';
1414
final _disallowedFunctionNames =
1515
globalFunctions.map((function) => function.name).toSet()
1616
..add("if")
17-
..remove("rgb")
18-
..remove("rgba")
17+
..remove("abs")
18+
..remove("alpha")
19+
..remove("color")
20+
..remove("grayscale")
1921
..remove("hsl")
2022
..remove("hsla")
21-
..remove("grayscale")
23+
..remove("hwb")
2224
..remove("invert")
23-
..remove("alpha")
24-
..remove("opacity")
25-
..remove("saturate")
26-
..remove("min")
25+
..remove("lab")
26+
..remove("lch")
2727
..remove("max")
28+
..remove("min")
29+
..remove("oklab")
30+
..remove("oklch")
31+
..remove("opacity")
32+
..remove("rgb")
33+
..remove("rgba")
2834
..remove("round")
29-
..remove("abs");
35+
..remove("saturate");
3036

3137
class CssParser extends ScssParser {
3238
bool get plainCss => true;

0 commit comments

Comments
 (0)