Skip to content

Commit 59dde59

Browse files
committed
Update Dart Sass version and release
1 parent c4824db commit 59dde59

File tree

22 files changed

+248
-42
lines changed

22 files changed

+248
-42
lines changed

CHANGELOG.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,209 @@
1+
## 1.79.1
2+
3+
* No user-visible changes.
4+
5+
## 1.79.0
6+
7+
* **Breaking change**: Passing a number with unit `%` to the `$alpha` parameter
8+
of `color.change()`, `color.adjust()`, `change-color()`, and `adjust-color()`
9+
is now interpreted as a percentage, instead of ignoring the unit. For example,
10+
`color.change(red, $alpha: 50%)` now returns `rgb(255 0 0 / 0.5)`.
11+
12+
* **Potentially breaking compatibility fix**: Sass no longer rounds RGB channels
13+
to the nearest integer. This means that, for example, `rgb(0 0 1) != rgb(0 0
14+
0.6)`. This matches the latest version of the CSS spec and browser behavior.
15+
16+
* **Potentially breaking compatibility fix**: Passing large positive or negative
17+
values to `color.adjust()` can now cause a color's channels to go outside that
18+
color's gamut. In most cases this will currently be clipped by the browser and
19+
end up showing the same color as before, but once browsers implement gamut
20+
mapping it may produce a different result.
21+
22+
* Add support for CSS Color Level 4 [color spaces]. Each color value now tracks
23+
its color space along with the values of each channel in that color space.
24+
There are two general principles to keep in mind when dealing with new color
25+
spaces:
26+
27+
1. With the exception of legacy color spaces (`rgb`, `hsl`, and `hwb`), colors
28+
will always be emitted in the color space they were defined in unless
29+
they're explicitly converted.
30+
31+
2. The `color.to-space()` function is the only way to convert a color to
32+
another color space. Some built-in functions may do operations in a
33+
different color space, but they'll always convert back to the original space
34+
afterwards.
35+
36+
* `rgb` colors can now have non-integer channels and channels outside the normal
37+
gamut of 0-255. These colors are always emitted using the `rgb()` syntax so
38+
that modern browsers that are being displayed on wide-gamut devices can
39+
display the most accurate color possible.
40+
41+
* Add support for all the new color syntax defined in Color Level 4, including:
42+
43+
* `oklab()`, `oklch()`, `lab()`, and `lch()` functions;
44+
* a top-level `hwb()` function that matches the space-separated CSS syntax;
45+
* and a `color()` function that supports the `srgb`, `srgb-linear`,
46+
`display-p3`, `a98-rgb`, `prophoto-rgb`, `rec2020`, `xyz`, `xyz-d50`, and
47+
`xyz-d65` color spaces.
48+
49+
* Add new functions for working with color spaces:
50+
51+
* `color.to-space($color, $space)` converts `$color` to the given `$space`. In
52+
most cases this conversion is lossless—the color may end up out-of-gamut for
53+
the destination color space, but browsers will generally display it as best
54+
they can regardless. However, the `hsl` and `hwb` spaces can't represent
55+
out-of-gamut colors and so will be clamped.
56+
57+
* `color.channel($color, $channel, $space: null)` returns the value of the
58+
given `$channel` in `$color`, after converting it to `$space` if necessary.
59+
It should be used instead of the old channel-specific functions such as
60+
`color.red()` and `color.hue()`.
61+
62+
* `color.same($color1, $color2)` returns whether two colors represent the same
63+
color even across color spaces. It differs from `$color1 == $color2` because
64+
`==` never consider colors in different (non-legacy) spaces as equal.
65+
66+
* `color.is-in-gamut($color, $space: null)` returns whether `$color` is
67+
in-gamut for its color space (or `$space` if it's passed).
68+
69+
* `color.to-gamut($color, $space: null)` returns `$color` constrained to its
70+
space's gamut (or to `$space`'s gamut, if passed). This is generally not
71+
recommended since even older browsers will display out-of-gamut colors as
72+
best they can, but it may be necessary in some cases.
73+
74+
* `color.space($color)`: Returns the name of `$color`'s color space.
75+
76+
* `color.is-legacy($color)`: Returns whether `$color` is in a legacy color
77+
space (`rgb`, `hsl`, or `hwb`).
78+
79+
* `color.is-powerless($color, $channel, $space: null)`: Returns whether the
80+
given `$channel` of `$color` is powerless in `$space` (or its own color
81+
space). A channel is "powerless" if its value doesn't affect the way the
82+
color is displayed, such as hue for a color with 0 chroma.
83+
84+
* `color.is-missing($color, $channel)`: Returns whether `$channel`'s value is
85+
missing in `$color`. Missing channels can be explicitly specified using the
86+
special value `none` and can appear automatically when `color.to-space()`
87+
returns a color with a powerless channel. Missing channels are usually
88+
treated as 0, except when interpolating between two colors and in
89+
`color.mix()` where they're treated as the same value as the other color.
90+
91+
* Update existing functions to support color spaces:
92+
93+
* `hsl()` and `color.hwb()` no longer forbid out-of-bounds values. Instead,
94+
they follow the CSS spec by clamping them to within the allowed range.
95+
96+
* `color.change()`, `color.adjust()`, and `color.scale()` now support all
97+
channels of all color spaces. However, if you want to modify a channel
98+
that's not in `$color`'s own color space, you have to explicitly specify the
99+
space with the `$space` parameter. (For backwards-compatibility, this
100+
doesn't apply to legacy channels of legacy colors—for example, you can still
101+
adjust an `rgb` color's saturation without passing `$space: hsl`).
102+
103+
* `color.mix()` and `color.invert()` now support the standard CSS algorithm
104+
for interpolating between two colors (the same one that's used for gradients
105+
and animations). To use this, pass the color space to use for interpolation
106+
to the `$method` parameter. For polar color spaces like `hsl` and `oklch`,
107+
this parameter also allows you to specify how hue interpolation is handled.
108+
109+
* `color.complement()` now supports a `$space` parameter that indicates which
110+
color space should be used to take the complement.
111+
112+
* `color.grayscale()` now operates in the `oklch` space for non-legacy colors.
113+
114+
* `color.ie-hex-str()` now automatically converts its color to the `rgb` space
115+
and gamut-maps it so that it can continue to take colors from any color
116+
space.
117+
118+
[color spaces]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
119+
120+
* The following functions are now deprecated, and uses should be replaced with
121+
the new color-space-aware functions defined above:
122+
123+
* The `color.red()`, `color.green()`, `color.blue()`, `color.hue()`,
124+
`color.saturation()`, `color.lightness()`, `color.whiteness()`, and
125+
`color.blackness()` functions, as well as their global counterparts, should
126+
be replaced with calls to `color.channel()`.
127+
128+
* The global `adjust-hue()`, `saturate()`, `desaturate()`, `lighten()`,
129+
`darken()`, `transaprentize()`, `fade-out()`, `opacify()`, and `fade-in()`
130+
functions should be replaced by `color.adjust()` or `color.scale()`.
131+
132+
* Add a `global-builtin` future deprecation, which can be opted-into with the
133+
`--future-deprecation` flag or the `futureDeprecations` option in the JS or
134+
Dart API. This emits warnings when any global built-in functions that are
135+
now available in `sass:` modules are called. It will become active by default
136+
in an upcoming release alongside the `@import` deprecation.
137+
138+
### Dart API
139+
140+
* Added a `ColorSpace` class which represents the various color spaces defined
141+
in the CSS spec.
142+
143+
* Added `SassColor.space` which returns a color's color space.
144+
145+
* Added `SassColor.channels` and `.channelsOrNull` which returns a list
146+
of channel values, with missing channels converted to 0 or exposed as null,
147+
respectively.
148+
149+
* Added `SassColor.isLegacy`, `.isInGamut`, `.channel()`, `.isChannelMissing()`,
150+
`.isChannelPowerless()`, `.toSpace()`, `.toGamut()`, `.changeChannels()`, and
151+
`.interpolate()` which do the same thing as the Sass functions of the
152+
corresponding names.
153+
154+
* `SassColor.rgb()` now allows out-of-bounds and non-integer arguments.
155+
156+
* `SassColor.hsl()` and `.hwb()` now allow out-of-bounds arguments.
157+
158+
* Added `SassColor.hwb()`, `.srgb()`, `.srgbLinear()`, `.displayP3()`,
159+
`.a98Rgb()`, `.prophotoRgb()`, `.rec2020()`, `.xyzD50()`, `.xyzD65()`,
160+
`.lab()`, `.lch()`, `.oklab()`, `.oklch()`, and `.forSpace()` constructors.
161+
162+
* Deprecated `SassColor.red`, `.green`, `.blue`, `.hue`, `.saturation`,
163+
`.lightness`, `.whiteness`, and `.blackness` in favor of
164+
`SassColor.channel()`.
165+
166+
* Deprecated `SassColor.changeRgb()`, `.changeHsl()`, and `.changeHwb()` in
167+
favor of `SassColor.changeChannels()`.
168+
169+
* Added `SassNumber.convertValueToUnit()` as a shorthand for
170+
`SassNumber.convertValue()` with a single numerator.
171+
172+
* Added `InterpolationMethod` and `HueInterpolationMethod` which collectively
173+
represent the method to use to interpolate two colors.
174+
175+
### JS API
176+
177+
* While the legacy API has been deprecated since we released the modern API, we
178+
now emit warnings when the legacy API is used to make sure users are aware
179+
that it will be removed in Dart Sass 2.0.0. In the meantime, you can silence
180+
these warnings by passing `legacy-js-api` in `silenceDeprecations` when using
181+
the legacy API.
182+
183+
* Modify `SassColor` to accept a new `space` option, with support for all the
184+
new color spaces defined in Color Level 4.
185+
186+
* Add `SassColor.space` which returns a color's color space.
187+
188+
* Add `SassColor.channels` and `.channelsOrNull` which returns a list of channel
189+
values, with missing channels converted to 0 or exposed as null, respectively.
190+
191+
* Add `SassColor.isLegacy`, `.isInGamut()`, `.channel()`, `.isChannelMissing()`,
192+
`.isChannelPowerless()`, `.toSpace()`, `.toGamut()`, `.change()`, and
193+
`.interpolate()` which do the same thing as the Sass functions of the
194+
corresponding names.
195+
196+
* Deprecate `SassColor.red`, `.green`, `.blue`, `.hue`, `.saturation`,
197+
`.lightness`, `.whiteness`, and `.blackness` in favor of
198+
`SassColor.channel()`.
199+
200+
### Embedded Sass
201+
202+
* Add `Color` SassScript value, with support for all the new color spaces
203+
defined in Color Level 4.
204+
205+
* Remove `RgbColor`, `HslColor` and `HwbColor` SassScript values.
206+
1207
## 1.78.0
2208

3209
* The `meta.feature-exists` function is now deprecated. This deprecation is

npm/android-arm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-android-arm",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The android-arm binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/android-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-android-arm64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The android-arm64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/android-ia32/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-android-ia32",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The android-ia32 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/android-riscv64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-android-riscv64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The android-riscv64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/android-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-android-x64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The android-x64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-darwin-arm64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The darwin-arm64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-darwin-x64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The darwin-x64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/linux-arm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-linux-arm",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The linux-arm binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

npm/linux-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-embedded-linux-arm64",
3-
"version": "1.78.0",
3+
"version": "1.79.1",
44
"description": "The linux-arm64 binary for sass-embedded",
55
"repository": "sass/embedded-host-node",
66
"author": "Google Inc.",

0 commit comments

Comments
 (0)