From e484f9123e733b286ececf8d641e85807a57e0ab Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 5 Nov 2024 22:40:14 +0000 Subject: [PATCH 01/12] Mark the moz-document deprecation as obsolete (#3976) --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- tool/sync-deprecations.ts | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 19c24ceafe..348dcc29cd 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: 47c97f7824eb25d7f1e64e3230938b88330d40b4 + // Checksum: 651decb8bf8d0378b657241a5a0db7272c228fd4 /** * Deprecation for passing a string directly to meta.call(). @@ -26,6 +26,7 @@ export interface Deprecations { * Deprecation for @-moz-document. * * This deprecation became active in Dart Sass 1.7.2. + * It became obsolete in Dart Sass 2.0.0. */ 'moz-document': Deprecation<'moz-document'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index a651b137a6..5c0999187c 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -31,8 +31,9 @@ elseif: moz-document: description: "@-moz-document." dart-sass: - status: active + status: obsolete deprecated: 1.7.2 + obsolete: 2.0.0 relative-canonical: description: Imports using relative canonical URLs. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 35bcfde24a..13a3885964 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; diff --git a/tool/sync-deprecations.ts b/tool/sync-deprecations.ts index 49861f9fdd..93ac921e6a 100644 --- a/tool/sync-deprecations.ts +++ b/tool/sync-deprecations.ts @@ -64,7 +64,7 @@ const docRegex = ? 'This deprecation was active in the first version of Dart Sass.' : `This deprecation became active in Dart Sass ${dartSass.deprecated}.`; const obsoleteText = dartSass.obsolete - ? `\nIt became obsolete in Dart Sass ${dartSass.obsolete}.` + ? `\n * It became obsolete in Dart Sass ${dartSass.obsolete}.` : ''; docList += ` /** * Deprecation for ${lowercase.replace(/\$PLATFORM/g, 'JS')} From 1c4d51ac3b7d516841a6b302d294b0d51349b79f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Sat, 8 Mar 2025 02:34:26 +0000 Subject: [PATCH 02/12] Mark bogus combinators and moz-document as obsolete (#4040) --- .github/workflows/ci.yml | 11 +++++++++ js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- test/deprecations-check.ts | 42 ++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a289e1b9c6..03da13a4ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,17 @@ jobs: - run: npm ci - run: npm run link-check + deprecations: + name: Deprecations + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: {node-version: '${{ env.NODE_VERSION }}'} + - run: npm ci + - run: npm run deprecations-check + js_api_mirroring: name: JS API mirroring runs-on: ubuntu-latest diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 348dcc29cd..0aec4dd3ed 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: 651decb8bf8d0378b657241a5a0db7272c228fd4 + // Checksum: f34f224d924705c05c56bfc57a398706597f6c64 /** * Deprecation for passing a string directly to meta.call(). @@ -62,6 +62,7 @@ export interface Deprecations { * Deprecation for leading, trailing, and repeated combinators. * * This deprecation became active in Dart Sass 1.54.0. + * It became obsolete in Dart Sass 2.0.0. */ 'bogus-combinators': Deprecation<'bogus-combinators'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 5c0999187c..01e076d516 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -62,8 +62,9 @@ slash-div: bogus-combinators: description: Leading, trailing, and repeated combinators. dart-sass: - status: active + status: obsolete deprecated: 1.54.0 + obsolete: 2.0.0 strict-unary: description: Ambiguous + and - operators. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 13a3885964..f72e65ba31 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; diff --git a/test/deprecations-check.ts b/test/deprecations-check.ts index 5b373a652a..7794024ead 100644 --- a/test/deprecations-check.ts +++ b/test/deprecations-check.ts @@ -1,5 +1,17 @@ import * as crypto from 'crypto'; import * as fs from 'fs'; +import {parse} from 'yaml'; + +interface YamlData { + [key: string]: { + description: string; + 'dart-sass': { + status: 'active' | 'future' | 'obsolete'; + deprecated?: string; + obsolete?: string; + }; + }; +} const yamlFile = 'spec/deprecations.yaml'; const specFile = 'spec/js-api/deprecations.d.ts.md'; @@ -18,5 +30,35 @@ const docFile = 'js-api-doc/deprecations.d.ts'; ) { console.error('Deprecations out-of-sync. Run `npm run sync-deprecations`.'); process.exitCode = 1; + return; + } + + const deprecations = parse(yamlText) as YamlData; + for (const [id, deprecation] of Object.entries(deprecations)) { + const dartSass = deprecation['dart-sass']; + + if (dartSass.deprecated && dartSass.status === 'future') { + console.error( + `Deprecation "${id}" has a version but its status is future.` + ); + process.exitCode = 1; + } else if (!dartSass.deprecated && dartSass.status !== 'future') { + console.error( + `Deprecation "${id}" has status ${dartSass.status} but no deprecated ` + + 'version.' + ); + process.exitCode = 1; + } else if (dartSass.obsolete && dartSass.status !== 'obsolete') { + console.error( + `Deprecation "${id}" has an obsolete version but its status isn't ` + + 'obsolete.' + ); + process.exitCode = 1; + } else if (!dartSass.obsolete && dartSass.status === 'obsolete') { + console.error( + `Deprecation "${id}" has status obsolete but no obsolete version.` + ); + process.exitCode = 1; + } } })(); From ebceed8ed7e6370280b5e25a2582c4fb5abf8156 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Wed, 2 Apr 2025 23:01:05 +0000 Subject: [PATCH 03/12] Mark the elseif deprecation as obsolete (#4057) --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 0de65f9c1c..5d3ec1d36d 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: cd61dac9558368fdb6f4221bb23d917003b61610 + // Checksum: e386251fa5eea522619d91ac98daf84dd474c29d /** * Deprecation for passing a string directly to meta.call(). @@ -19,6 +19,7 @@ export interface Deprecations { * Deprecation for @elseif. * * This deprecation became active in Dart Sass 1.3.2. + * It became obsolete in Dart Sass 2.0.0. */ elseif: Deprecation<'elseif'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 45eb93a382..ef8f5dc1b8 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -25,8 +25,9 @@ call-string: elseif: description: "@elseif." dart-sass: - status: active + status: obsolete deprecated: 1.3.2 + obsolete: 2.0.0 moz-document: description: "@-moz-document." diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 377b444221..8045165f2f 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From 304dec5651c252f583141846dad559a5328bef8c Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 2 Sep 2025 10:43:49 -0700 Subject: [PATCH 04/12] Remove duplicate deprecations check --- .github/workflows/ci.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91359d5a26..f1d025d7d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,17 +44,6 @@ jobs: - run: npm ci - run: npm run link-check - deprecations: - name: Deprecations - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: {node-version: '${{ env.NODE_VERSION }}'} - - run: npm ci - - run: npm run deprecations-check - js_api_mirroring: name: JS API mirroring runs-on: ubuntu-latest From a375ba81edf447c674d5326f175808e7d97b4bbe Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 8 Sep 2025 14:12:10 -0700 Subject: [PATCH 05/12] [Duplicate Var Flags] Mark as obsolete (#4129) Closes #2607 --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index f2664544b9..83c47b3632 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: f9088047deb7019c0d619480b54cea07a65abbb4 + // Checksum: d1c9c01ca8d2b69e39b7371d774c9c86349efdef /** * Deprecation for passing a string directly to meta.call(). @@ -85,6 +85,7 @@ export interface Deprecations { * Deprecation for using !default or !global multiple times for one variable. * * This deprecation became active in Dart Sass 1.62.0. + * It became obsolete in Dart Sass 2.0.0. */ 'duplicate-var-flags': Deprecation<'duplicate-var-flags'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 3b9723f598..bcb7bd93e9 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -82,8 +82,9 @@ function-units: duplicate-var-flags: description: Using !default or !global multiple times for one variable. dart-sass: - status: active + status: obsolete deprecated: 1.62.0 + obsolete: 2.0.0 null-alpha: description: Passing null as alpha in the $PLATFORM API. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index f30b61ae42..83250510d6 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From 6cfa8f82bfe9619c63e1c836129ba5ca028270f8 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Tue, 9 Sep 2025 16:28:38 -0700 Subject: [PATCH 06/12] [New Global] Mark as obsolete (#4130) Closes #2606 --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 83c47b3632..df3afb6145 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: d1c9c01ca8d2b69e39b7371d774c9c86349efdef + // Checksum: 0be67f32391e119205f8e98cd15fa8e7382b6dd2 /** * Deprecation for passing a string directly to meta.call(). @@ -42,6 +42,7 @@ export interface Deprecations { * Deprecation for declaring new variables with !global. * * This deprecation became active in Dart Sass 1.17.2. + * It became obsolete in Dart Sass 2.0.0. */ 'new-global': Deprecation<'new-global'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index bcb7bd93e9..13c7c4fe6f 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -45,8 +45,9 @@ relative-canonical: new-global: description: Declaring new variables with !global. dart-sass: - status: active + status: obsolete deprecated: 1.17.2 + obsolete: 2.0.0 color-module-compat: description: Using color module functions in place of plain CSS functions. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 83250510d6..7c11411c8a 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From a56d6241968787c0960322b509dc2a98413f52ee Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 22 Sep 2025 15:19:20 -0700 Subject: [PATCH 07/12] [Slash Div] Mark as obsolete and update specs (#4131) This updates the specifications to remove references to the intermediate `/`-as-division compatibility semantics. It also adds a deprecation for `list.slash()`, which is no longer necessary once `/` is interpreted as a list separator. See #2565 --- accepted/slash-separator.changes.md | 4 ++++ accepted/slash-separator.md | 26 ++++++++++++++++++------- js-api-doc/deprecations.d.ts | 10 +++++++++- spec/built-in-modules/color.md | 30 +---------------------------- spec/built-in-modules/math.md | 7 +------ spec/deprecations.yaml | 9 ++++++++- spec/js-api/deprecations.d.ts.md | 3 ++- spec/types/calculation.md | 8 +++++--- spec/types/list.md | 7 +++++-- 9 files changed, 54 insertions(+), 50 deletions(-) diff --git a/accepted/slash-separator.changes.md b/accepted/slash-separator.changes.md index b6fdcb6c0c..ce6dfed18c 100644 --- a/accepted/slash-separator.changes.md +++ b/accepted/slash-separator.changes.md @@ -1,3 +1,7 @@ +## Draft 3.2 + +* Support slash-separated lists with missing elements. + ## Draft 3.1 * Update to accommodate new calculation parsing logic. diff --git a/accepted/slash-separator.md b/accepted/slash-separator.md index bbaa3344b9..bc7fab0e31 100644 --- a/accepted/slash-separator.md +++ b/accepted/slash-separator.md @@ -1,4 +1,4 @@ -# Forward Slash as a Separator: Draft 3.1 +# Forward Slash as a Separator: Draft 3.2 *([Issue](https://github.com/sass/sass/issues/2565), [Changelog](slash-separator.changes.md))* @@ -24,6 +24,7 @@ operator. * [`SlashListExpression`](#slashlistexpression) * [Semantics](#semantics) * [Slash-Separated Lists](#slash-separated-lists) + * [`SlashListExpression`](#slashlistexpression-1) * [`math.div()` Function](#mathdiv-function) * [`list.slash()` Function](#listslash-function) * [`rgb()` Function](#rgb-function) @@ -226,10 +227,13 @@ support for slash-separated lists. The new grammar for this production is:
 ~~**CommaListExpression** ::= SpaceListExpression (',' SpaceListExpression)*~~
-**CommaListExpression** ::= SlashListExpression (',' SlashListExpression)*
-**SlashListExpression** ::= SpaceListExpression ('/' SpaceListExpression)*
+**CommaListExpression**   ::= SlashListExpression (',' SlashListExpression)*
+**SlashListExpression**   ::= SpaceListExpression (('/' SpaceListExpression?)* '/' SpaceListExpression)?
 
+Every pair of adjacent `/`s in a `SlashListExpression` must be separated by +whitespace or comments, unless the stylesheet is being parsed as CSS. + > Note that `/` may *not* be used in single-element lists the way `,` is. That > is, `(foo,)` is valid, but `(foo/)` is not. > @@ -249,10 +253,6 @@ operator. The new grammar for this production is: **ProductExpression** ::= (ProductExpression ('*' | '%'))? UnaryPlusExpression -When a `SlashListExpression` with one or more `/`s is evaluated, it produces a -list object whose contents are the values of its constituent -`SpaceListExpression`s and whose separator is "slash". - ## Procedures ### Evaluating a `FunctionCall` as a Calculation @@ -272,6 +272,8 @@ another calculation-safe expression with the precedence of * Return a copy of `expression` except, for each `SlashListExpression`: + * If any `/` isn't followed by a `SpaceListExpression`, throw an error. + * Let `left` be the first element of the list. * For each remaining element `right`: @@ -345,6 +347,16 @@ must have exactly one `/` between each adjacent pair of elements. > Although CSS doesn't currently make use of this syntax, there's nothing > stopping a list from being both bracketed and slash-separated. +### `SlashListExpression` + +To evaluate a `SlashListExpression`, evaluate each of its `SpaceListExpression`s +and return a slash-separated list that contains each of the results in order. If +any `/` isn't followed by a `SpaceListExpression`, use an unquoted string whose +contents is a single U+0020 SPACE as its value instead. + +> A space is used instead of an empty string to avoid the list element being +> considered "blank" and automatically omitted during serialization. + ### `math.div()` Function The `div()` function in the `sass:math` module has the following signature: diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index df3afb6145..c9e652fc13 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: 0be67f32391e119205f8e98cd15fa8e7382b6dd2 + // Checksum: da3a1fd53f628e2633aef3b7560951c00d48e1a1 /** * Deprecation for passing a string directly to meta.call(). @@ -57,6 +57,7 @@ export interface Deprecations { * Deprecation for / operator for division. * * This deprecation became active in Dart Sass 1.33.0. + * It became obsolete in Dart Sass 2.0.0. */ 'slash-div': Deprecation<'slash-div'>; @@ -190,6 +191,13 @@ export interface Deprecations { */ 'misplaced-rest': Deprecation<'misplaced-rest'>; + /** + * Deprecation for the list.slash() function. + * + * This deprecation became active in Dart Sass 2.0.0. + */ + 'list-slash': Deprecation<'list-slash'>; + // END AUTOGENERATED LIST /** diff --git a/spec/built-in-modules/color.md b/spec/built-in-modules/color.md index c2e653c542..e285263100 100644 --- a/spec/built-in-modules/color.md +++ b/spec/built-in-modules/color.md @@ -277,34 +277,6 @@ The procedure is: * Let `components` be an unbracketed space separated list of all except the last element of `input`. - * If the last element of `input` is an unquoted string that contains `/`: - - > This solves for a legacy handling of `/` in Sass that would produce an - > unquoted string when the alpha value is a CSS function such as `var()`, - > when either value is `none`, or when using relative color syntax. - - * Let `split-last` be the result calling `string.split()` with the last - element of `input` as the string to split, and `/` as the separator. - - * If `split-last` doesn't have exactly two items, return an unquoted string - with the value of `input`. - - > This ensures that `rgb(1 2 calc(var(--a) / var(--b)) / var(--c))` is - > handled correctly after the final expresssion is fully converted to a - > string due to legacy `/` behavior. - - * If either item in `split-last` can be parsed as a number, replace the - current value of the item with the resulting number value. - - * Let `alpha` be the second element in `split-last`, and append the first - element of `split-last` to `components`. - - * Otherwise, if the last element of `input` has preserved its status as two - slash-separated numbers: - - * Let `alpha` be the number after the slash, and append the number before - the slash to `components`. - * Otherwise, append the last element of `input` to `components`. * If `components` is an empty list, throw an error. @@ -1108,7 +1080,7 @@ hue($color) ``` * Return the result of calling the global function - `hwb(list.slash($hue $whiteness $blackness, $alpha))`. + `hwb($hue $whiteness $blackness / $alpha))`. ### `ie-hex-str()` diff --git a/spec/built-in-modules/math.md b/spec/built-in-modules/math.md index a2f52f341a..ee570a8e60 100644 --- a/spec/built-in-modules/math.md +++ b/spec/built-in-modules/math.md @@ -401,12 +401,7 @@ This function is also available as a global function named `unit()`. div($number1, $number2) ``` -* If `$number1` is a color and `$number2` is either a number or a color, throw an - error. -* Otherwise, if `$number2` is a number and `$number2` is a color, throw an error. -* Otherwise, if either of `$number1` or `$number2` are not numbers, return an - unquoted string whose contents is the result of serializing `$number1` - followed by `"/"` followed by the result of serializing `$number2`. +* If either of `$number1` or `$number2` are not numbers, throw an error. * Let `quotient` be a number such that: * Its value is the result of `divide($number1.value, $number2.value)` as defined by [IEEE 754 2019], ยง5.4.1. diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 13c7c4fe6f..b9189ea434 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -58,8 +58,9 @@ color-module-compat: slash-div: description: / operator for division. dart-sass: - status: active + status: obsolete deprecated: 1.33.0 + obsolete: 2.0.0 bogus-combinators: description: Leading, trailing, and repeated combinators. @@ -172,3 +173,9 @@ misplaced-rest: dart-sass: status: active deprecated: 1.91.0 + +list-slash: + description: 'The list.slash() function.' + dart-sass: + status: active + deprecated: 2.0.0 diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 7c11411c8a..0e9c7648b4 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; @@ -57,6 +57,7 @@ export interface Deprecations { 'type-function': Deprecation<'type-function'>; 'compile-string-relative-url': Deprecation<'compile-string-relative-url'>; 'misplaced-rest': Deprecation<'misplaced-rest'>; + 'list-slash': Deprecation<'list-slash'>; 'user-authored': Deprecation<'user-authored', 'user'>; } ``` diff --git a/spec/types/calculation.md b/spec/types/calculation.md index 663cb893a6..91350668cc 100644 --- a/spec/types/calculation.md +++ b/spec/types/calculation.md @@ -175,6 +175,8 @@ another calculation-safe expression with the precedence of * Return a copy of `expression` except, for each `SlashListExpression`: + * If any `/` isn't followed by a `SpaceListExpression`, throw an error. + * Let `left` be the first element of the list. * For each remaining element `right`: @@ -189,7 +191,7 @@ another calculation-safe expression with the precedence of `SlashListExpression` with elements `last-left` and `first-right`, followed by all operators and operands of `right` except `first-right`. - > For example, `slash-list(1 + 2, 3 + 4)` becomes `1 + (2 / 3) + 4`. + > For example, `1 + 2 / 3 + 4)` becomes `1 + (2 / 3) + 4`. * Otherwise, if `left` is a `SumExpression`: @@ -199,7 +201,7 @@ another calculation-safe expression with the precedence of operators of `left` except `last-left`, followed by a `SlashListExpression` with elements `last-left` and `right`. - > For example, `slash-list(1 + 2, 3)` becomes `1 + (2 / 3)`. + > For example, `1 + 2 / 3` becomes `1 + (2 / 3)`. * Otherwise, if `right` is a `SumExpression` or a `ProductExpression`: @@ -209,7 +211,7 @@ another calculation-safe expression with the precedence of `SlashListExpression` with elements `left` and `first-right`, followed by operators and operands of `right` except `first-right`. - > For example, `slash-list(1, 2 * 3)` becomes `(1 / 2) * 3`. + > For example, `1 / 2 * 3` becomes `(1 / 2) * 3`. * Otherwise, if `left` is a slash-separated list, add `right` to the end. diff --git a/spec/types/list.md b/spec/types/list.md index b3e2e97856..5e4106569a 100644 --- a/spec/types/list.md +++ b/spec/types/list.md @@ -78,5 +78,8 @@ whitespace or comments, unless the stylesheet is being parsed as CSS. To evaluate a `SlashListExpression`, evaluate each of its `SpaceListExpression`s and return a slash-separated list that contains each of the results in order. If -any `/` isn't followed by a `SpaceListExpression`, use an empty unquoted string -as its value instead. +any `/` isn't followed by a `SpaceListExpression`, use an unquoted string whose +contents is a single U+0020 SPACE as its value instead. + +> A space is used instead of an empty string to avoid the list element being +> considered "blank" and automatically omitted during serialization. From a6b691f85c6417579572210a303eaf3c94d51a3d Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 29 Sep 2025 14:26:25 -0700 Subject: [PATCH 08/12] [Function Units] Mark as obsolete (#4139) See #2904 --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index c9e652fc13..533b975d6d 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: da3a1fd53f628e2633aef3b7560951c00d48e1a1 + // Checksum: 212de63e7334243c6de7f9be29bbad0e1eaa2eea /** * Deprecation for passing a string directly to meta.call(). @@ -80,6 +80,7 @@ export interface Deprecations { * Deprecation for passing invalid units to built-in functions. * * This deprecation became active in Dart Sass 1.56.0. + * It became obsolete in Dart Sass 2.0.0. */ 'function-units': Deprecation<'function-units'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index b9189ea434..540ad3c1fa 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -78,8 +78,9 @@ strict-unary: function-units: description: Passing invalid units to built-in functions. dart-sass: - status: active + status: obsolete deprecated: 1.56.0 + obsolete: 2.0.0 duplicate-var-flags: description: Using !default or !global multiple times for one variable. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 0e9c7648b4..91d546bb26 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From 64fb0384290e3b67a76e930d87f76a4e066f161f Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 5 Jan 2026 22:33:33 +0000 Subject: [PATCH 09/12] Mark the abs-percent deprecation as obsolete (#4172) --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index c2d8f9ee8e..d78e951624 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: cb70c693b61a37ecfffb93f16d2fb353bcf0ecee + // Checksum: 8784802f050f4282b22d882c3ef18472bb920faa /** * Deprecation for passing a string directly to meta.call(). @@ -103,6 +103,7 @@ export interface Deprecations { * Deprecation for passing percentages to the Sass abs() function. * * This deprecation became active in Dart Sass 1.65.0. + * It became obsolete in Dart Sass 2.0.0. */ 'abs-percent': Deprecation<'abs-percent'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 5981b452c9..7b97da4344 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -98,8 +98,9 @@ null-alpha: abs-percent: description: Passing percentages to the Sass abs() function. dart-sass: - status: active + status: obsolete deprecated: 1.65.0 + obsolete: 2.0.0 fs-importer-cwd: description: Using the current working directory as an implicit load path. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index aa5df742e4..98f4e7db90 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From b72628f0060951974ead0b737712fcfb9c5b4e85 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Wed, 7 Jan 2026 21:35:39 +0000 Subject: [PATCH 10/12] [Strict Unary] Mark the strict unary deprecation as obsolete (#4177) --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index d78e951624..292937e0d4 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: 8784802f050f4282b22d882c3ef18472bb920faa + // Checksum: 263e0d996a55c71535366a16d5f9c363e931c129 /** * Deprecation for passing a string directly to meta.call(). @@ -73,6 +73,7 @@ export interface Deprecations { * Deprecation for ambiguous + and - operators. * * This deprecation became active in Dart Sass 1.55.0. + * It became obsolete in Dart Sass 2.0.0. */ 'strict-unary': Deprecation<'strict-unary'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 7b97da4344..5a2bf0ff7b 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -72,8 +72,9 @@ bogus-combinators: strict-unary: description: Ambiguous + and - operators. dart-sass: - status: active + status: obsolete deprecated: 1.55.0 + obsolete: 2.0.0 function-units: description: Passing invalid units to built-in functions. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 98f4e7db90..1b0f42c9b8 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From ce6e19d600f692ac772f09bf1aa25836284043b9 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Thu, 12 Feb 2026 01:09:27 +0000 Subject: [PATCH 11/12] [With Private] Mark as obsolete (#4190) --- js-api-doc/deprecations.d.ts | 3 ++- spec/deprecations.yaml | 3 ++- spec/js-api/deprecations.d.ts.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 292937e0d4..4becfbc61f 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: 263e0d996a55c71535366a16d5f9c363e931c129 + // Checksum: e9636ace13dcb8c5dc8243baf6ad36dbce0d694c /** * Deprecation for passing a string directly to meta.call(). @@ -199,6 +199,7 @@ export interface Deprecations { * Deprecation for configuring private variables in @use, @forward, or load-css(). * * This deprecation became active in Dart Sass 1.92.0. + * It became obsolete in Dart Sass 2.0.0. */ 'with-private': Deprecation<'with-private'>; diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 5a2bf0ff7b..24b8f86bba 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -181,8 +181,9 @@ misplaced-rest: with-private: description: Configuring private variables in @use, @forward, or load-css(). dart-sass: - status: active + status: obsolete deprecated: 1.92.0 + obsolete: 2.0.0 if-function: description: The Sass if($condition, $if-true, $if-false) function. diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index 1b0f42c9b8..c9ae354b9c 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; From b15d740a5f63cfa45ac4a10d62c350278cd6aa01 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Sat, 21 Feb 2026 00:36:11 +0000 Subject: [PATCH 12/12] [Color 4] Mark deprecations as obsolete (#4195) --- js-api-doc/deprecations.d.ts | 5 +- js-api-doc/value/color.d.ts | 67 +------- spec/deprecations.yaml | 9 +- spec/functions.md | 23 --- spec/js-api/deprecations.d.ts.md | 2 +- spec/js-api/value/color.d.ts.md | 256 +++---------------------------- 6 files changed, 37 insertions(+), 325 deletions(-) diff --git a/js-api-doc/deprecations.d.ts b/js-api-doc/deprecations.d.ts index 4becfbc61f..2b4e265a3f 100644 --- a/js-api-doc/deprecations.d.ts +++ b/js-api-doc/deprecations.d.ts @@ -6,7 +6,7 @@ */ export interface Deprecations { // START AUTOGENERATED LIST - // Checksum: e9636ace13dcb8c5dc8243baf6ad36dbce0d694c + // Checksum: 731d57cd17d5d00431e3bcb52213e660d1447ca1 /** * Deprecation for passing a string directly to meta.call(). @@ -97,6 +97,7 @@ export interface Deprecations { * Deprecation for passing null as alpha in the JS API. * * This deprecation became active in Dart Sass 1.62.3. + * It became obsolete in Dart Sass 2.0.0. */ 'null-alpha': Deprecation<'null-alpha'>; @@ -142,6 +143,7 @@ export interface Deprecations { * Deprecation for certain uses of built-in sass:color functions. * * This deprecation became active in Dart Sass 1.79.0. + * It became obsolete in Dart Sass 2.0.0. */ 'color-4-api': Deprecation<'color-4-api'>; @@ -149,6 +151,7 @@ export interface Deprecations { * Deprecation for using global color functions instead of sass:color. * * This deprecation became active in Dart Sass 1.79.0. + * It became obsolete in Dart Sass 2.0.0. */ 'color-functions': Deprecation<'color-functions'>; diff --git a/js-api-doc/value/color.d.ts b/js-api-doc/value/color.d.ts index ed8b601957..6abb5768f2 100644 --- a/js-api-doc/value/color.d.ts +++ b/js-api-doc/value/color.d.ts @@ -111,16 +111,14 @@ export class SassColor extends Value { /** * Creates an [RGB color]. * - * If `space` is missing, **only** `undefined` should be used to indicate that - * `alpha` isn't passed. If `null` is used instead, it will be treated as a - * [missing component]. See [breaking changes] for details. + * If `null` is passed for any component, it will be treated as a [missing + * component]. * * If `space` is defined and `null` is passed for any component, it will be * treated as a [missing component]. * * [RGB color]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb * [missing component]: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#missing_color_components - * [breaking changes]: /documentation/breaking-changes/null-alpha * * @throws `Error` if `alpha` is set and isn't `null` or a number between `0` * and `1`. @@ -161,9 +159,8 @@ export class SassColor extends Value { /** * Creates an [HWB color]. * - * If `space` is missing, **only** `undefined` should be used to indicate that - * `alpha` isn't passed. If `null` is used instead, it will be treated as a - * [missing component]. See [breaking changes] for details. + * If `null` is passed for any component, it will be treated as a [missing + * component]. * * If `space` is defined and `null` is passed for any component, it will be * treated as a [missing component]. @@ -508,60 +505,4 @@ export class SassColor extends Value { space?: ColorSpaceXyz; } ): SassColor; - - /** - * This color's red channel in the RGB color space. - * - * @deprecated Use {@link channel} instead. - */ - get red(): number; - - /** - * This color's green channel in the RGB color space. - * - * @deprecated Use {@link channel} instead. - */ - get green(): number; - - /** - * This color's blue channel in the RGB color space. - * - * @deprecated Use {@link channel} instead. - */ - get blue(): number; - - /** - * This color's hue in the HSL color space. - * - * @deprecated Use {@link channel} instead. - */ - get hue(): number; - - /** - * This color's saturation in the HSL color space. - * - * @deprecated Use {@link channel} instead. - */ - get saturation(): number; - - /** - * This color's lightness in the HSL color space. - * - * @deprecated Use {@link channel} instead. - */ - get lightness(): number; - - /** - * This color's whiteness in the HWB color space. - * - * @deprecated Use {@link channel} instead. - */ - get whiteness(): number; - - /** - * This color's blackness in the HWB color space. - * - * @deprecated Use {@link channel} instead. - */ - get blackness(): number; } diff --git a/spec/deprecations.yaml b/spec/deprecations.yaml index 24b8f86bba..0545cd09a6 100644 --- a/spec/deprecations.yaml +++ b/spec/deprecations.yaml @@ -93,8 +93,9 @@ duplicate-var-flags: null-alpha: description: Passing null as alpha in the $PLATFORM API. dart-sass: - status: active + status: obsolete deprecated: 1.62.3 + obsolete: 2.0.0 abs-percent: description: Passing percentages to the Sass abs() function. @@ -132,14 +133,16 @@ feature-exists: color-4-api: description: Certain uses of built-in sass:color functions. dart-sass: - status: active + status: obsolete deprecated: 1.79.0 + obsolete: 2.0.0 color-functions: description: Using global color functions instead of sass:color. dart-sass: - status: active + status: obsolete deprecated: 1.79.0 + obsolete: 2.0.0 legacy-js-api: description: Legacy JS API. diff --git a/spec/functions.md b/spec/functions.md index b3b966c882..1e418c7ddb 100644 --- a/spec/functions.md +++ b/spec/functions.md @@ -10,7 +10,6 @@ * [`EmptyFallbackVar`](#emptyfallbackvar) * [`FunctionCall`](#functioncall) * [Global Functions](#global-functions) - * [`adjust-hue()`](#adjust-hue) * [`alpha()`](#alpha) * [`color()`](#color) * [`hsl()` and `hsla()`](#hsl-and-hsla) @@ -170,28 +169,6 @@ To evaluate a `FunctionCall` `call`: > introduced. These global aliases should be avoided by stylesheet authors if > possible. -### `adjust-hue()` - -``` -adjust-hue($color, $degrees) -``` - -* If `$color` isn't a color or `$degrees` isn't a number, throw an error. - -* Let `degrees` be the result of [converting] `$degrees` to `deg` allowing - unitless. - -* Let `saturation` and `lightness` be the result of calling - [`color.saturation($color)`] and [`color.lightness($color)`], respectively. - -* Return the result of calling [`hsl()`] with `degree`, `saturation`, - `lightness`, and `$color`'s alpha channel. - -[converting]: types/number.md#converting-a-number-to-a-unit -[`hsl()`]: #hsl-and-hsla -[`color.saturation($color)`]: built-in-modules/color.md#saturation -[`color.lightness($color)`]: built-in-modules/color.md#lightness - ### `alpha()` * ``` diff --git a/spec/js-api/deprecations.d.ts.md b/spec/js-api/deprecations.d.ts.md index c9ae354b9c..c658ddd2a0 100644 --- a/spec/js-api/deprecations.d.ts.md +++ b/spec/js-api/deprecations.d.ts.md @@ -29,7 +29,7 @@ ### `Deprecations` - + ```ts export interface Deprecations { 'call-string': Deprecation<'call-string'>; diff --git a/spec/js-api/value/color.d.ts.md b/spec/js-api/value/color.d.ts.md index 9e32c9465b..e38bfcb3f2 100644 --- a/spec/js-api/value/color.d.ts.md +++ b/spec/js-api/value/color.d.ts.md @@ -50,14 +50,6 @@ import {Value} from './index'; * [`isChannelPowerless`](#ischannelpowerless) * [`interpolate`](#interpolate) * [`change`](#change) - * [`red`](#red) - * [`green`](#green) - * [`blue`](#blue) - * [`hue`](#hue) - * [`saturation`](#saturation) - * [`lightness`](#lightness) - * [`whiteness`](#whiteness) - * [`blackness`](#blackness) * [Procedures](#procedures) * [Parsing a Channel Value](#parsing-a-channel-value) * [Parsing a Clamped Channel Value](#parsing-a-clamped-channel-value) @@ -264,9 +256,6 @@ The [private `internal` field] refers to a Sass color. * If `constructionSpace` is "rgb": - * If `options.alpha` is `null` and `options.space` is not set, emit a - deprecation warning named `null-alpha`. - * Let `red` be the result of [parsing a channel value] with value `options.red`. @@ -276,8 +265,8 @@ The [private `internal` field] refers to a Sass color. * Let `blue` be the result of [parsing a channel value] with value `options.blue`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with `value` of + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with `value` of `options.alpha`, `minimum` of `0`, and `maximum` of `1`. * Set [`internal`] to the result of [`rgb(red green blue / alpha)`]. @@ -303,9 +292,6 @@ constructor(options: { * Otherwise, if `constructionSpace` is "hsl": - * If `options.alpha` is `null` and `options.space` is not set, emit a - deprecation warning named `null-alpha`. - * Let `hue` be the result of [parsing a channel value] with value `options.hue`. @@ -315,8 +301,8 @@ constructor(options: { * Let `lightness` be the result of [parsing a channel value] with `value` of `options.lightness`, `minimum` of `0`, and `maximum` of `100`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with `value` of + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with `value` of `options.alpha`, `minimum` of `0`, and `maximum` of `1`. * Set [`internal`] to the result of [`hsl(hue saturation lightness / alpha)`]. @@ -339,9 +325,6 @@ constructor(options: { * Otherwise, if `constructionSpace` is "hwb": - * If `options.alpha` is `null` and `options.space` is not set, emit a - deprecation warning named `null-alpha`. - * Let `hue` be the result of [parsing a channel value] with value `options.hue`. @@ -351,8 +334,8 @@ constructor(options: { * Let `blackness` be the result of [parsing a channel value] with value `options.blackness`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with `value` of + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with `value` of `options.alpha`, `minimum` of `0`, and `maximum` of `1`. * Set [`internal`] to the result of [`hwb(hue whiteness blackness / alpha)`]. @@ -385,9 +368,9 @@ constructor(options: { * Let `b` be the result of [parsing a channel value] with value `options.b`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with value `options.alpha`, - `minimum` of 0, and `maximum` of 1. + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with value + `options.alpha`, `minimum` of 0, and `maximum` of 1. * If `options.space` equals `lab`, set [`internal`] to the result of [`lab(lightness a b / alpha)`]. @@ -424,9 +407,9 @@ constructor(options: { * Let `h` be the result of [parsing a channel value] with value `options.h`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with value `options.alpha`, - `minimum` of 0, and `maximum` of 1. + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with value + `options.alpha`, `minimum` of 0, and `maximum` of 1. * If `options.space` equals `lch`, set [`internal`] to the result of [`lch(lightness a b / alpha)`]. @@ -463,9 +446,9 @@ constructor(options: { * Let `blue` be the result of [parsing a channel value] with value `options.blue`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with value `options.alpha`, - `minimum` of 0, and `maximum` of 1. + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with value + `options.alpha`, `minimum` of 0, and `maximum` of 1. * Let `space` be the unquoted string value of `options.space`. @@ -495,9 +478,9 @@ constructor(options: { * Let `z` be the result of [parsing a channel value] with value `options.z`. - * If `options.alpha` is not set, let `alpha` be `1`. Otherwise, let `alpha` be - the result of [parsing a clamped channel value] with value `options.alpha`, - `minimum` of 0, and `maximum` of 1. + * If `options.alpha` is `undefined`, let `alpha` be `1`. Otherwise, let + `alpha` be the result of [parsing a clamped channel value] with value + `options.alpha`, `minimum` of 0, and `maximum` of 1. * Let `space` be the unquoted string value of `options.space`. @@ -750,27 +733,7 @@ as the result of changing some of [`internal`]'s components. * Let `initialSpace` be the value of [`this.space`]. -* Let `spaceSetExplicitly` be `true` if `options.space` is defined, and `false` - otherwise. - -* Let `space` be `options.space` if `spaceSetExplicitly` is true, and the value - of `initialSpace` otherwise. - -* If `initialSpace` is a [legacy color space] and `spaceSetExplicitly` is false: - - * If `options.whiteness` or `options.blackness` is set, let `space` be `hwb`. - - * Otherwise, if `options.hue` is set and `initialSpace` is `hwb`, let space be - `hwb`. - - * Otherwise, if `options.hue`, `options.saturation`, or `options.lightness` is - set, let `space` be `hsl`. - - * Otherwise, if `options.red`, `options.green`, or `options.blue` is set, let - `space` be `rgb`. - - * If `initialSpace` is not equal to `space`, emit a deprecation warning named - `color-4-api`. +* Let `space` be `options.space ?? initialSpace`. * Let `changes` be the object `options` without `space` and its value. @@ -790,28 +753,7 @@ as the result of changing some of [`internal`]'s components. and calls the procedure [`Changing a Component Value`] with `changes` and `color` as `initial`. -* If `space` equals `hsl` and `spaceSetExplicitly` is `false`: - - * If any of `options.hue`, `options.saturation` or `options.lightness` equals - `null`, emit a deprecation warning named `color-4-api`. - - * If `options.alpha` equals `null`, emit a deprecation warning named - `null-alpha`. - - * Let `changedColor` be the result of: - - ```js - new SassColor({ - hue: options.hue ?? color.channel('hue'), - saturation: options.saturation ?? color.channel('saturation'), - lightness: options.lightness ?? color.channel('lightness'), - alpha: options.alpha ?? color.channel('alpha'), - space: space - }) - ``` - -* If `space` equals `hsl` and `spaceSetExplicitly` is `true`, let `changedColor` - be the result of: +* If `space` equals `hsl`, let `changedColor` be the result of: ```js new SassColor({ @@ -823,28 +765,7 @@ as the result of changing some of [`internal`]'s components. }) ``` -* If `space` equals `hwb` and `spaceSetExplicitly` is `false`: - - * If any of `options.hue`, `options.whiteness` or `options.blackness` equals - `null`, emit a deprecation warning named `color-4-api`. - - * If `options.alpha` equals `null`, emit a deprecation warning named - `null-alpha`. - - * Let `changedColor` be the result of: - - ```js - new SassColor({ - hue: options.hue ?? color.channel('hue'), - whiteness: options.whiteness ?? color.channel('whiteness'), - blackness: options.blackness ?? color.channel('blackness'), - alpha: options.alpha ?? color.channel('alpha'), - space: space - }) - ``` - -* If `space` equals `hwb` and `spaceSetExplicitly` is `true`, let `changedColor` - be the result of: +* If `space` equals `hwb`, let `changedColor` be the result of: ```js new SassColor({ @@ -856,39 +777,6 @@ as the result of changing some of [`internal`]'s components. }) ``` -* If `space` equals `rgb` and `spaceSetExplicitly` is `false`: - - * If any of `options.red`, `options.green` or `options.blue` equals `null`, - emit a deprecation warning named `color-4-api`. - - * If `options.alpha` equals `null`, emit a deprecation warning named - `null-alpha`. - - * Let `changedColor` be the result of: - - ```js - new SassColor({ - red: options.red ?? color.channel('red'), - green: options.green ?? color.channel('green'), - blue: options.blue ?? color.channel('blue'), - alpha: options.alpha ?? color.channel('alpha'), - space: space - }) - ``` - -* If `space` equals `rgb` and `spaceSetExplicitly` is `true`, let `changedColor` - be the result of: - - ```js - new SassColor({ - red: changedValue('red'), - green: changedValue('green'), - blue: changedValue('blue'), - alpha: changedValue('alpha'), - space: space - }) - ``` - * If `space` equals `lab` or `oklab`, let `changedColor` be the result of: ```js @@ -913,7 +801,7 @@ as the result of changing some of [`internal`]'s components. }) ``` -* If `space` equals `a98-rgb`, `display-p3`, `display-p3-linear`, +* If `space` equals `rgb`, `a98-rgb`, `display-p3`, `display-p3-linear`, `prophoto-rgb`, `rec2020`, `srgb`, or `srgb-linear`, let `changedColor` be the result of: @@ -995,106 +883,6 @@ change( ): SassColor; ``` -#### `red` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -[`channel`]: #channel - -Returns [`internal`]'s red channel in the RGB color space. - -```ts -get red(): number; -``` - -#### `green` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns [`internal`]'s green channel in the RGB color space. - -```ts -get green(): number; -``` - -#### `blue` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns [`internal`]'s blue channel in the RGB color space. - -```ts -get blue(): number; -``` - -#### `hue` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns the value of the result of [`hue(internal)`]. - -[`hue(internal)`]: ../../built-in-modules/color.md#hue - -```ts -get hue(): number; -``` - -#### `saturation` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns the value of the result of [`saturation(internal)`]. - -[`saturation(internal)`]: ../../built-in-modules/color.md#saturation - -```ts -get saturation(): number; -``` - -#### `lightness` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns the value of the result of [`lightness(internal)`]. - -[`lightness(internal)`]: ../../built-in-modules/color.md#lightness - -```ts -get lightness(): number; -``` - -#### `whiteness` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns the value of the result of [`whiteness(internal)`]. - -[`whiteness(internal)`]: ../../built-in-modules/color.md#whiteness - -```ts -get whiteness(): number; -``` - -#### `blackness` - -> This is deprecated in favor of the new [`channel`] function. This deprecation -> is called `color-4-api`. - -Returns the value of the result of [`blackness(internal)`]. - -[`blackness(internal)`]: ../../built-in-modules/color.md#blackness - -```ts -get blackness(): number; -``` - ```ts } // SassColor ```