Skip to content

Commit

Permalink
Implement support for the relative color syntax of CSS Color 5 (#2098)
Browse files Browse the repository at this point in the history
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
  • Loading branch information
stof and nex3 committed Sep 28, 2023
1 parent 00823e0 commit ff56fc5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 1.68.1
## 1.69.0

* Add support for the relative color syntax from CSS Color 5. This syntax
cannot be used to create Sass color values. It is always emitted as-is in the
CSS output.

### Dart API

Expand Down
5 changes: 5 additions & 0 deletions lib/src/functions/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,11 @@ Object /* SassString | List<Value> */ _parseChannels(
}

var list = channels.asList;
if (list case [SassString(:var text, hasQuotes: false), _, ...]
when equalsIgnoreCase(text, "from")) {
return _functionString(name, [originalChannels]);
}

if (list.length > 3) {
throw SassScriptException("Only 3 elements allowed, but ${list.length} "
"were passed.");
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.68.1-dev
version: 1.69.0-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit ff56fc5

Please sign in to comment.