Skip to content

Commit 9e623f3

Browse files
authored
[Color 4] Finalize deprecations (#2740)
1 parent 6b9211d commit 9e623f3

File tree

10 files changed

+90
-921
lines changed

10 files changed

+90
-921
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
division in SassScript. You can still use it for division within `calc()` and
55
other calculation expressions, or use `math.div()` instead.
66

7+
* **Breaking change:** The global functions `red()`, `green()`, `blue()`,
8+
`hue()`, `saturation()`, `lightness()`, `whiteness()`, `blackness()`,
9+
`alpha()`, `opacity()`, `adjust-hue()`, `saturate()`, `desaturate()`,
10+
`lighten()`, `darken()`, `opacify()`, `fade-in()`, `transparentize()`, and
11+
`fade-out()`, as well as their `sass:color` equivalents where they exist, have
12+
been removed.
13+
714
* **Breaking change:** `@elseif` is no longer treated as equivalent to `@else
815
if`, and is now treated like any other unknown plain CSS at-rule.
916

@@ -106,6 +113,15 @@
106113
* **Breaking change:** Remove `Deprecation.duplicateVariableFlags`. Use
107114
`Deprecation.duplicateVarFlags`.
108115

116+
#### `SassColor`
117+
118+
* **Breaking change:** Remove the `SassColor.red`, `.green`, `.blue`, `.hue`,
119+
`.saturation`, `.lightness`, `.whiteness`, and `.blackness` parameters. Use
120+
the `SassColor.channel()` method instead.
121+
122+
* **Breaking change:** Remove the `SassColor.changeRgb`, `.changeHsl`, and
123+
`.changeHwb` methods. Use `SassColor.changeChannels()` instead.
124+
109125
#### `ImporterResult`
110126

111127
* **Breaking change:** Remove `ImporterResult.isIndented`. Use
@@ -117,6 +133,29 @@
117133
* **Breaking change:** The `syntax` parameter to `ImporterResult()` is now
118134
`required` and non-nullable.
119135

136+
### JavaScript API
137+
138+
#### `SassColor`
139+
140+
* **Breaking change:** Remove the `SassColor.red`, `.green`, `.blue`, `.hue`,
141+
`.saturation`, `.lightness`, `.whiteness`, and `.blackness` parameters. Use
142+
the `SassColor.channel()` method instead.
143+
144+
* **Breaking change:** A `null` `alpha` argument for `new SassColor()` for a
145+
legacy color space is now interpreted as a missing channel rather than a fully
146+
opaque color. Use `undefined` to pass the default value for any channel or `1`
147+
to explicitly make the color opaque.
148+
149+
* **Breaking change:** Calling `SassColor.change()` for a legacy color with a
150+
`null` value now marks that channel as missing rather than using its previous
151+
value. Use `undefined` to retain the previous value.
152+
153+
* **Breaking change:** Calling `SassColor.change()` with a channel name not in
154+
the color's current color space is now an error for all colors. Previously,
155+
legacy colors would automatically convert between the RGB, HSL, and HWB color
156+
spaces. You can pass the `space` parameter to explicitly convert to a new
157+
space.
158+
120159
## 1.97.4-dev
121160

122161
### JavaScript API

lib/src/deprecation.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enum Deprecation {
1515
// DO NOT EDIT. This section was generated from the language repo.
1616
// See tool/grind/generate_deprecations.dart for details.
1717
//
18-
// Checksum: e9636ace13dcb8c5dc8243baf6ad36dbce0d694c
18+
// Checksum: 731d57cd17d5d00431e3bcb52213e660d1447ca1
1919

2020
/// Deprecation for passing a string directly to meta.call().
2121
callString('call-string',
@@ -83,6 +83,7 @@ enum Deprecation {
8383
/// Deprecation for passing null as alpha in the ${isJS ? 'JS': 'Dart'} API.
8484
nullAlpha('null-alpha',
8585
deprecatedIn: '1.62.3',
86+
obsoleteIn: '2.0.0',
8687
description: 'Passing null as alpha in the ${isJS ? 'JS' : 'Dart'} API.'),
8788

8889
/// Deprecation for passing percentages to the Sass abs() function.
@@ -116,11 +117,13 @@ enum Deprecation {
116117
/// Deprecation for certain uses of built-in sass:color functions.
117118
color4Api('color-4-api',
118119
deprecatedIn: '1.79.0',
120+
obsoleteIn: '2.0.0',
119121
description: 'Certain uses of built-in sass:color functions.'),
120122

121123
/// Deprecation for using global color functions instead of sass:color.
122124
colorFunctions('color-functions',
123125
deprecatedIn: '1.79.0',
126+
obsoleteIn: '2.0.0',
124127
description: 'Using global color functions instead of sass:color.'),
125128

126129
/// Deprecation for legacy JS API.

0 commit comments

Comments
 (0)