Skip to content

Commit

Permalink
Don't emit warnings for plain-CSS invert() (#2394)
Browse files Browse the repository at this point in the history
Fixes sass/sass#3963.
Fixes #2393.
  • Loading branch information
jathak authored Oct 17, 2024
1 parent e6391d3 commit 2ad2133
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.80.2

* Fix a bug where deprecation warnings were incorrectly emitted for the
plain-CSS `invert()` function.

## 1.80.1

* Fix a bug where repeated deprecation warnings were not automatically limited.
Expand Down
9 changes: 6 additions & 3 deletions lib/src/functions/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ final global = UnmodifiableListView([
space: ColorSpace.rgb, name: 'channels')
}),

_function("invert", r"$color, $weight: 100%, $space: null",
(arguments) => _invert(arguments, global: true))
.withDeprecationWarning("color"),
_function("invert", r"$color, $weight: 100%, $space: null", (arguments) {
if (arguments[0] is! SassNumber && !arguments[0].isSpecialNumber) {
warnForGlobalBuiltIn("color", "invert");
}
return _invert(arguments, global: true);
}),

// ### HSL
_channelFunction("hue", ColorSpace.hsl, (color) => color.hue,
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.2

* No user-visible changes.

## 0.3.1

* No user-visible changes.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sass-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-parser",
"version": "0.3.1",
"version": "0.3.2",
"description": "A PostCSS-compatible wrapper of the official Sass parser",
"repository": "sass/sass",
"author": "Google Inc.",
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 13.1.2

* No user-visible changes.

## 13.1.1

* Make `AsyncImporterCache.wrapLogger()` and `ImporterCache.wrapLogger()` always
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: sass_api
# Note: Every time we add a new Sass AST node, we need to bump the *major*
# version because it's a breaking change for anyone who's implementing the
# visitor interface(s).
version: 13.1.1
version: 13.1.2
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
sass: 1.80.1
sass: 1.80.2

dev_dependencies:
dartdoc: ^8.0.14
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.80.1
version: 1.80.2
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 2ad2133

Please sign in to comment.