Skip to content

Commit

Permalink
Implement support for the relative color syntax of CSS Color 5
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Sep 27, 2023
1 parent 0b6a103 commit 0aca47b
Show file tree
Hide file tree
Showing 3 changed files with 14 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
8 changes: 8 additions & 0 deletions lib/src/functions/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,14 @@ Object /* SassString | List<Value> */ _parseChannels(
}

var list = channels.asList;
if (list.length > 1) {
switch (list[0]) {
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 0aca47b

Please sign in to comment.