diff --git a/migrate.ts b/migrate.ts new file mode 100644 index 0000000000..5d46b023d0 --- /dev/null +++ b/migrate.ts @@ -0,0 +1,49 @@ +// Script to run the Sass migrator over a spec directory. +// +// Usage: +// npm run migrate -- directory-to-migrate [migrator-options] + +import child_process from 'child_process'; +import fs from 'fs'; +import path from 'path'; +import {fromRoot} from './lib/spec-directory'; + +async function migrate() { + const dirToMigrate = process.argv[2]; + const migratorCommand = process.argv[3]; + const migratorArgs = process.argv.slice(4); + const root = path.resolve(process.cwd(), 'spec'); + const rootDir = await fromRoot('spec'); + + await rootDir.forEachTest( + async testDir => { + const files = (await testDir.listFiles()).filter( + file => file.endsWith('.scss') || file.endsWith('.sass') + ); + console.log(testDir.relPath()); + const output = child_process.execFileSync( + path.join( + __dirname, + 'node_modules', + 'sass-migrator', + 'sass-migrator.js' + ), + [migratorCommand, `--load-path=${root}`, ...migratorArgs, ...files], + {cwd: testDir.path, encoding: 'utf8'} + ); + if (output.length > 0) console.log(output); + // Actually write the migrator's changes to the virtual directory's cache. + for (const file of files) { + await testDir.writeFile( + file, + await fs.promises.readFile(path.join(testDir.path, file), { + encoding: 'utf8', + }) + ); + } + }, + [dirToMigrate] + ); +} + +migrate(); diff --git a/package-lock.json b/package-lock.json index 9cee9fd8e1..87665dcb4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,7 @@ "lodash": "^4.17.21", "node-hrx": "^0.1.0", "prettier": "^2.1.2", + "sass-migrator": "^2.0.3", "source-map-js": "^0.6.2", "tmp": "^0.2.1", "ts-jest": "^27.0.7", @@ -7031,6 +7032,17 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "node_modules/sass-migrator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/sass-migrator/-/sass-migrator-2.0.3.tgz", + "integrity": "sha512-WaLQorgSz06q7/M+QNqkyn4d6m3NBQXFx93Ukrw88k108mIKOjBgSvyTerMpZ+5ogOJwrK82rxLBzA1J5azmJQ==", + "bin": { + "sass-migrator": "sass-migrator.js" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/saxes": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", @@ -13256,6 +13268,11 @@ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "sass-migrator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/sass-migrator/-/sass-migrator-2.0.3.tgz", + "integrity": "sha512-WaLQorgSz06q7/M+QNqkyn4d6m3NBQXFx93Ukrw88k108mIKOjBgSvyTerMpZ+5ogOJwrK82rxLBzA1J5azmJQ==" + }, "saxes": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", diff --git a/package.json b/package.json index 55f6358bc7..eb25ac38cc 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "lodash": "^4.17.21", "node-hrx": "^0.1.0", "prettier": "^2.1.2", + "sass-migrator": "^2.0.3", "source-map-js": "^0.6.2", "tmp": "^0.2.1", "ts-jest": "^27.0.7", @@ -75,6 +76,7 @@ "test": "jest", "lint-spec": "ts-node lint-spec.ts", "lint": "gts lint", + "migrate": "ts-node migrate.ts", "fix": "gts fix" }, "engines": { diff --git a/spec/core_functions/color/adjust_color/error/args.hrx b/spec/core_functions/color/adjust_color/error/args.hrx index d7291da9e2..03e4454c83 100644 --- a/spec/core_functions/color/adjust_color/error/args.hrx +++ b/spec/core_functions/color/adjust_color/error/args.hrx @@ -1,40 +1,43 @@ <===> too_few/input.scss -a {b: adjust-color()} +@use "sass:color"; +a {b: color.adjust()} <===> too_few/error Error: Missing argument $color. ,--> input.scss -1 | a {b: adjust-color()} +2 | a {b: color.adjust()} | ^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function adjust($color, $kwargs...) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many/input.scss -a {b: adjust-color(red, 1)} +@use "sass:color"; +a {b: color.adjust(red, 1)} <===> too_many/error Error: Only one positional argument is allowed. All other arguments must be passed by name. , -1 | a {b: adjust-color(red, 1)} +2 | a {b: color.adjust(red, 1)} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unknown/input.scss -a {b: adjust-color(red, $ambience: 10%)} +@use "sass:color"; +a {b: color.adjust(red, $ambience: 10%)} <===> unknown/error Error: No argument named $ambience. , -1 | a {b: adjust-color(red, $ambience: 10%)} +2 | a {b: color.adjust(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/bounds.hrx b/spec/core_functions/color/adjust_color/error/bounds.hrx index 9f3c320b2d..be6e0e1bbf 100644 --- a/spec/core_functions/color/adjust_color/error/bounds.hrx +++ b/spec/core_functions/color/adjust_color/error/bounds.hrx @@ -1,156 +1,168 @@ <===> red/too_low/input.scss -a {b: adjust-color(red, $red: -256)} +@use "sass:color"; +a {b: color.adjust(red, $red: -256)} <===> red/too_low/error Error: $red: Expected -256 to be within -255 and 255. , -1 | a {b: adjust-color(red, $red: -256)} +2 | a {b: color.adjust(red, $red: -256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/too_high/input.scss -a {b: adjust-color(red, $red: 256)} +@use "sass:color"; +a {b: color.adjust(red, $red: 256)} <===> red/too_high/error Error: $red: Expected 256 to be within -255 and 255. , -1 | a {b: adjust-color(red, $red: 256)} +2 | a {b: color.adjust(red, $red: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(red, $red: 300px)} +a {b: color.adjust(red, $red: 300px)} <===> red/unit/error Error: $red: Expected 300px to be within -255 and 255. , -3 | a {b: adjust-color(red, $red: 300px)} +4 | a {b: color.adjust(red, $red: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> green/too_low/input.scss -a {b: adjust-color(green, $green: -256)} +@use "sass:color"; +a {b: color.adjust(green, $green: -256)} <===> green/too_low/error Error: $green: Expected -256 to be within -255 and 255. , -1 | a {b: adjust-color(green, $green: -256)} +2 | a {b: color.adjust(green, $green: -256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/too_high/input.scss -a {b: adjust-color(green, $green: 256)} +@use "sass:color"; +a {b: color.adjust(green, $green: 256)} <===> green/too_high/error Error: $green: Expected 256 to be within -255 and 255. , -1 | a {b: adjust-color(green, $green: 256)} +2 | a {b: color.adjust(green, $green: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(green, $green: 300px)} +a {b: color.adjust(green, $green: 300px)} <===> green/unit/error Error: $green: Expected 300px to be within -255 and 255. , -3 | a {b: adjust-color(green, $green: 300px)} +4 | a {b: color.adjust(green, $green: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> blue/too_low/input.scss -a {b: adjust-color(blue, $blue: -256)} +@use "sass:color"; +a {b: color.adjust(blue, $blue: -256)} <===> blue/too_low/error Error: $blue: Expected -256 to be within -255 and 255. , -1 | a {b: adjust-color(blue, $blue: -256)} +2 | a {b: color.adjust(blue, $blue: -256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/too_high/input.scss -a {b: adjust-color(blue, $blue: 256)} +@use "sass:color"; +a {b: color.adjust(blue, $blue: 256)} <===> blue/too_high/error Error: $blue: Expected 256 to be within -255 and 255. , -1 | a {b: adjust-color(blue, $blue: 256)} +2 | a {b: color.adjust(blue, $blue: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(blue, $blue: 300px)} +a {b: color.adjust(blue, $blue: 300px)} <===> blue/unit/error Error: $blue: Expected 300px to be within -255 and 255. , -3 | a {b: adjust-color(blue, $blue: 300px)} +4 | a {b: color.adjust(blue, $blue: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> saturation/too_low/input.scss -a {b: adjust-color(red, $saturation: -100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: -100.001%)} <===> saturation/too_low/error Error: $saturation: Expected -100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $saturation: -100.001%)} +2 | a {b: color.adjust(red, $saturation: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/too_high/input.scss -a {b: adjust-color(red, $saturation: 100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: 100.001%)} <===> saturation/too_high/error Error: $saturation: Expected 100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $saturation: 100.001%)} +2 | a {b: color.adjust(red, $saturation: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(red, $saturation: 200px)} +a {b: color.adjust(red, $saturation: 200px)} <===> saturation/unit/error DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. @@ -160,50 +172,53 @@ To preserve current behavior: calc($saturation / 1px * 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: adjust-color(red, $saturation: 200px)} +4 | a {b: color.adjust(red, $saturation: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $saturation: Expected 200px to be within -100% and 100%. , -3 | a {b: adjust-color(red, $saturation: 200px)} +4 | a {b: color.adjust(red, $saturation: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> lightness/too_low/input.scss -a {b: adjust-color(red, $lightness: -100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: -100.001%)} <===> lightness/too_low/error Error: $lightness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $lightness: -100.001%)} +2 | a {b: color.adjust(red, $lightness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/too_high/input.scss -a {b: adjust-color(red, $lightness: 100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 100.001%)} <===> lightness/too_high/error Error: $lightness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $lightness: 100.001%)} +2 | a {b: color.adjust(red, $lightness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(red, $lightness: 200px)} +a {b: color.adjust(red, $lightness: 200px)} <===> lightness/unit/error DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. @@ -213,50 +228,53 @@ To preserve current behavior: calc($lightness / 1px * 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: adjust-color(red, $lightness: 200px)} +4 | a {b: color.adjust(red, $lightness: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $lightness: Expected 200px to be within -100% and 100%. , -3 | a {b: adjust-color(red, $lightness: 200px)} +4 | a {b: color.adjust(red, $lightness: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> alpha/too_low/input.scss -a {b: adjust-color(red, $alpha: -1.001)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: -1.001)} <===> alpha/too_low/error Error: $alpha: Expected -1.001 to be within -1 and 1. , -1 | a {b: adjust-color(red, $alpha: -1.001)} +2 | a {b: color.adjust(red, $alpha: -1.001)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/too_high/input.scss -a {b: adjust-color(red, $alpha: 1.001)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: 1.001)} <===> alpha/too_high/error Error: $alpha: Expected 1.001 to be within -1 and 1. , -1 | a {b: adjust-color(red, $alpha: 1.001)} +2 | a {b: color.adjust(red, $alpha: 1.001)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: adjust-color(red, $alpha: 50%)} +a {b: color.adjust(red, $alpha: 50%)} <===> alpha/unit/error DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. @@ -266,66 +284,70 @@ To preserve current behavior: calc($alpha / 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: adjust-color(red, $alpha: 50%)} +4 | a {b: color.adjust(red, $alpha: 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $alpha: Expected 50% to be within -1 and 1. , -3 | a {b: adjust-color(red, $alpha: 50%)} +4 | a {b: color.adjust(red, $alpha: 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> blackness/too_low/input.scss -a {b: adjust-color(red, $blackness: -100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $blackness: -100.001%)} <===> blackness/too_low/error Error: $blackness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $blackness: -100.001%)} +2 | a {b: color.adjust(red, $blackness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/too_high/input.scss -a {b: adjust-color(red, $blackness: 100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $blackness: 100.001%)} <===> blackness/too_high/error Error: $blackness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $blackness: 100.001%)} +2 | a {b: color.adjust(red, $blackness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_low/input.scss -a {b: adjust-color(red, $whiteness: -100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $whiteness: -100.001%)} <===> whiteness/too_low/error Error: $whiteness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $whiteness: -100.001%)} +2 | a {b: color.adjust(red, $whiteness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_high/input.scss -a {b: adjust-color(red, $whiteness: 100.001%)} +@use "sass:color"; +a {b: color.adjust(red, $whiteness: 100.001%)} <===> whiteness/too_high/error Error: $whiteness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: adjust-color(red, $whiteness: 100.001%)} +2 | a {b: color.adjust(red, $whiteness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/missing_globals.hrx b/spec/core_functions/color/adjust_color/error/missing_globals.hrx new file mode 100644 index 0000000000..fc8cf5a1aa --- /dev/null +++ b/spec/core_functions/color/adjust_color/error/missing_globals.hrx @@ -0,0 +1,173 @@ +<===> adjust_color/input.scss +@use "sass:color"; +a {b: color.adjust-color(#abcdef, $red: 10)} + +<===> adjust_color/error +Error: Undefined function. + , +2 | a {b: color.adjust-color(#abcdef, $red: 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> adjust_hue/input.scss +@use "sass:color"; +a {b: color.adjust-hue(#abcdef, 10)} + +<===> adjust_hue/error +Error: The function adjust-hue() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $hue: 10) + +More info: https://sass-lang.com/documentation/functions/color#adjust-hue + , +2 | a {b: color.adjust-hue(#abcdef, 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> lighten/input.scss +@use "sass:color"; +a {b: color.lighten(#abcdef, 10%)} + +<===> lighten/error +Error: The function lighten() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $lightness: 10%) + +More info: https://sass-lang.com/documentation/functions/color#lighten + , +2 | a {b: color.lighten(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> darken/input.scss +@use "sass:color"; +a {b: color.darken(#abcdef, 10%)} + +<===> darken/error +Error: The function darken() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $lightness: -10%) + +More info: https://sass-lang.com/documentation/functions/color#darken + , +2 | a {b: color.darken(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> saturate/input.scss +@use "sass:color"; +a {b: color.saturate(#abcdef, 10%)} + +<===> saturate/error +Error: The function saturate() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $saturation: 10%) + +More info: https://sass-lang.com/documentation/functions/color#saturate + , +2 | a {b: color.saturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> desaturate/input.scss +@use "sass:color"; +a {b: color.desaturate(#abcdef, 10%)} + +<===> desaturate/error +Error: The function desaturate() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $saturation: -10%) + +More info: https://sass-lang.com/documentation/functions/color#desaturate + , +2 | a {b: color.desaturate(#abcdef, 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> opacify/input.scss +@use "sass:color"; +a {b: color.opacify(#abcdef, 0.5)} + +<===> opacify/error +Error: The function opacify() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: 0.5) + +More info: https://sass-lang.com/documentation/functions/color#opacify + , +2 | a {b: color.opacify(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> fade_in/input.scss +@use "sass:color"; +a {b: color.fade-in(#abcdef, 0.5)} + +<===> fade_in/error +Error: The function fade-in() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: 0.5) + +More info: https://sass-lang.com/documentation/functions/color#fade-in + , +2 | a {b: color.fade-in(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> transparentize/input.scss +@use "sass:color"; +a {b: color.transparentize(#abcdef, 0.5)} + +<===> transparentize/error +Error: The function transparentize() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: -0.5) + +More info: https://sass-lang.com/documentation/functions/color#transparentize + , +2 | a {b: color.transparentize(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> fade_out/input.scss +@use "sass:color"; +a {b: color.fade-out(#abcdef, 0.5)} + +<===> fade_out/error +Error: The function fade-out() isn't in the sass:color module. + +Recommendation: color.adjust(#abcdef, $alpha: -0.5) + +More info: https://sass-lang.com/documentation/functions/color#fade-out + , +2 | a {b: color.fade-out(#abcdef, 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx b/spec/core_functions/color/adjust_color/error/mixed_formats.hrx index 0bdc847a80..152a6e6018 100644 --- a/spec/core_functions/color/adjust_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/adjust_color/error/mixed_formats.hrx @@ -1,88 +1,95 @@ <===> red_and_hue/input.scss -a {b: adjust-color(red, $red: 1, $hue: 1)} +@use "sass:color"; +a {b: color.adjust(red, $red: 1, $hue: 1)} <===> red_and_hue/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: adjust-color(red, $red: 1, $hue: 1)} +2 | a {b: color.adjust(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_saturation/input.scss -a {b: adjust-color(red, $green: 1, $saturation: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: adjust-color(red, $green: 1, $saturation: 1%)} +2 | a {b: color.adjust(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue_and_lightness/input.scss -a {b: adjust-color(red, $blue: 1, $lightness: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: adjust-color(red, $blue: 1, $lightness: 1%)} +2 | a {b: color.adjust(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red_and_blackness/input.scss -a {b: adjust-color(red, $red: 1, $blackness: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: adjust-color(red, $red: 1, $blackness: 1%)} +2 | a {b: color.adjust(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_whiteness/input.scss -a {b: adjust-color(red, $green: 1, $whiteness: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: adjust-color(red, $green: 1, $whiteness: 1%)} +2 | a {b: color.adjust(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation_and_blackness/input.scss -a {b: adjust-color(red, $saturation: 1%, $blackness: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: adjust-color(red, $saturation: 1%, $blackness: 1%)} +2 | a {b: color.adjust(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness_and_whiteness/input.scss -a {b: adjust-color(red, $lightness: 1%, $whiteness: 1%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: adjust-color(red, $lightness: 1%, $whiteness: 1%)} +2 | a {b: color.adjust(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/type.hrx b/spec/core_functions/color/adjust_color/error/type.hrx index bc9ed25415..91246fbe9d 100644 --- a/spec/core_functions/color/adjust_color/error/type.hrx +++ b/spec/core_functions/color/adjust_color/error/type.hrx @@ -1,127 +1,137 @@ <===> color/input.scss -a {b: adjust-color(1)} +@use "sass:color"; +a {b: color.adjust(1)} <===> color/error Error: $color: 1 is not a color. , -1 | a {b: adjust-color(1)} +2 | a {b: color.adjust(1)} | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/input.scss -a {b: adjust-color(red, $red: c)} +@use "sass:color"; +a {b: color.adjust(red, $red: c)} <===> red/error Error: $red: c is not a number. , -1 | a {b: adjust-color(red, $red: c)} +2 | a {b: color.adjust(red, $red: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/input.scss -a {b: adjust-color(red, $green: c)} +@use "sass:color"; +a {b: color.adjust(red, $green: c)} <===> green/error Error: $green: c is not a number. , -1 | a {b: adjust-color(red, $green: c)} +2 | a {b: color.adjust(red, $green: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/input.scss -a {b: adjust-color(red, $blue: c)} +@use "sass:color"; +a {b: color.adjust(red, $blue: c)} <===> blue/error Error: $blue: c is not a number. , -1 | a {b: adjust-color(red, $blue: c)} +2 | a {b: color.adjust(red, $blue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> hue/input.scss -a {b: adjust-color(red, $hue: c)} +@use "sass:color"; +a {b: color.adjust(red, $hue: c)} <===> hue/error Error: $hue: c is not a number. , -1 | a {b: adjust-color(red, $hue: c)} +2 | a {b: color.adjust(red, $hue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/input.scss -a {b: adjust-color(red, $saturation: c)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: c)} <===> saturation/error Error: $saturation: c is not a number. , -1 | a {b: adjust-color(red, $saturation: c)} +2 | a {b: color.adjust(red, $saturation: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/input.scss -a {b: adjust-color(red, $lightness: c)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: c)} <===> lightness/error Error: $lightness: c is not a number. , -1 | a {b: adjust-color(red, $lightness: c)} +2 | a {b: color.adjust(red, $lightness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/input.scss -a {b: adjust-color(red, $alpha: c)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: c)} <===> alpha/error Error: $alpha: c is not a number. , -1 | a {b: adjust-color(red, $alpha: c)} +2 | a {b: color.adjust(red, $alpha: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/input.scss -a {b: adjust-color(red, $blackness: c)} +@use "sass:color"; +a {b: color.adjust(red, $blackness: c)} <===> blackness/error Error: $blackness: c is not a number. , -1 | a {b: adjust-color(red, $blackness: c)} +2 | a {b: color.adjust(red, $blackness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/input.scss -a {b: adjust-color(red, $whiteness: c)} +@use "sass:color"; +a {b: color.adjust(red, $whiteness: c)} <===> whiteness/error Error: $whiteness: c is not a number. , -1 | a {b: adjust-color(red, $whiteness: c)} +2 | a {b: color.adjust(red, $whiteness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/error/units.hrx b/spec/core_functions/color/adjust_color/error/units.hrx index 36be8eaced..1a9edfbae2 100644 --- a/spec/core_functions/color/adjust_color/error/units.hrx +++ b/spec/core_functions/color/adjust_color/error/units.hrx @@ -1,50 +1,53 @@ <===> none/whiteness/input.scss -a {b: adjust-color(white, $whiteness: 1)} +@use "sass:color"; +a {b: color.adjust(white, $whiteness: 1)} <===> none/whiteness/error Error: $whiteness: Expected 1 to have unit "%". , -1 | a {b: adjust-color(white, $whiteness: 1)} +2 | a {b: color.adjust(white, $whiteness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/blackness/input.scss -a {b: adjust-color(black, $blackness: 1)} +@use "sass:color"; +a {b: color.adjust(black, $blackness: 1)} <===> none/blackness/error Error: $blackness: Expected 1 to have unit "%". , -1 | a {b: adjust-color(black, $blackness: 1)} +2 | a {b: color.adjust(black, $blackness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/whiteness/input.scss -a {b: adjust-color(white, $whiteness: 1px)} +@use "sass:color"; +a {b: color.adjust(white, $whiteness: 1px)} <===> wrong/whiteness/error Error: $whiteness: Expected 1px to have unit "%". , -1 | a {b: adjust-color(white, $whiteness: 1px)} +2 | a {b: color.adjust(white, $whiteness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/blackness/input.scss -a {b: adjust-color(black, $blackness: 1px)} +@use "sass:color"; +a {b: color.adjust(black, $blackness: 1px)} <===> wrong/blackness/error Error: $blackness: Expected 1px to have unit "%". , -1 | a {b: adjust-color(black, $blackness: 1px)} +2 | a {b: color.adjust(black, $blackness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_color/hsl.hrx b/spec/core_functions/color/adjust_color/hsl.hrx index ff9d04d374..9483abcfa5 100644 --- a/spec/core_functions/color/adjust_color/hsl.hrx +++ b/spec/core_functions/color/adjust_color/hsl.hrx @@ -1,5 +1,6 @@ <===> hue/max/input.scss -a {b: adjust-color(red, $hue: 359)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 359)} <===> hue/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> hue/above_max/input.scss -a {b: adjust-color(red, $hue: 540)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 540)} <===> hue/above_max/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> hue/min/input.scss -a {b: adjust-color(blue, $hue: 0)} +@use "sass:color"; +a {b: color.adjust(blue, $hue: 0)} <===> hue/min/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> hue/negative/input.scss -a {b: adjust-color(red, $hue: -180)} +@use "sass:color"; +a {b: color.adjust(red, $hue: -180)} <===> hue/negative/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> hue/middle/input.scss -a {b: adjust-color(red, $hue: 123)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 123)} <===> hue/middle/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> hue/fraction/input.scss -a {b: adjust-color(red, $hue: 0.5)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 0.5)} <===> hue/fraction/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> saturation/max/input.scss -a {b: adjust-color(plum, $saturation: 100%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: 100%)} <===> saturation/max/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> saturation/max_remaining/input.scss -a {b: adjust-color(plum, $saturation: 53%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: 53%)} <===> saturation/max_remaining/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> saturation/zero/input.scss -a {b: adjust-color(plum, $saturation: 0%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: 0%)} <===> saturation/zero/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> saturation/min/input.scss -a {b: adjust-color(plum, $saturation: -100%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: -100%)} <===> saturation/min/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> saturation/min_remaining/input.scss -a {b: adjust-color(plum, $saturation: -48%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: -48%)} <===> saturation/min_remaining/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> saturation/high/input.scss -a {b: adjust-color(plum, $saturation: 14%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: 14%)} <===> saturation/high/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> saturation/low/input.scss -a {b: adjust-color(plum, $saturation: -14%)} +@use "sass:color"; +a {b: color.adjust(plum, $saturation: -14%)} <===> saturation/low/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> lightness/max/input.scss -a {b: adjust-color(red, $lightness: 100%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 100%)} <===> lightness/max/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> lightness/max_remaining/input.scss -a {b: adjust-color(red, $lightness: 50%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 50%)} <===> lightness/max_remaining/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> lightness/zero/input.scss -a {b: adjust-color(red, $lightness: 0%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 0%)} <===> lightness/zero/output.css a { @@ -159,7 +175,8 @@ a { <===> ================================================================================ <===> lightness/fraction/input.scss -a {b: adjust-color(red, $lightness: 0.5%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 0.5%)} <===> lightness/fraction/output.css a { @@ -169,7 +186,8 @@ a { <===> ================================================================================ <===> lightness/min/input.scss -a {b: adjust-color(red, $lightness: -100%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: -100%)} <===> lightness/min/output.css a { @@ -179,7 +197,8 @@ a { <===> ================================================================================ <===> lightness/min_remaining/input.scss -a {b: adjust-color(red, $lightness: -50%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: -50%)} <===> lightness/min_remaining/output.css a { @@ -189,7 +208,8 @@ a { <===> ================================================================================ <===> lightness/high/input.scss -a {b: adjust-color(red, $lightness: 14%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 14%)} <===> lightness/high/output.css a { @@ -199,7 +219,8 @@ a { <===> ================================================================================ <===> lightness/low/input.scss -a {b: adjust-color(red, $lightness: -14%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: -14%)} <===> lightness/low/output.css a { @@ -209,7 +230,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> all/output.css a { @@ -219,7 +241,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: adjust-color(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.adjust(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} <===> alpha_input/output.css a { @@ -229,7 +252,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: -0.7)} +@use "sass:color"; +a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: -0.7)} <===> alpha_arg/output.css a { @@ -239,8 +263,9 @@ a { <===> ================================================================================ <===> alpha_arg_above_max/input.scss +@use "sass:color"; // Regression test for sass/dart-sass#708. -a {b: adjust-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} +a {b: color.adjust(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} <===> alpha_arg_above_max/output.css a { @@ -250,7 +275,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: adjust-color($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.adjust($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> named/output.css a { diff --git a/spec/core_functions/color/adjust_color/hwb.hrx b/spec/core_functions/color/adjust_color/hwb.hrx index 90f531c3bf..f50161a492 100644 --- a/spec/core_functions/color/adjust_color/hwb.hrx +++ b/spec/core_functions/color/adjust_color/hwb.hrx @@ -1,5 +1,6 @@ <===> whiteness/max/input.scss -a {b: adjust-color(#cc6666, $whiteness: 100%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> whiteness/max_remaining/input.scss -a {b: adjust-color(#cc6666, $whiteness: 60%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: 60%)} <===> whiteness/max_remaining/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> whiteness/zero/input.scss -a {b: adjust-color(#cc6666, $whiteness: 0%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: 0%)} <===> whiteness/zero/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> whiteness/min/input.scss -a {b: adjust-color(#cc6666, $whiteness: -100%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: -100%)} <===> whiteness/min/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> whiteness/min_remaining/input.scss -a {b: adjust-color(#cc6666, $whiteness: -40%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: -40%)} <===> whiteness/min_remaining/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> whiteness/high/input.scss -a {b: adjust-color(#cc6666, $whiteness: 40%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: 40%)} <===> whiteness/high/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> whiteness/low/input.scss -a {b: adjust-color(#cc6666, $whiteness: -20%)} +@use "sass:color"; +a {b: color.adjust(#cc6666, $whiteness: -20%)} <===> whiteness/low/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> blackness/max/input.scss -a {b: adjust-color(#993333, $blackness: 100%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: 100%)} <===> blackness/max/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> blackness/max_remaining/input.scss -a {b: adjust-color(#993333, $blackness: 60%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: 60%)} <===> blackness/max_remaining/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> blackness/zero/input.scss -a {b: adjust-color(#993333, $blackness: 0%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: 0%)} <===> blackness/zero/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> blackness/min/input.scss -a {b: adjust-color(#993333, $blackness: -100%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: -100%)} <===> blackness/min/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> blackness/min_remaining/input.scss -a {b: adjust-color(#993333, $blackness: -40%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: -40%)} <===> blackness/min_remaining/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> blackness/high/input.scss -a {b: adjust-color(#993333, $blackness: 40%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: 40%)} <===> blackness/high/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> blackness/low/input.scss -a {b: adjust-color(#993333, $blackness: -20%)} +@use "sass:color"; +a {b: color.adjust(#993333, $blackness: -20%)} <===> blackness/low/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: adjust-color(red, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> all/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: adjust-color(rgba(red, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> alpha_input/output.css a { @@ -159,7 +175,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: adjust-color(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: -0.7)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: -0.7)} <===> alpha_arg/output.css a { @@ -169,7 +186,8 @@ a { <===> ================================================================================ <===> alpha_arg_above_max/input.scss -a {b: adjust-color(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.7)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.7)} <===> alpha_arg_above_max/output.css a { @@ -179,7 +197,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: adjust-color($color: red, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.adjust($color: red, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> named/output.css a { diff --git a/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx b/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx index 8d26cb5315..e5b0c8ab97 100644 --- a/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx +++ b/spec/core_functions/color/adjust_color/no_rgb_hsl.hrx @@ -1,5 +1,6 @@ <===> positional/input.scss -a {b: adjust-color(red)} +@use "sass:color"; +a {b: color.adjust(red)} <===> positional/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: adjust-color($color: red)} +@use "sass:color"; +a {b: color.adjust($color: red)} <===> named/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> alpha/max/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: 1)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 1)} <===> alpha/max/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> alpha/max_remaining/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: 0.5)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 0.5)} <===> alpha/max_remaining/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> alpha/zero/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: 0)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 0)} <===> alpha/zero/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> alpha/min/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: -1)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: -1)} <===> alpha/min/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> alpha/min_remaining/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: -0.5)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: -0.5)} <===> alpha/min_remaining/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> alpha/high/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: 0.14)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: 0.14)} <===> alpha/high/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> alpha/low/input.scss -a {b: adjust-color(rgba(red, 0.5), $alpha: -0.14)} +@use "sass:color"; +a {b: color.adjust(rgba(red, 0.5), $alpha: -0.14)} <===> alpha/low/output.css a { diff --git a/spec/core_functions/color/adjust_color/rgb.hrx b/spec/core_functions/color/adjust_color/rgb.hrx index cba36d0536..d004da8f98 100644 --- a/spec/core_functions/color/adjust_color/rgb.hrx +++ b/spec/core_functions/color/adjust_color/rgb.hrx @@ -1,5 +1,6 @@ <===> red/max/input.scss -a {b: adjust-color(black, $red: 255)} +@use "sass:color"; +a {b: color.adjust(black, $red: 255)} <===> red/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> red/min/input.scss -a {b: adjust-color(red, $red: -255)} +@use "sass:color"; +a {b: color.adjust(red, $red: -255)} <===> red/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> red/zero/input.scss -a {b: adjust-color(black, $red: 0)} +@use "sass:color"; +a {b: color.adjust(black, $red: 0)} <===> red/zero/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> red/low/input.scss -a {b: adjust-color(red, $red: -100)} +@use "sass:color"; +a {b: color.adjust(red, $red: -100)} <===> red/low/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> red/high/input.scss -a {b: adjust-color(black, $red: 200)} +@use "sass:color"; +a {b: color.adjust(black, $red: 200)} <===> red/high/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> green/max/input.scss -a {b: adjust-color(black, $green: 255)} +@use "sass:color"; +a {b: color.adjust(black, $green: 255)} <===> green/max/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> green/min/input.scss -a {b: adjust-color(lime, $green: -255)} +@use "sass:color"; +a {b: color.adjust(lime, $green: -255)} <===> green/min/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> green/zero/input.scss -a {b: adjust-color(black, $green: 0)} +@use "sass:color"; +a {b: color.adjust(black, $green: 0)} <===> green/zero/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> green/low/input.scss -a {b: adjust-color(lime, $green: -100)} +@use "sass:color"; +a {b: color.adjust(lime, $green: -100)} <===> green/low/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> green/high/input.scss -a {b: adjust-color(black, $green: 200)} +@use "sass:color"; +a {b: color.adjust(black, $green: 200)} <===> green/high/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> blue/max/input.scss -a {b: adjust-color(black, $blue: 255)} +@use "sass:color"; +a {b: color.adjust(black, $blue: 255)} <===> blue/max/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> blue/min/input.scss -a {b: adjust-color(blue, $blue: -255)} +@use "sass:color"; +a {b: color.adjust(blue, $blue: -255)} <===> blue/min/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> blue/zero/input.scss -a {b: adjust-color(black, $blue: 0)} +@use "sass:color"; +a {b: color.adjust(black, $blue: 0)} <===> blue/zero/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> blue/low/input.scss -a {b: adjust-color(blue, $blue: -100)} +@use "sass:color"; +a {b: color.adjust(blue, $blue: -100)} <===> blue/low/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> blue/high/input.scss -a {b: adjust-color(black, $blue: 200)} +@use "sass:color"; +a {b: color.adjust(black, $blue: 200)} <===> blue/high/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: adjust-color(black, $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48)} <===> all/output.css a { @@ -159,7 +175,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: adjust-color(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.adjust(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} <===> alpha_input/output.css a { @@ -169,7 +186,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: adjust-color(black, $red: 12, $green: 24, $blue: 48, $alpha: -0.3)} +@use "sass:color"; +a {b: color.adjust(black, $red: 12, $green: 24, $blue: 48, $alpha: -0.3)} <===> alpha_arg/output.css a { @@ -179,7 +197,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: adjust-color($color: black, $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.adjust($color: black, $red: 12, $green: 24, $blue: 48)} <===> named/output.css a { diff --git a/spec/core_functions/color/adjust_color/units.hrx b/spec/core_functions/color/adjust_color/units.hrx index 4c41b3b5cd..605d84767d 100644 --- a/spec/core_functions/color/adjust_color/units.hrx +++ b/spec/core_functions/color/adjust_color/units.hrx @@ -1,5 +1,6 @@ <===> hue/deg/input.scss -a {b: adjust-color(red, $hue: 60deg)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 60deg)} <===> hue/deg/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> hue/unitless/input.scss -a {b: adjust-color(red, $hue: 60)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 60)} <===> hue/unitless/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> hue/unknown/input.scss -a {b: adjust-color(red, $hue: 60in)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 60in)} <===> hue/unknown/output.css a { @@ -34,15 +37,16 @@ To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $hue: 60in)} +2 | a {b: color.adjust(red, $hue: 60in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> hue/angle/input.scss -a {b: adjust-color(red, $hue: 60rad)} +@use "sass:color"; +a {b: color.adjust(red, $hue: 60rad)} <===> hue/angle/output.css a { @@ -52,7 +56,8 @@ a { <===> ================================================================================ <===> saturation/percent/input.scss -a {b: adjust-color(red, $saturation: -10%)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: -10%)} <===> saturation/percent/output.css a { @@ -62,7 +67,8 @@ a { <===> ================================================================================ <===> saturation/unitless/input.scss -a {b: adjust-color(red, $saturation: -10)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: -10)} <===> saturation/unitless/output.css a { @@ -77,15 +83,16 @@ To preserve current behavior: $saturation * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $saturation: -10)} +2 | a {b: color.adjust(red, $saturation: -10)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/unknown/input.scss -a {b: adjust-color(red, $saturation: -10in)} +@use "sass:color"; +a {b: color.adjust(red, $saturation: -10in)} <===> saturation/unknown/output.css a { @@ -100,15 +107,16 @@ To preserve current behavior: calc($saturation / 1in * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $saturation: -10in)} +2 | a {b: color.adjust(red, $saturation: -10in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/percent/input.scss -a {b: adjust-color(red, $lightness: 10%)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 10%)} <===> lightness/percent/output.css a { @@ -118,7 +126,8 @@ a { <===> ================================================================================ <===> lightness/unitless/input.scss -a {b: adjust-color(red, $lightness: 10)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 10)} <===> lightness/unitless/output.css a { @@ -133,15 +142,16 @@ To preserve current behavior: $lightness * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $lightness: 10)} +2 | a {b: color.adjust(red, $lightness: 10)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/unknown/input.scss -a {b: adjust-color(red, $lightness: 10in)} +@use "sass:color"; +a {b: color.adjust(red, $lightness: 10in)} <===> lightness/unknown/output.css a { @@ -156,15 +166,16 @@ To preserve current behavior: calc($lightness / 1in * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $lightness: 10in)} +2 | a {b: color.adjust(red, $lightness: 10in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unitless/input.scss -a {b: adjust-color(red, $alpha: -0.3)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: -0.3)} <===> alpha/unitless/output.css a { @@ -174,7 +185,8 @@ a { <===> ================================================================================ <===> alpha/percent/input.scss -a {b: adjust-color(red, $alpha: -0.3%)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: -0.3%)} <===> alpha/percent/output.css a { @@ -189,15 +201,16 @@ To preserve current behavior: calc($alpha / 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $alpha: -0.3%)} +2 | a {b: color.adjust(red, $alpha: -0.3%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unknown/input.scss -a {b: adjust-color(red, $alpha: -0.3px)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: -0.3px)} <===> alpha/unknown/output.css a { @@ -212,7 +225,7 @@ To preserve current behavior: calc($alpha / 1px) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $alpha: -0.3px)} +2 | a {b: color.adjust(red, $alpha: -0.3px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/adjust_hue.hrx b/spec/core_functions/color/adjust_hue.hrx deleted file mode 100644 index f5a5b7b766..0000000000 --- a/spec/core_functions/color/adjust_hue.hrx +++ /dev/null @@ -1,190 +0,0 @@ -<===> max/input.scss -a {b: adjust-hue(red, 359)} - -<===> max/output.css -a { - b: #ff0004; -} - -<===> -================================================================================ -<===> above_max/input.scss -a {b: adjust-hue(red, 540)} - -<===> above_max/output.css -a { - b: aqua; -} - -<===> -================================================================================ -<===> min/input.scss -a {b: adjust-hue(blue, 0)} - -<===> min/output.css -a { - b: blue; -} - -<===> -================================================================================ -<===> negative/input.scss -a {b: adjust-hue(red, -180)} - -<===> negative/output.css -a { - b: aqua; -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: adjust-hue(red, 123)} - -<===> middle/output.css -a { - b: #00ff0d; -} - -<===> -================================================================================ -<===> fraction/input.scss -a {b: adjust-hue(red, 0.5)} - -<===> fraction/output.css -a { - b: #ff0200; -} - -<===> -================================================================================ -<===> alpha/input.scss -a {b: adjust-hue(rgba(red, 0.1), 359)} - -<===> alpha/output.css -a { - b: rgba(255, 0, 4, 0.1); -} - -<===> -================================================================================ -<===> units/deg/input.scss -a {b: adjust-hue(red, 60deg)} - -<===> units/deg/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> units/unitless/input.scss -a {b: adjust-hue(red, 60)} - -<===> units/unitless/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> units/unknown/input.scss -a {b: adjust-hue(red, 60in)} - -<===> units/unknown/output.css -a { - b: yellow; -} - -<===> units/unknown/warning -DEPRECATION WARNING: $degrees: Passing a unit other than deg (60in) is deprecated. - -To preserve current behavior: calc($degrees / 1in) - -See https://sass-lang.com/d/function-units - - , -1 | a {b: adjust-hue(red, 60in)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> units/angle/input.scss -a {b: adjust-hue(red, 60rad)} - -<===> units/angle/output.css -a { - b: #00b4ff; -} - -<===> -================================================================================ -<===> named/input.scss -a {b: adjust-hue($color: red, $degrees: 123)} - -<===> named/output.css -a { - b: #00ff0d; -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: adjust-hue(red)} - -<===> error/too_few_args/error -Error: Missing argument $degrees. - ,--> input.scss -1 | a {b: adjust-hue(red)} - | ^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function adjust-hue($color, $degrees) { - | ============================ declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: adjust-hue(red, 1, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: adjust-hue(red, 1, 2)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function adjust-hue($color, $degrees) { - | ============================ declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: adjust-hue(1, 2)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: adjust-hue(1, 2)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/hue/input.scss -a {b: adjust-hue(red, blue)} - -<===> error/type/hue/error -Error: $degrees: blue is not a number. - , -1 | a {b: adjust-hue(red, blue)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/alpha.hrx b/spec/core_functions/color/alpha.hrx index 0f1d9a97a3..0425c8d073 100644 --- a/spec/core_functions/color/alpha.hrx +++ b/spec/core_functions/color/alpha.hrx @@ -1,5 +1,6 @@ <===> color/max/input.scss -a {b: alpha(red)} +@use "sass:color"; +a {b: color.alpha(red)} <===> color/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> color/min/input.scss -a {b: alpha(rgba(red, 0))} +@use "sass:color"; +a {b: color.alpha(rgba(red, 0))} <===> color/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> color/middle/input.scss -a {b: alpha(rgba(red, 0.42))} +@use "sass:color"; +a {b: color.alpha(rgba(red, 0.42))} <===> color/middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> color/named/input.scss -a {b: alpha($color: rgba(red, 0.73))} +@use "sass:color"; +a {b: color.alpha($color: rgba(red, 0.73))} <===> color/named/output.css a { @@ -59,13 +63,26 @@ a { <===> ================================================================================ <===> filter/space_before_equals/input.scss -a {b: alpha(unquote("c = d"))} +@use "sass:color"; +@use "sass:string"; +a {b: color.alpha(string.unquote("c = d"))} <===> filter/space_before_equals/output.css a { b: alpha(c = d); } +<===> filter/space_before_equals/warning +DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. + +Recommendation: alpha(c = d) + + , +3 | a {b: color.alpha(string.unquote("c = d"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + <===> ================================================================================ <===> opacity/positional/input.scss @@ -119,25 +136,93 @@ a { <===> ================================================================================ <===> opacity/with_unquoted_calc/input.scss -a {b: opacity(unquote('calc(1)'))} +@use "sass:string"; +a {b: opacity(string.unquote('calc(1)'))} <===> opacity/with_unquoted_calc/output.css a { b: opacity(calc(1)); } +<===> +================================================================================ +<===> css_overloads/alpha/one_arg/input.scss +@use "sass:color"; +a {b: color.alpha(c=d)} + +<===> css_overloads/alpha/one_arg/output.css +a { + b: alpha(c=d); +} + +<===> css_overloads/alpha/one_arg/warning +DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. + +Recommendation: alpha(c=d) + + , +2 | a {b: color.alpha(c=d)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> css_overloads/alpha/multi_arg/input.scss +@use "sass:color"; +a {b: color.alpha(c=d, e=f, g=h)} + +<===> css_overloads/alpha/multi_arg/output.css +a { + b: alpha(c=d, e=f, g=h); +} + +<===> css_overloads/alpha/multi_arg/warning +DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. + +Recommendation: alpha(c=d, e=f, g=h) + + , +2 | a {b: color.alpha(c=d, e=f, g=h)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> css_overloads/opacity/input.scss +@use "sass:color"; +a {b: color.opacity(1)} + +<===> css_overloads/opacity/output.css +a { + b: opacity(1); +} + +<===> css_overloads/opacity/warning +DEPRECATION WARNING: Passing a number (1 to color.opacity() is deprecated. + +Recommendation: opacity(1) + + , +2 | a {b: color.opacity(1)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: alpha()} +@use "sass:color"; +a {b: color.alpha()} <===> error/too_few_args/error -Error: Missing argument $color. +Error: () isn't a valid CSS value. , -1 | a {b: alpha()} - | ^^^^^^^ +2 | a {b: color.alpha()} + | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ @@ -155,15 +240,16 @@ Error: Only 1 argument allowed, but 2 were passed. <===> ================================================================================ <===> error/type/input.scss -a {b: alpha(1)} +@use "sass:color"; +a {b: color.alpha(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: alpha(1)} - | ^^^^^^^^ +2 | a {b: color.alpha(1)} + | ^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ @@ -182,38 +268,42 @@ Error: $color: var(--c) is not a color. <===> ================================================================================ <===> error/quoted_string/input.scss -a {b: alpha("c=d")} +@use "sass:color"; +a {b: color.alpha("c=d")} <===> error/quoted_string/error Error: $color: "c=d" is not a color. , -1 | a {b: alpha("c=d")} - | ^^^^^^^^^^^^ +2 | a {b: color.alpha("c=d")} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/unquoted_string/no_equals/input.scss -a {b: alpha(cd)} +@use "sass:color"; +a {b: color.alpha(cd)} <===> error/unquoted_string/no_equals/error Error: $color: cd is not a color. , -1 | a {b: alpha(cd)} - | ^^^^^^^^^ +2 | a {b: color.alpha(cd)} + | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/unquoted_string/non_identifier_before_equals/input.scss -a {b: alpha(unquote("1=c"))} +@use "sass:color"; +@use "sass:string"; +a {b: color.alpha(string.unquote("1=c"))} <===> error/unquoted_string/non_identifier_before_equals/error Error: $color: 1=c is not a color. , -1 | a {b: alpha(unquote("1=c"))} - | ^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: color.alpha(string.unquote("1=c"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 3:7 root stylesheet diff --git a/spec/core_functions/color/blue.hrx b/spec/core_functions/color/blue.hrx index fbd2cc37d4..d5dcddad28 100644 --- a/spec/core_functions/color/blue.hrx +++ b/spec/core_functions/color/blue.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: blue(rgb(0, 0, 255))} +@use "sass:color"; +a {b: color.blue(rgb(0, 0, 255))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: blue(rgb(0, 0, 0))} +@use "sass:color"; +a {b: color.blue(rgb(0, 0, 0))} <===> min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: blue(rgb(0, 0, 123))} +@use "sass:color"; +a {b: color.blue(rgb(0, 0, 123))} <===> middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: blue($color: rgb(0, 0, 234))} +@use "sass:color"; +a {b: color.blue($color: rgb(0, 0, 234))} <===> named/output.css a { @@ -39,46 +43,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: blue()} +@use "sass:color"; +a {b: color.blue()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: blue()} - | ^^^^^^ invocation +2 | a {b: color.blue()} + | ^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function blue($color) { | ============ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: blue(red, green)} +@use "sass:color"; +a {b: color.blue(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: blue(red, green)} - | ^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.blue(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function blue($color) { | ============ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: blue(1)} +@use "sass:color"; +a {b: color.blue(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: blue(1)} - | ^^^^^^^ +2 | a {b: color.blue(1)} + | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/args.hrx b/spec/core_functions/color/change_color/error/args.hrx index 4256429ac7..0846f14812 100644 --- a/spec/core_functions/color/change_color/error/args.hrx +++ b/spec/core_functions/color/change_color/error/args.hrx @@ -1,40 +1,57 @@ <===> too_few/input.scss -a {b: change-color()} +@use "sass:color"; +a {b: color.change()} <===> too_few/error Error: Missing argument $color. ,--> input.scss -1 | a {b: change-color()} +2 | a {b: color.change()} | ^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function change($color, $kwargs...) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many/input.scss -a {b: change-color(red, 1)} +@use "sass:color"; +a {b: color.change(red, 1)} <===> too_many/error Error: Only one positional argument is allowed. All other arguments must be passed by name. , -1 | a {b: change-color(red, 1)} +2 | a {b: color.change(red, 1)} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unknown/input.scss -a {b: change-color(red, $ambience: 10%)} +@use "sass:color"; +a {b: color.change(red, $ambience: 10%)} <===> unknown/error Error: No argument named $ambience. , -1 | a {b: change-color(red, $ambience: 10%)} +2 | a {b: color.change(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:color"; +a {b: color.change-color(#abcdef, $red: 10)} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: color.change-color(#abcdef, $red: 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/bounds.hrx b/spec/core_functions/color/change_color/error/bounds.hrx index e2ac109d01..b95135e170 100644 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ b/spec/core_functions/color/change_color/error/bounds.hrx @@ -1,156 +1,168 @@ <===> red/too_low/input.scss -a {b: change-color(red, $red: -1)} +@use "sass:color"; +a {b: color.change(red, $red: -1)} <===> red/too_low/error Error: $red: Expected -1 to be within 0 and 255. , -1 | a {b: change-color(red, $red: -1)} +2 | a {b: color.change(red, $red: -1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/too_high/input.scss -a {b: change-color(red, $red: 256)} +@use "sass:color"; +a {b: color.change(red, $red: 256)} <===> red/too_high/error Error: $red: Expected 256 to be within 0 and 255. , -1 | a {b: change-color(red, $red: 256)} +2 | a {b: color.change(red, $red: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(red, $red: 300px)} +a {b: color.change(red, $red: 300px)} <===> red/unit/error Error: $red: Expected 300px to be within 0 and 255. , -3 | a {b: change-color(red, $red: 300px)} +4 | a {b: color.change(red, $red: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> green/too_low/input.scss -a {b: change-color(green, $green: -1)} +@use "sass:color"; +a {b: color.change(green, $green: -1)} <===> green/too_low/error Error: $green: Expected -1 to be within 0 and 255. , -1 | a {b: change-color(green, $green: -1)} +2 | a {b: color.change(green, $green: -1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/too_high/input.scss -a {b: change-color(green, $green: 256)} +@use "sass:color"; +a {b: color.change(green, $green: 256)} <===> green/too_high/error Error: $green: Expected 256 to be within 0 and 255. , -1 | a {b: change-color(green, $green: 256)} +2 | a {b: color.change(green, $green: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(green, $green: 300px)} +a {b: color.change(green, $green: 300px)} <===> green/unit/error Error: $green: Expected 300px to be within 0 and 255. , -3 | a {b: change-color(green, $green: 300px)} +4 | a {b: color.change(green, $green: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> blue/too_low/input.scss -a {b: change-color(blue, $blue: -1)} +@use "sass:color"; +a {b: color.change(blue, $blue: -1)} <===> blue/too_low/error Error: $blue: Expected -1 to be within 0 and 255. , -1 | a {b: change-color(blue, $blue: -1)} +2 | a {b: color.change(blue, $blue: -1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/too_high/input.scss -a {b: change-color(blue, $blue: 256)} +@use "sass:color"; +a {b: color.change(blue, $blue: 256)} <===> blue/too_high/error Error: $blue: Expected 256 to be within 0 and 255. , -1 | a {b: change-color(blue, $blue: 256)} +2 | a {b: color.change(blue, $blue: 256)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(blue, $blue: 300px)} +a {b: color.change(blue, $blue: 300px)} <===> blue/unit/error Error: $blue: Expected 300px to be within 0 and 255. , -3 | a {b: change-color(blue, $blue: 300px)} +4 | a {b: color.change(blue, $blue: 300px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> saturation/too_low/input.scss -a {b: change-color(red, $saturation: -0.001%)} +@use "sass:color"; +a {b: color.change(red, $saturation: -0.001%)} <===> saturation/too_low/error Error: $saturation: Expected -0.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $saturation: -0.001%)} +2 | a {b: color.change(red, $saturation: -0.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/too_high/input.scss -a {b: change-color(red, $saturation: 100.001%)} +@use "sass:color"; +a {b: color.change(red, $saturation: 100.001%)} <===> saturation/too_high/error Error: $saturation: Expected 100.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $saturation: 100.001%)} +2 | a {b: color.change(red, $saturation: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(red, $saturation: 200px)} +a {b: color.change(red, $saturation: 200px)} <===> saturation/unit/error DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. @@ -160,50 +172,53 @@ To preserve current behavior: calc($saturation / 1px * 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: change-color(red, $saturation: 200px)} +4 | a {b: color.change(red, $saturation: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $saturation: Expected 200px to be within 0% and 100%. , -3 | a {b: change-color(red, $saturation: 200px)} +4 | a {b: color.change(red, $saturation: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> lightness/too_low/input.scss -a {b: change-color(red, $lightness: -0.001%)} +@use "sass:color"; +a {b: color.change(red, $lightness: -0.001%)} <===> lightness/too_low/error Error: $lightness: Expected -0.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $lightness: -0.001%)} +2 | a {b: color.change(red, $lightness: -0.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/too_high/input.scss -a {b: change-color(red, $lightness: 100.001%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 100.001%)} <===> lightness/too_high/error Error: $lightness: Expected 100.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $lightness: 100.001%)} +2 | a {b: color.change(red, $lightness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(red, $lightness: 200px)} +a {b: color.change(red, $lightness: 200px)} <===> lightness/unit/error DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. @@ -213,50 +228,53 @@ To preserve current behavior: calc($lightness / 1px * 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: change-color(red, $lightness: 200px)} +4 | a {b: color.change(red, $lightness: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $lightness: Expected 200px to be within 0% and 100%. , -3 | a {b: change-color(red, $lightness: 200px)} +4 | a {b: color.change(red, $lightness: 200px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> alpha/too_low/input.scss -a {b: change-color(red, $alpha: -0.001)} +@use "sass:color"; +a {b: color.change(red, $alpha: -0.001)} <===> alpha/too_low/error Error: $alpha: Expected -0.001 to be within 0 and 1. , -1 | a {b: change-color(red, $alpha: -0.001)} +2 | a {b: color.change(red, $alpha: -0.001)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/too_high/input.scss -a {b: change-color(red, $alpha: 1.001)} +@use "sass:color"; +a {b: color.change(red, $alpha: 1.001)} <===> alpha/too_high/error Error: $alpha: Expected 1.001 to be within 0 and 1. , -1 | a {b: change-color(red, $alpha: 1.001)} +2 | a {b: color.change(red, $alpha: 1.001)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unit/input.scss +@use "sass:color"; // This test covers sass/dart-sass#1745, but should be removed once units are // fully forbidden (sass/sass#3374). -a {b: change-color(red, $alpha: 50%)} +a {b: color.change(red, $alpha: 50%)} <===> alpha/unit/error DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. @@ -266,66 +284,70 @@ To preserve current behavior: calc($alpha / 1%) More info: https://sass-lang.com/d/function-units , -3 | a {b: change-color(red, $alpha: 50%)} +4 | a {b: color.change(red, $alpha: 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet Error: $alpha: Expected 50% to be within 0 and 1. , -3 | a {b: change-color(red, $alpha: 50%)} +4 | a {b: color.change(red, $alpha: 50%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 3:7 root stylesheet + input.scss 4:7 root stylesheet <===> ================================================================================ <===> blackness/too_low/input.scss -a {b: change-color(red, $blackness: -0.001%)} +@use "sass:color"; +a {b: color.change(red, $blackness: -0.001%)} <===> blackness/too_low/error Error: $blackness: Expected -0.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $blackness: -0.001%)} +2 | a {b: color.change(red, $blackness: -0.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/too_high/input.scss -a {b: change-color(red, $blackness: 100.001%)} +@use "sass:color"; +a {b: color.change(red, $blackness: 100.001%)} <===> blackness/too_high/error Error: $blackness: Expected 100.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $blackness: 100.001%)} +2 | a {b: color.change(red, $blackness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_low/input.scss -a {b: change-color(red, $whiteness: -0.001%)} +@use "sass:color"; +a {b: color.change(red, $whiteness: -0.001%)} <===> whiteness/too_low/error Error: $whiteness: Expected -0.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $whiteness: -0.001%)} +2 | a {b: color.change(red, $whiteness: -0.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_high/input.scss -a {b: change-color(red, $whiteness: 100.001%)} +@use "sass:color"; +a {b: color.change(red, $whiteness: 100.001%)} <===> whiteness/too_high/error Error: $whiteness: Expected 100.001% to be within 0% and 100%. , -1 | a {b: change-color(red, $whiteness: 100.001%)} +2 | a {b: color.change(red, $whiteness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/mixed_formats.hrx b/spec/core_functions/color/change_color/error/mixed_formats.hrx index 3ab279445a..46b938a4a4 100644 --- a/spec/core_functions/color/change_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/change_color/error/mixed_formats.hrx @@ -1,88 +1,95 @@ <===> red_and_hue/input.scss -a {b: change-color(red, $red: 1, $hue: 1)} +@use "sass:color"; +a {b: color.change(red, $red: 1, $hue: 1)} <===> red_and_hue/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: change-color(red, $red: 1, $hue: 1)} +2 | a {b: color.change(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_saturation/input.scss -a {b: change-color(red, $green: 1, $saturation: 1%)} +@use "sass:color"; +a {b: color.change(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: change-color(red, $green: 1, $saturation: 1%)} +2 | a {b: color.change(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue_and_lightness/input.scss -a {b: change-color(red, $blue: 1, $lightness: 1%)} +@use "sass:color"; +a {b: color.change(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: change-color(red, $blue: 1, $lightness: 1%)} +2 | a {b: color.change(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red_and_blackness/input.scss -a {b: adjust-color(red, $red: 1, $blackness: 1%)} +@use "sass:color"; +a {b: color.change(red, $red: 1, $blackness: 1%)} <===> red_and_blackness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: adjust-color(red, $red: 1, $blackness: 1%)} +2 | a {b: color.change(red, $red: 1, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_whiteness/input.scss -a {b: change-color(red, $green: 1, $whiteness: 1%)} +@use "sass:color"; +a {b: color.change(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: change-color(red, $green: 1, $whiteness: 1%)} +2 | a {b: color.change(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation_and_blackness/input.scss -a {b: change-color(red, $saturation: 1%, $blackness: 1%)} +@use "sass:color"; +a {b: color.change(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: change-color(red, $saturation: 1%, $blackness: 1%)} +2 | a {b: color.change(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness_and_whiteness/input.scss -a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} +2 | a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/type.hrx b/spec/core_functions/color/change_color/error/type.hrx index 96b045e32d..e48fbc42f4 100644 --- a/spec/core_functions/color/change_color/error/type.hrx +++ b/spec/core_functions/color/change_color/error/type.hrx @@ -1,128 +1,137 @@ <===> color/input.scss -a {b: change-color(1)} +@use "sass:color"; +a {b: color.change(1)} <===> color/error Error: $color: 1 is not a color. , -1 | a {b: change-color(1)} +2 | a {b: color.change(1)} | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/input.scss -a {b: change-color(red, $red: c)} +@use "sass:color"; +a {b: color.change(red, $red: c)} <===> red/error Error: $red: c is not a number. , -1 | a {b: change-color(red, $red: c)} +2 | a {b: color.change(red, $red: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/input.scss -a {b: change-color(red, $green: c)} +@use "sass:color"; +a {b: color.change(red, $green: c)} <===> green/error Error: $green: c is not a number. , -1 | a {b: change-color(red, $green: c)} +2 | a {b: color.change(red, $green: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/input.scss -a {b: change-color(red, $blue: c)} +@use "sass:color"; +a {b: color.change(red, $blue: c)} <===> blue/error Error: $blue: c is not a number. , -1 | a {b: change-color(red, $blue: c)} +2 | a {b: color.change(red, $blue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> hue/input.scss -a {b: change-color(red, $hue: c)} +@use "sass:color"; +a {b: color.change(red, $hue: c)} <===> hue/error Error: $hue: c is not a number. , -1 | a {b: change-color(red, $hue: c)} +2 | a {b: color.change(red, $hue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/input.scss -a {b: change-color(red, $saturation: c)} +@use "sass:color"; +a {b: color.change(red, $saturation: c)} <===> saturation/error Error: $saturation: c is not a number. , -1 | a {b: change-color(red, $saturation: c)} +2 | a {b: color.change(red, $saturation: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/input.scss -a {b: change-color(red, $lightness: c)} +@use "sass:color"; +a {b: color.change(red, $lightness: c)} <===> lightness/error Error: $lightness: c is not a number. , -1 | a {b: change-color(red, $lightness: c)} +2 | a {b: color.change(red, $lightness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/input.scss -a {b: change-color(red, $alpha: c)} +@use "sass:color"; +a {b: color.change(red, $alpha: c)} <===> alpha/error Error: $alpha: c is not a number. , -1 | a {b: change-color(red, $alpha: c)} +2 | a {b: color.change(red, $alpha: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/input.scss -a {b: change-color(red, $blackness: c)} +@use "sass:color"; +a {b: color.change(red, $blackness: c)} <===> blackness/error Error: $blackness: c is not a number. , -1 | a {b: change-color(red, $blackness: c)} +2 | a {b: color.change(red, $blackness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/input.scss -a {b: change-color(red, $whiteness: c)} +@use "sass:color"; +a {b: color.change(red, $whiteness: c)} <===> whiteness/error Error: $whiteness: c is not a number. , -1 | a {b: change-color(red, $whiteness: c)} +2 | a {b: color.change(red, $whiteness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/units.hrx b/spec/core_functions/color/change_color/error/units.hrx index ba99c38183..d204b5a567 100644 --- a/spec/core_functions/color/change_color/error/units.hrx +++ b/spec/core_functions/color/change_color/error/units.hrx @@ -1,50 +1,53 @@ <===> none/whiteness/input.scss -a {b: change-color(white, $whiteness: 1)} +@use "sass:color"; +a {b: color.change(white, $whiteness: 1)} <===> none/whiteness/error Error: $whiteness: Expected 1 to have unit "%". , -1 | a {b: change-color(white, $whiteness: 1)} +2 | a {b: color.change(white, $whiteness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/blackness/input.scss -a {b: change-color(black, $blackness: 1)} +@use "sass:color"; +a {b: color.change(black, $blackness: 1)} <===> none/blackness/error Error: $blackness: Expected 1 to have unit "%". , -1 | a {b: change-color(black, $blackness: 1)} +2 | a {b: color.change(black, $blackness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/whiteness/input.scss -a {b: change-color(white, $whiteness: 1px)} +@use "sass:color"; +a {b: color.change(white, $whiteness: 1px)} <===> wrong/whiteness/error Error: $whiteness: Expected 1px to have unit "%". , -1 | a {b: change-color(white, $whiteness: 1px)} +2 | a {b: color.change(white, $whiteness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/blackness/input.scss -a {b: change-color(black, $blackness: 1px)} +@use "sass:color"; +a {b: color.change(black, $blackness: 1px)} <===> wrong/blackness/error Error: $blackness: Expected 1px to have unit "%". , -1 | a {b: change-color(black, $blackness: 1px)} +2 | a {b: color.change(black, $blackness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/hsl.hrx b/spec/core_functions/color/change_color/hsl.hrx index 70a261689e..3f65e0a8f1 100644 --- a/spec/core_functions/color/change_color/hsl.hrx +++ b/spec/core_functions/color/change_color/hsl.hrx @@ -1,5 +1,6 @@ <===> hue/max/input.scss -a {b: change-color(red, $hue: 359)} +@use "sass:color"; +a {b: color.change(red, $hue: 359)} <===> hue/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> hue/above_max/input.scss -a {b: change-color(red, $hue: 540)} +@use "sass:color"; +a {b: color.change(red, $hue: 540)} <===> hue/above_max/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> hue/min/input.scss -a {b: change-color(blue, $hue: 0)} +@use "sass:color"; +a {b: color.change(blue, $hue: 0)} <===> hue/min/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> hue/negative/input.scss -a {b: change-color(red, $hue: -60)} +@use "sass:color"; +a {b: color.change(red, $hue: -60)} <===> hue/negative/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> hue/middle/input.scss -a {b: change-color(red, $hue: 123)} +@use "sass:color"; +a {b: color.change(red, $hue: 123)} <===> hue/middle/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> hue/fraction/input.scss -a {b: change-color(red, $hue: 0.5)} +@use "sass:color"; +a {b: color.change(red, $hue: 0.5)} <===> hue/fraction/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> saturation/max/input.scss -a {b: change-color(plum, $saturation: 100%)} +@use "sass:color"; +a {b: color.change(plum, $saturation: 100%)} <===> saturation/max/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> saturation/min/input.scss -a {b: change-color(plum, $saturation: 0%)} +@use "sass:color"; +a {b: color.change(plum, $saturation: 0%)} <===> saturation/min/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> saturation/high/input.scss -a {b: change-color(plum, $saturation: 76%)} +@use "sass:color"; +a {b: color.change(plum, $saturation: 76%)} <===> saturation/high/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> saturation/low/input.scss -a {b: change-color(plum, $saturation: 14%)} +@use "sass:color"; +a {b: color.change(plum, $saturation: 14%)} <===> saturation/low/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> lightness/max/input.scss -a {b: change-color(red, $lightness: 100%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 100%)} <===> lightness/max/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> lightness/fraction/input.scss -a {b: change-color(red, $lightness: 0.5%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 0.5%)} <===> lightness/fraction/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> lightness/min/input.scss -a {b: change-color(red, $lightness: 0%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 0%)} <===> lightness/min/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> lightness/high/input.scss -a {b: change-color(red, $lightness: 63%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 63%)} <===> lightness/high/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> lightness/low/input.scss -a {b: change-color(red, $lightness: 27%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 27%)} <===> lightness/low/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> all/output.css a { @@ -159,7 +175,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: change-color(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.change(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} <===> alpha_input/output.css a { @@ -169,7 +186,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} +@use "sass:color"; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} <===> alpha_arg/output.css a { @@ -179,7 +197,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} +@use "sass:color"; +a {b: color.change($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} <===> named/output.css a { diff --git a/spec/core_functions/color/change_color/hwb.hrx b/spec/core_functions/color/change_color/hwb.hrx index 9c959b549a..8b3968ce4c 100644 --- a/spec/core_functions/color/change_color/hwb.hrx +++ b/spec/core_functions/color/change_color/hwb.hrx @@ -1,5 +1,6 @@ <===> whiteness/max/input.scss -a {b: change-color(#cc6666, $whiteness: 100%)} +@use "sass:color"; +a {b: color.change(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> whiteness/min/input.scss -a {b: change-color(#cc6666, $whiteness: 0%)} +@use "sass:color"; +a {b: color.change(#cc6666, $whiteness: 0%)} <===> whiteness/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> whiteness/high/input.scss -a {b: change-color(#cc6666, $whiteness: 80%)} +@use "sass:color"; +a {b: color.change(#cc6666, $whiteness: 80%)} <===> whiteness/high/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> whiteness/low/input.scss -a {b: change-color(#cc6666, $whiteness: 20%)} +@use "sass:color"; +a {b: color.change(#cc6666, $whiteness: 20%)} <===> whiteness/low/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> blackness/max/input.scss -a {b: change-color(#993333, $blackness: 100%)} +@use "sass:color"; +a {b: color.change(#993333, $blackness: 100%)} <===> blackness/max/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> blackness/min/input.scss -a {b: change-color(#993333, $blackness: 0%)} +@use "sass:color"; +a {b: color.change(#993333, $blackness: 0%)} <===> blackness/min/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> blackness/high/input.scss -a {b: change-color(#993333, $blackness: 80%)} +@use "sass:color"; +a {b: color.change(#993333, $blackness: 80%)} <===> blackness/high/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> blackness/low/input.scss -a {b: change-color(#993333, $blackness: 20%)} +@use "sass:color"; +a {b: color.change(#993333, $blackness: 20%)} <===> blackness/low/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: change-color(blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.change(blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> all/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: change-color(rgba(blue, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.change(rgba(blue, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> alpha_input/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: change-color(blue, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.3)} +@use "sass:color"; +a {b: color.change(blue, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.3)} <===> alpha_arg/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use "sass:color"; +a {b: color.change($color: blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> named/output.css a { diff --git a/spec/core_functions/color/change_color/no_rgb_hsl.hrx b/spec/core_functions/color/change_color/no_rgb_hsl.hrx index 257b3c6d52..5daadafb57 100644 --- a/spec/core_functions/color/change_color/no_rgb_hsl.hrx +++ b/spec/core_functions/color/change_color/no_rgb_hsl.hrx @@ -1,5 +1,6 @@ <===> positional/input.scss -a {b: change-color(red)} +@use "sass:color"; +a {b: color.change(red)} <===> positional/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: red)} +@use "sass:color"; +a {b: color.change($color: red)} <===> named/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> alpha/max/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 1)} +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 1)} <===> alpha/max/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> alpha/min/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0)} +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0)} <===> alpha/min/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> alpha/high/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0.72)} +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0.72)} <===> alpha/high/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> alpha/low/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0.36)} +@use "sass:color"; +a {b: color.change(rgba(red, 0.5), $alpha: 0.36)} <===> alpha/low/output.css a { diff --git a/spec/core_functions/color/change_color/rgb.hrx b/spec/core_functions/color/change_color/rgb.hrx index b418953047..6316e00d43 100644 --- a/spec/core_functions/color/change_color/rgb.hrx +++ b/spec/core_functions/color/change_color/rgb.hrx @@ -1,5 +1,6 @@ <===> red/max/input.scss -a {b: change-color(black, $red: 255)} +@use "sass:color"; +a {b: color.change(black, $red: 255)} <===> red/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> red/min/input.scss -a {b: change-color(red, $red: 0)} +@use "sass:color"; +a {b: color.change(red, $red: 0)} <===> red/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> red/low/input.scss -a {b: change-color(red, $red: 100)} +@use "sass:color"; +a {b: color.change(red, $red: 100)} <===> red/low/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> red/high/input.scss -a {b: change-color(black, $red: 200)} +@use "sass:color"; +a {b: color.change(black, $red: 200)} <===> red/high/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> green/max/input.scss -a {b: change-color(black, $green: 255)} +@use "sass:color"; +a {b: color.change(black, $green: 255)} <===> green/max/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> green/min/input.scss -a {b: change-color(lime, $green: 0)} +@use "sass:color"; +a {b: color.change(lime, $green: 0)} <===> green/min/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> green/low/input.scss -a {b: change-color(lime, $green: 100)} +@use "sass:color"; +a {b: color.change(lime, $green: 100)} <===> green/low/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> green/high/input.scss -a {b: change-color(black, $green: 200)} +@use "sass:color"; +a {b: color.change(black, $green: 200)} <===> green/high/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> blue/max/input.scss -a {b: change-color(black, $blue: 255)} +@use "sass:color"; +a {b: color.change(black, $blue: 255)} <===> blue/max/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> blue/min/input.scss -a {b: change-color(blue, $blue: 0)} +@use "sass:color"; +a {b: color.change(blue, $blue: 0)} <===> blue/min/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> blue/low/input.scss -a {b: change-color(blue, $blue: 100)} +@use "sass:color"; +a {b: color.change(blue, $blue: 100)} <===> blue/low/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> blue/high/input.scss -a {b: change-color(black, $blue: 200)} +@use "sass:color"; +a {b: color.change(black, $blue: 200)} <===> blue/high/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: change-color(black, $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.change(black, $red: 12, $green: 24, $blue: 48)} <===> all/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: change-color(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.change(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} <===> alpha_input/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: change-color(black, $red: 12, $green: 24, $blue: 48, $alpha: 0.3)} +@use "sass:color"; +a {b: color.change(black, $red: 12, $green: 24, $blue: 48, $alpha: 0.3)} <===> alpha_arg/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: black, $red: 12, $green: 24, $blue: 48)} +@use "sass:color"; +a {b: color.change($color: black, $red: 12, $green: 24, $blue: 48)} <===> named/output.css a { diff --git a/spec/core_functions/color/change_color/units.hrx b/spec/core_functions/color/change_color/units.hrx index 72e4897c57..962e224d7a 100644 --- a/spec/core_functions/color/change_color/units.hrx +++ b/spec/core_functions/color/change_color/units.hrx @@ -1,5 +1,6 @@ <===> hue/deg/input.scss -a {b: change-color(red, $hue: 60deg)} +@use "sass:color"; +a {b: color.change(red, $hue: 60deg)} <===> hue/deg/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> hue/unitless/input.scss -a {b: change-color(red, $hue: 60)} +@use "sass:color"; +a {b: color.change(red, $hue: 60)} <===> hue/unitless/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> hue/unknown/input.scss -a {b: change-color(red, $hue: 60in)} +@use "sass:color"; +a {b: color.change(red, $hue: 60in)} <===> hue/unknown/output.css a { @@ -34,15 +37,16 @@ To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/function-units , -1 | a {b: change-color(red, $hue: 60in)} +2 | a {b: color.change(red, $hue: 60in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> hue/angle/input.scss -a {b: change-color(red, $hue: 60rad)} +@use "sass:color"; +a {b: color.change(red, $hue: 60rad)} <===> hue/angle/output.css a { @@ -52,7 +56,8 @@ a { <===> ================================================================================ <===> saturation/percent/input.scss -a {b: change-color(red, $saturation: 50%)} +@use "sass:color"; +a {b: color.change(red, $saturation: 50%)} <===> saturation/percent/output.css a { @@ -62,7 +67,8 @@ a { <===> ================================================================================ <===> saturation/unitless/input.scss -a {b: change-color(red, $saturation: 50)} +@use "sass:color"; +a {b: color.change(red, $saturation: 50)} <===> saturation/unitless/output.css a { @@ -77,15 +83,16 @@ To preserve current behavior: $saturation * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: change-color(red, $saturation: 50)} +2 | a {b: color.change(red, $saturation: 50)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/unknown/input.scss -a {b: change-color(red, $saturation: 50in)} +@use "sass:color"; +a {b: color.change(red, $saturation: 50in)} <===> saturation/unknown/output.css a { @@ -100,15 +107,16 @@ To preserve current behavior: calc($saturation / 1in * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: change-color(red, $saturation: 50in)} +2 | a {b: color.change(red, $saturation: 50in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/percent/input.scss -a {b: change-color(red, $lightness: 30%)} +@use "sass:color"; +a {b: color.change(red, $lightness: 30%)} <===> lightness/percent/output.css a { @@ -118,7 +126,8 @@ a { <===> ================================================================================ <===> lightness/unitless/input.scss -a {b: change-color(red, $lightness: 30)} +@use "sass:color"; +a {b: color.change(red, $lightness: 30)} <===> lightness/unitless/output.css a { @@ -133,15 +142,16 @@ To preserve current behavior: $lightness * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: change-color(red, $lightness: 30)} +2 | a {b: color.change(red, $lightness: 30)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/unknown/input.scss -a {b: change-color(red, $lightness: 30in)} +@use "sass:color"; +a {b: color.change(red, $lightness: 30in)} <===> lightness/unknown/output.css a { @@ -156,15 +166,16 @@ To preserve current behavior: calc($lightness / 1in * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: change-color(red, $lightness: 30in)} +2 | a {b: color.change(red, $lightness: 30in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unitless/input.scss -a {b: change-color(red, $alpha: 0.5)} +@use "sass:color"; +a {b: color.change(red, $alpha: 0.5)} <===> alpha/unitless/output.css a { @@ -174,7 +185,8 @@ a { <===> ================================================================================ <===> alpha/percent/input.scss -a {b: adjust-color(red, $alpha: 0.5%)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: 0.5%)} <===> alpha/percent/output.css a { @@ -189,15 +201,16 @@ To preserve current behavior: calc($alpha / 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $alpha: 0.5%)} +2 | a {b: color.adjust(red, $alpha: 0.5%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/unknown/input.scss -a {b: adjust-color(red, $alpha: 0.5px)} +@use "sass:color"; +a {b: color.adjust(red, $alpha: 0.5px)} <===> alpha/unknown/output.css a { @@ -212,7 +225,7 @@ To preserve current behavior: calc($alpha / 1px) More info: https://sass-lang.com/d/function-units , -1 | a {b: adjust-color(red, $alpha: 0.5px)} +2 | a {b: color.adjust(red, $alpha: 0.5px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/complement.hrx b/spec/core_functions/color/complement.hrx index c8ac6aa210..fc94247e52 100644 --- a/spec/core_functions/color/complement.hrx +++ b/spec/core_functions/color/complement.hrx @@ -1,5 +1,6 @@ <===> red/input.scss -a {b: complement(red)} +@use "sass:color"; +a {b: color.complement(red)} <===> red/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> turquoise/input.scss -a {b: complement(turquoise)} +@use "sass:color"; +a {b: color.complement(turquoise)} <===> turquoise/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> grayscale/gray/input.scss -a {b: complement(gray)} +@use "sass:color"; +a {b: color.complement(gray)} <===> grayscale/gray/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> grayscale/white/input.scss -a {b: complement(white)} +@use "sass:color"; +a {b: color.complement(white)} <===> grayscale/white/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> grayscale/black/input.scss -a {b: complement(black)} +@use "sass:color"; +a {b: color.complement(black)} <===> grayscale/black/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> alpha/input.scss -a {b: complement(rgba(turquoise, 0.7))} +@use "sass:color"; +a {b: color.complement(rgba(turquoise, 0.7))} <===> alpha/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: complement($color: red)} +@use "sass:color"; +a {b: color.complement($color: red)} <===> named/output.css a { @@ -69,46 +76,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: complement()} +@use "sass:color"; +a {b: color.complement()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: complement()} - | ^^^^^^^^^^^^ invocation +2 | a {b: color.complement()} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function complement($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: complement(red, 1)} +@use "sass:color"; +a {b: color.complement(red, 1)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: complement(red, 1)} - | ^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.complement(red, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function complement($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: complement(1)} +@use "sass:color"; +a {b: color.complement(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: complement(1)} - | ^^^^^^^^^^^^^ +2 | a {b: color.complement(1)} + | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/darken.hrx b/spec/core_functions/color/darken.hrx deleted file mode 100644 index e19ff853f7..0000000000 --- a/spec/core_functions/color/darken.hrx +++ /dev/null @@ -1,153 +0,0 @@ -<===> max/input.scss -a {b: darken(red, 100%)} - -<===> max/output.css -a { - b: black; -} - -<===> -================================================================================ -<===> max_remaining/input.scss -a {b: darken(red, 50%)} - -<===> max_remaining/output.css -a { - b: black; -} - -<===> -================================================================================ -<===> min/input.scss -a {b: darken(red, 0%)} - -<===> min/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: darken(red, 14%)} - -<===> middle/output.css -a { - b: #b80000; -} - -<===> -================================================================================ -<===> fraction/input.scss -a {b: darken(red, 0.5%)} - -<===> fraction/output.css -a { - b: #fc0000; -} - -<===> -================================================================================ -<===> alpha/input.scss -a {b: darken(rgba(red, 0.2), 100%)} - -<===> alpha/output.css -a { - b: rgba(0, 0, 0, 0.2); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: darken($color: red, $amount: 14%)} - -<===> named/output.css -a { - b: #b80000; -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: darken(red)} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: darken(red)} - | ^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function darken($color, $amount) { - | ======================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: darken(red, 1%, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: darken(red, 1%, 2)} - | ^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function darken($color, $amount) { - | ======================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: darken(1, 2)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: darken(1, 2)} - | ^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/lightness/input.scss -a {b: darken(red, blue)} - -<===> error/type/lightness/error -Error: $amount: blue is not a number. - , -1 | a {b: darken(red, blue)} - | ^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -a {b: darken(red, -0.001)} - -<===> error/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: darken(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -a {b: darken(red, 100.001)} - -<===> error/bounds/too_high/error -Error: $amount: Expected 100.001 to be within 0 and 100. - , -1 | a {b: darken(red, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/desaturate.hrx b/spec/core_functions/color/desaturate.hrx deleted file mode 100644 index 07804cefb5..0000000000 --- a/spec/core_functions/color/desaturate.hrx +++ /dev/null @@ -1,160 +0,0 @@ -<===> max/input.scss -a {b: desaturate(plum, 100%)} - -<===> max/output.css -a { - b: #bfbfbf; -} - -<===> -================================================================================ -<===> max_remaining/input.scss -a {b: desaturate(plum, 48%)} - -<===> max_remaining/output.css -a { - b: #bfbfbf; -} - -<===> -================================================================================ -<===> min/input.scss -a {b: desaturate(plum, 0%)} - -<===> min/output.css -a { - b: plum; -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: desaturate(plum, 14%)} - -<===> middle/output.css -a { - b: #d4a9d4; -} - -<===> -================================================================================ -<===> alpha/input.scss -a {b: desaturate(rgba(plum, 0.3), 100%)} - -<===> alpha/output.css -a { - b: rgba(191, 191, 191, 0.3); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: desaturate($color: plum, $amount: 14%)} - -<===> named/output.css -a { - b: #d4a9d4; -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: desaturate(plum)} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: desaturate(plum)} - | ^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function desaturate($color, $amount) { - | =========================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: desaturate(plum, 1%, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: desaturate(plum, 1%, 2)} - | ^^^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function desaturate($color, $amount) { - | =========================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/one_arg/type/input.scss -a {b: desaturate(red)} - -<===> error/one_arg/type/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: desaturate(red)} - | ^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function desaturate($color, $amount) { - | =========================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: desaturate(1, 2)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: desaturate(1, 2)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/lightness/input.scss -a {b: desaturate(plum, blue)} - -<===> error/type/lightness/error -Error: $amount: blue is not a number. - , -1 | a {b: desaturate(plum, blue)} - | ^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -a {b: desaturate(plum, -0.001)} - -<===> error/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: desaturate(plum, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -a {b: desaturate(plum, 100.001)} - -<===> error/bounds/too_high/error -Error: $amount: Expected 100.001 to be within 0 and 100. - , -1 | a {b: desaturate(plum, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/fade_in.hrx b/spec/core_functions/color/fade_in.hrx deleted file mode 100644 index abb9fc90dc..0000000000 --- a/spec/core_functions/color/fade_in.hrx +++ /dev/null @@ -1,158 +0,0 @@ -<===> max/input.scss -a {b: fade-in(rgba(red, 0.5), 1)} - -<===> max/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> max_remaining/input.scss -a {b: fade-in(rgba(red, 0.5), 0.5)} - -<===> max_remaining/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> min/input.scss -a {b: fade-in(rgba(red, 0.5), 0)} - -<===> min/output.css -a { - b: rgba(255, 0, 0, 0.5); -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: fade-in(rgba(red, 0.5), 0.14)} - -<===> middle/output.css -a { - b: rgba(255, 0, 0, 0.64); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: fade-in($color: rgba(red, 0.5), $amount: 0.14)} - -<===> named/output.css -a { - b: rgba(255, 0, 0, 0.64); -} - -<===> -================================================================================ -<===> opacify/input.scss -a {b: opacify($color: rgba(red, 0.5), $amount: 0.14)} - -<===> opacify/output.css -a { - b: rgba(255, 0, 0, 0.64); -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: fade-in(red)} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: fade-in(red)} - | ^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function fade-in($color, $amount) { - | ======================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: fade-in(red, 0.1, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: fade-in(red, 0.1, 2)} - | ^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function fade-in($color, $amount) { - | ======================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: fade-in(1, 0.1)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: fade-in(1, 0.1)} - | ^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/alpha/input.scss -a {b: fade-in(red, blue)} - -<===> error/type/alpha/error -Error: $amount: blue is not a number. - , -1 | a {b: fade-in(red, blue)} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -a {b: fade-in(red, -0.001)} - -<===> error/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 1. - , -1 | a {b: fade-in(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -a {b: fade-in(red, 1.001)} - -<===> error/bounds/too_high/error -Error: $amount: Expected 1.001 to be within 0 and 1. - , -1 | a {b: fade-in(red, 1.001)} - | ^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: fade-in(red, 50%)} - -<===> error/bounds/unit/error -Error: $amount: Expected 50% to be within 0 and 1. - , -3 | a {b: fade-in(red, 50%)} - | ^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet diff --git a/spec/core_functions/color/fade_out.hrx b/spec/core_functions/color/fade_out.hrx deleted file mode 100644 index 5164907b78..0000000000 --- a/spec/core_functions/color/fade_out.hrx +++ /dev/null @@ -1,158 +0,0 @@ -<===> max/input.scss -a {b: fade-out(rgba(red, 0.5), 1)} - -<===> max/output.css -a { - b: rgba(255, 0, 0, 0); -} - -<===> -================================================================================ -<===> max_remaining/input.scss -a {b: fade-out(rgba(red, 0.5), 0.5)} - -<===> max_remaining/output.css -a { - b: rgba(255, 0, 0, 0); -} - -<===> -================================================================================ -<===> min/input.scss -a {b: fade-out(rgba(red, 0.5), 0)} - -<===> min/output.css -a { - b: rgba(255, 0, 0, 0.5); -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: fade-out(rgba(red, 0.5), 0.14)} - -<===> middle/output.css -a { - b: rgba(255, 0, 0, 0.36); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: fade-out($color: rgba(red, 0.5), $amount: 0.14)} - -<===> named/output.css -a { - b: rgba(255, 0, 0, 0.36); -} - -<===> -================================================================================ -<===> transparentize/input.scss -a {b: transparentize($color: rgba(red, 0.5), $amount: 0.14)} - -<===> transparentize/output.css -a { - b: rgba(255, 0, 0, 0.36); -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: fade-out(red)} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: fade-out(red)} - | ^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function fade-out($color, $amount) { - | ========================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: fade-out(red, 0.1, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: fade-out(red, 0.1, 2)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function fade-out($color, $amount) { - | ========================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: fade-out(1, 0.1)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: fade-out(1, 0.1)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/alpha/input.scss -a {b: fade-out(red, blue)} - -<===> error/type/alpha/error -Error: $amount: blue is not a number. - , -1 | a {b: fade-out(red, blue)} - | ^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -a {b: fade-out(red, -0.001)} - -<===> error/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 1. - , -1 | a {b: fade-out(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -a {b: fade-out(red, 1.001)} - -<===> error/bounds/too_high/error -Error: $amount: Expected 1.001 to be within 0 and 1. - , -1 | a {b: fade-out(red, 1.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: fade-out(red, 50%)} - -<===> error/bounds/unit/error -Error: $amount: Expected 50% to be within 0 and 1. - , -3 | a {b: fade-out(red, 50%)} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet diff --git a/spec/core_functions/color/grayscale.hrx b/spec/core_functions/color/grayscale.hrx index 21086e2de4..1d44c8521f 100644 --- a/spec/core_functions/color/grayscale.hrx +++ b/spec/core_functions/color/grayscale.hrx @@ -1,5 +1,6 @@ <===> no_saturation/white/input.scss -a {b: grayscale(white)} +@use "sass:color"; +a {b: color.grayscale(white)} <===> no_saturation/white/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> no_saturation/black/input.scss -a {b: grayscale(black)} +@use "sass:color"; +a {b: color.grayscale(black)} <===> no_saturation/black/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> no_saturation/gray/input.scss -a {b: grayscale(#494949)} +@use "sass:color"; +a {b: color.grayscale(#494949)} <===> no_saturation/gray/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> max_saturation/input.scss -a {b: grayscale(red)} +@use "sass:color"; +a {b: color.grayscale(red)} <===> max_saturation/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> mid_saturation/input.scss -a {b: grayscale(#633736)} +@use "sass:color"; +a {b: color.grayscale(#633736)} <===> mid_saturation/output.css a { @@ -49,28 +54,19 @@ a { <===> ================================================================================ <===> alpha/input.scss -a {b: grayscale(rgba(#633736, 0.3))} +@use "sass:color"; +a {b: color.grayscale(rgba(#633736, 0.3))} <===> alpha/output.css a { b: rgba(77, 77, 77, 0.3); } -<===> -================================================================================ -<===> number/input.scss -// A number should produce a plain function string, for CSS filter functions. -a {b: grayscale(15%)} - -<===> number/output.css -a { - b: grayscale(15%); -} - <===> ================================================================================ <===> named/input.scss -a {b: grayscale($color: white)} +@use "sass:color"; +a {b: color.grayscale($color: white)} <===> named/output.css a { @@ -79,88 +75,83 @@ a { <===> ================================================================================ -<===> with_css_var/input.scss -a {b: grayscale(var(--c))} +<===> css_overload/input.scss +@use "sass:color"; +a {b: color.grayscale(1)} -<===> with_css_var/output.css +<===> css_overload/output.css a { - b: grayscale(var(--c)); + b: grayscale(1); } -<===> -================================================================================ -<===> with_calc/input.scss -a {b: grayscale(calc(1 + 2))} - -<===> with_calc/output.css -a { - b: grayscale(3); -} +<===> css_overload/warning +DEPRECATION WARNING: Passing a number (1) to color.grayscale() is deprecated. -<===> -================================================================================ -<===> with_unquoted_calc/input.scss -a {b: grayscale(unquote('calc(1)'))} +Recommendation: grayscale(1) -<===> with_unquoted_calc/output.css -a { - b: grayscale(calc(1)); -} + , +2 | a {b: color.grayscale(1)} + | ^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: grayscale()} +@use "sass:color"; +a {b: color.grayscale()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: grayscale()} - | ^^^^^^^^^^^ invocation +2 | a {b: color.grayscale()} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function grayscale($color) { | ================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: grayscale(red, 1)} +@use "sass:color"; +a {b: color.grayscale(red, 1)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: grayscale(red, 1)} - | ^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.grayscale(red, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function grayscale($color) { | ================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: grayscale(c)} +@use "sass:color"; +a {b: color.grayscale(c)} <===> error/type/error Error: $color: c is not a color. , -1 | a {b: grayscale(c)} - | ^^^^^^^^^^^^ +2 | a {b: color.grayscale(c)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ -<===> error/with_module/type/input.scss +<===> error/css_variable/input.scss @use 'sass:color'; a {b: color.grayscale(var(--c))} -<===> error/with_module/type/error +<===> error/css_variable/error Error: $color: var(--c) is not a color. , 2 | a {b: color.grayscale(var(--c))} diff --git a/spec/core_functions/color/green.hrx b/spec/core_functions/color/green.hrx index e43002899b..cc595429da 100644 --- a/spec/core_functions/color/green.hrx +++ b/spec/core_functions/color/green.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: green(rgb(0, 255, 0))} +@use "sass:color"; +a {b: color.green(rgb(0, 255, 0))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: green(rgb(0, 0, 0))} +@use "sass:color"; +a {b: color.green(rgb(0, 0, 0))} <===> min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: green(rgb(0, 123, 0))} +@use "sass:color"; +a {b: color.green(rgb(0, 123, 0))} <===> middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: green($color: rgb(0, 234, 0))} +@use "sass:color"; +a {b: color.green($color: rgb(0, 234, 0))} <===> named/output.css a { @@ -39,46 +43,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: green()} +@use "sass:color"; +a {b: color.green()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: green()} - | ^^^^^^^ invocation +2 | a {b: color.green()} + | ^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function green($color) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: green(red, green)} +@use "sass:color"; +a {b: color.green(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: green(red, green)} - | ^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.green(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function green($color) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: green(1)} +@use "sass:color"; +a {b: color.green(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: green(1)} - | ^^^^^^^^ +2 | a {b: color.green(1)} + | ^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/hsl/error/one_arg.hrx b/spec/core_functions/color/hsl/error/one_arg.hrx index 54ce6e91f7..c9f7ad8efd 100644 --- a/spec/core_functions/color/hsl/error/one_arg.hrx +++ b/spec/core_functions/color/hsl/error/one_arg.hrx @@ -149,15 +149,16 @@ Error: $lightness: "var(--foo) / 0.4" is not a number. <===> ================================================================================ <===> slash_list/too_few_elements/input.scss -a {b: hsl(append((), 0 100% 100%, $separator: slash))} +@use "sass:list"; +a {b: hsl(list.append((), 0 100% 100%, $separator: slash))} <===> slash_list/too_few_elements/error Error: Only 2 slash-separated elements allowed, but 1 was passed. , -1 | a {b: hsl(append((), 0 100% 100%, $separator: slash))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: hsl(list.append((), 0 100% 100%, $separator: slash))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ diff --git a/spec/core_functions/color/hsl/four_args/special_functions.hrx b/spec/core_functions/color/hsl/four_args/special_functions.hrx index 3b8cf4fb43..532bd8b050 100644 --- a/spec/core_functions/color/hsl/four_args/special_functions.hrx +++ b/spec/core_functions/color/hsl/four_args/special_functions.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: hsl(unquote("calc(1)"), 2%, 3%, 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("calc(1)"), 2%, 3%, 0.4)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: hsl(1, unquote("calc(2%)"), 3%, 0.4)} +@use "sass:string"; +a {b: hsl(1, string.unquote("calc(2%)"), 3%, 0.4)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("calc(3%)"), 0.4)} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("calc(3%)"), 0.4)} <===> calc/string/arg_3/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> calc/string/arg_4/input.scss -a {b: hsl(1, 2%, 3%, unquote("calc(0.4)"))} +@use "sass:string"; +a {b: hsl(1, 2%, 3%, string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { @@ -159,7 +163,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: hsl(unquote("min(1)"), 2%, 3%, 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("min(1)"), 2%, 3%, 0.4)} <===> min/string/arg_1/output.css a { @@ -169,7 +174,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: hsl(1, unquote("min(2%)"), 3%, 0.4)} +@use "sass:string"; +a {b: hsl(1, string.unquote("min(2%)"), 3%, 0.4)} <===> min/string/arg_2/output.css a { @@ -179,7 +185,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("min(3%)"), 0.4)} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("min(3%)"), 0.4)} <===> min/string/arg_3/output.css a { @@ -189,7 +196,8 @@ a { <===> ================================================================================ <===> min/string/arg_4/input.scss -a {b: hsl(1, 2%, 3%, unquote("min(0.4)"))} +@use "sass:string"; +a {b: hsl(1, 2%, 3%, string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { @@ -199,7 +207,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: hsl(unquote("max(1)"), 2%, 3%, 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("max(1)"), 2%, 3%, 0.4)} <===> max/string/arg_1/output.css a { @@ -209,7 +218,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: hsl(1, unquote("max(2%)"), 3%, 0.4)} +@use "sass:string"; +a {b: hsl(1, string.unquote("max(2%)"), 3%, 0.4)} <===> max/string/arg_2/output.css a { @@ -219,7 +229,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("max(3%)"), 0.4)} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("max(3%)"), 0.4)} <===> max/string/arg_3/output.css a { @@ -229,7 +240,8 @@ a { <===> ================================================================================ <===> max/string/arg_4/input.scss -a {b: hsl(1, 2%, 3%, unquote("max(0.4)"))} +@use "sass:string"; +a {b: hsl(1, 2%, 3%, string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { @@ -239,7 +251,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: hsl(unquote("clamp(1, 2, 3)"), 2%, 3%, 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("clamp(1, 2, 3)"), 2%, 3%, 0.4)} <===> clamp/string/arg_1/output.css a { @@ -249,7 +262,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: hsl(1, unquote("clamp(2%, 3%, 4%)"), 3%, 0.4)} +@use "sass:string"; +a {b: hsl(1, string.unquote("clamp(2%, 3%, 4%)"), 3%, 0.4)} <===> clamp/string/arg_2/output.css a { @@ -259,7 +273,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("clamp(3%, 4%, 5%)"), 0.4)} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("clamp(3%, 4%, 5%)"), 0.4)} <===> clamp/string/arg_3/output.css a { @@ -269,7 +284,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_4/input.scss -a {b: hsl(1, 2%, 3%, unquote("clamp(0.4, 0.5, 0.6)"))} +@use "sass:string"; +a {b: hsl(1, 2%, 3%, string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { diff --git a/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx b/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx index 1478ac8514..b2d279ecb0 100644 --- a/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: hsl(unquote("calc(1)") 2% 3% / 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("calc(1)") 2% 3% / 0.4)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: hsl(1 unquote("calc(2%)") 3% / 0.4)} +@use "sass:string"; +a {b: hsl(1 string.unquote("calc(2%)") 3% / 0.4)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: hsl(1 2% unquote("calc(3%)") / 0.4)} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("calc(3%)") / 0.4)} <===> calc/string/arg_3/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> calc/string/arg_4/input.scss -a {b: hsl(1 2% 3% / unquote("calc(0.4)"))} +@use "sass:string"; +a {b: hsl(1 2% 3% / string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { @@ -159,7 +163,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: hsl(unquote("min(1)") 2% 3% / 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("min(1)") 2% 3% / 0.4)} <===> min/string/arg_1/output.css a { @@ -169,7 +174,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: hsl(1 unquote("min(2%)") 3% / 0.4)} +@use "sass:string"; +a {b: hsl(1 string.unquote("min(2%)") 3% / 0.4)} <===> min/string/arg_2/output.css a { @@ -179,7 +185,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: hsl(1 2% unquote("min(3%)") / 0.4)} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("min(3%)") / 0.4)} <===> min/string/arg_3/output.css a { @@ -189,7 +196,8 @@ a { <===> ================================================================================ <===> min/string/arg_4/input.scss -a {b: hsl(1 2% 3% / unquote("min(0.4)"))} +@use "sass:string"; +a {b: hsl(1 2% 3% / string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { @@ -199,7 +207,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: hsl(unquote("max(1)") 2% 3% / 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("max(1)") 2% 3% / 0.4)} <===> max/string/arg_1/output.css a { @@ -209,7 +218,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: hsl(1 unquote("max(2%)") 3% / 0.4)} +@use "sass:string"; +a {b: hsl(1 string.unquote("max(2%)") 3% / 0.4)} <===> max/string/arg_2/output.css a { @@ -219,7 +229,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: hsl(1 2% unquote("max(3%)") / 0.4)} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("max(3%)") / 0.4)} <===> max/string/arg_3/output.css a { @@ -229,7 +240,8 @@ a { <===> ================================================================================ <===> max/string/arg_4/input.scss -a {b: hsl(1 2% 3% / unquote("max(0.4)"))} +@use "sass:string"; +a {b: hsl(1 2% 3% / string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { @@ -239,7 +251,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: hsl(unquote("clamp(1, 2, 3)") 2% 3% / 0.4)} +@use "sass:string"; +a {b: hsl(string.unquote("clamp(1, 2, 3)") 2% 3% / 0.4)} <===> clamp/string/arg_1/output.css a { @@ -249,7 +262,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: hsl(1 unquote("clamp(2%, 3%, 4%)") 3% / 0.4)} +@use "sass:string"; +a {b: hsl(1 string.unquote("clamp(2%, 3%, 4%)") 3% / 0.4)} <===> clamp/string/arg_2/output.css a { @@ -259,7 +273,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: hsl(1 2% unquote("clamp(3%, 4%, 5%)") / 0.4)} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("clamp(3%, 4%, 5%)") / 0.4)} <===> clamp/string/arg_3/output.css a { @@ -269,7 +284,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_4/input.scss -a {b: hsl(1 2% 3% / unquote("clamp(0.4, 0.5, 0.6)"))} +@use "sass:string"; +a {b: hsl(1 2% 3% / string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { diff --git a/spec/core_functions/color/hsl/one_arg/special_functions/no_alpha.hrx b/spec/core_functions/color/hsl/one_arg/special_functions/no_alpha.hrx index 0896c85fe3..6812310aee 100644 --- a/spec/core_functions/color/hsl/one_arg/special_functions/no_alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/special_functions/no_alpha.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: hsl(unquote("calc(1)") 2% 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("calc(1)") 2% 3%)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: hsl(1 unquote("calc(2%)") 3%)} +@use "sass:string"; +a {b: hsl(1 string.unquote("calc(2%)") 3%)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: hsl(1 2% unquote("calc(3%)"))} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("calc(3%)"))} <===> calc/string/arg_3/output.css a { @@ -119,7 +122,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: hsl(unquote("min(1)") 2% 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("min(1)") 2% 3%)} <===> min/string/arg_1/output.css a { @@ -129,7 +133,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: hsl(1 unquote("min(2%)") 3%)} +@use "sass:string"; +a {b: hsl(1 string.unquote("min(2%)") 3%)} <===> min/string/arg_2/output.css a { @@ -139,7 +144,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: hsl(1 2% unquote("min(3%)"))} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("min(3%)"))} <===> min/string/arg_3/output.css a { @@ -149,7 +155,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: hsl(unquote("max(1)") 2% 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("max(1)") 2% 3%)} <===> max/string/arg_1/output.css a { @@ -159,7 +166,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: hsl(1 unquote("max(2%)") 3%)} +@use "sass:string"; +a {b: hsl(1 string.unquote("max(2%)") 3%)} <===> max/string/arg_2/output.css a { @@ -169,7 +177,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: hsl(1 2% unquote("max(3%)"))} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("max(3%)"))} <===> max/string/arg_3/output.css a { @@ -179,7 +188,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: hsl(unquote("clamp(1, 2, 3)") 2% 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("clamp(1, 2, 3)") 2% 3%)} <===> clamp/string/arg_1/output.css a { @@ -189,7 +199,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: hsl(1 unquote("clamp(2%, 3%, 4%)") 3%)} +@use "sass:string"; +a {b: hsl(1 string.unquote("clamp(2%, 3%, 4%)") 3%)} <===> clamp/string/arg_2/output.css a { @@ -199,7 +210,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: hsl(1 2% unquote("clamp(3%, 4%, 5%)"))} +@use "sass:string"; +a {b: hsl(1 2% string.unquote("clamp(3%, 4%, 5%)"))} <===> clamp/string/arg_3/output.css a { diff --git a/spec/core_functions/color/hsl/three_args/special_functions.hrx b/spec/core_functions/color/hsl/three_args/special_functions.hrx index fa07979721..9fc64f1bef 100644 --- a/spec/core_functions/color/hsl/three_args/special_functions.hrx +++ b/spec/core_functions/color/hsl/three_args/special_functions.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: hsl(unquote("calc(1)"), 2%, 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("calc(1)"), 2%, 3%)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: hsl(1, unquote("calc(2%)"), 3%)} +@use "sass:string"; +a {b: hsl(1, string.unquote("calc(2%)"), 3%)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("calc(3%)"))} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("calc(3%)"))} <===> calc/string/arg_3/output.css a { @@ -119,7 +122,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: hsl(unquote("min(1)"), 2%, 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("min(1)"), 2%, 3%)} <===> min/string/arg_1/output.css a { @@ -129,7 +133,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: hsl(1, unquote("min(2%)"), 3%)} +@use "sass:string"; +a {b: hsl(1, string.unquote("min(2%)"), 3%)} <===> min/string/arg_2/output.css a { @@ -139,7 +144,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("min(3%)"))} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("min(3%)"))} <===> min/string/arg_3/output.css a { @@ -149,7 +155,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: hsl(unquote("max(1)"), 2%, 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("max(1)"), 2%, 3%)} <===> max/string/arg_1/output.css a { @@ -159,7 +166,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: hsl(1, unquote("max(2%)"), 3%)} +@use "sass:string"; +a {b: hsl(1, string.unquote("max(2%)"), 3%)} <===> max/string/arg_2/output.css a { @@ -169,7 +177,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("max(3%)"))} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("max(3%)"))} <===> max/string/arg_3/output.css a { @@ -179,7 +188,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: hsl(unquote("clamp(1, 2, 3)"), 2%, 3%)} +@use "sass:string"; +a {b: hsl(string.unquote("clamp(1, 2, 3)"), 2%, 3%)} <===> clamp/string/arg_1/output.css a { @@ -189,7 +199,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: hsl(1, unquote("clamp(2%, 3%, 4%)"), 3%)} +@use "sass:string"; +a {b: hsl(1, string.unquote("clamp(2%, 3%, 4%)"), 3%)} <===> clamp/string/arg_2/output.css a { @@ -199,7 +210,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: hsl(1, 2%, unquote("clamp(3%, 4%, 5%)"))} +@use "sass:string"; +a {b: hsl(1, 2%, string.unquote("clamp(3%, 4%, 5%)"))} <===> clamp/string/arg_3/output.css a { diff --git a/spec/core_functions/color/hue.hrx b/spec/core_functions/color/hue.hrx index 5af21dd5e1..ba5367a574 100644 --- a/spec/core_functions/color/hue.hrx +++ b/spec/core_functions/color/hue.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: hue(hsl(359, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(359, 50%, 50%))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> above_max/input.scss -a {b: hue(hsl(540, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(540, 50%, 50%))} <===> above_max/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: hue(hsl(0, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(0, 50%, 50%))} <===> min/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> negative/input.scss -a {b: hue(hsl(-180, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(-180, 50%, 50%))} <===> negative/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: hue(hsl(123, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(123, 50%, 50%))} <===> middle/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> fraction/input.scss -a {b: hue(hsl(0.5, 50%, 50%))} +@use "sass:color"; +a {b: color.hue(hsl(0.5, 50%, 50%))} <===> fraction/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: hue($color: hsl(234, 50%, 50%))} +@use "sass:color"; +a {b: color.hue($color: hsl(234, 50%, 50%))} <===> named/output.css a { @@ -69,46 +76,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: hue()} +@use "sass:color"; +a {b: color.hue()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: hue()} - | ^^^^^ invocation +2 | a {b: color.hue()} + | ^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function hue($color) { | =========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: hue(red, green)} +@use "sass:color"; +a {b: color.hue(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: hue(red, green)} - | ^^^^^^^^^^^^^^^ invocation +2 | a {b: color.hue(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function hue($color) { | =========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: hue(1)} +@use "sass:color"; +a {b: color.hue(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: hue(1)} - | ^^^^^^ +2 | a {b: color.hue(1)} + | ^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/ie_hex_str.hrx b/spec/core_functions/color/ie_hex_str.hrx index 5b6f74ca2a..8a1da05f8e 100644 --- a/spec/core_functions/color/ie_hex_str.hrx +++ b/spec/core_functions/color/ie_hex_str.hrx @@ -1,5 +1,6 @@ <===> opaque/input.scss -a {b: ie-hex-str(#daddee)} +@use "sass:color"; +a {b: color.ie-hex-str(#daddee)} <===> opaque/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> translucent/input.scss -a {b: ie-hex-str(rgba(#daddee, 0.3))} +@use "sass:color"; +a {b: color.ie-hex-str(rgba(#daddee, 0.3))} <===> translucent/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> transparent/input.scss -a {b: ie-hex-str(rgba(turquoise, 0))} +@use "sass:color"; +a {b: color.ie-hex-str(rgba(turquoise, 0))} <===> transparent/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> leading_zero/input.scss -a {b: ie-hex-str(rgba(#020304, 0.003))} +@use "sass:color"; +a {b: color.ie-hex-str(rgba(#020304, 0.003))} <===> leading_zero/output.css a { @@ -39,7 +43,9 @@ a { <===> ================================================================================ <===> type/input.scss -a {b: type-of(ie-hex-str(#daddee))} +@use "sass:color"; +@use "sass:meta"; +a {b: meta.type-of(color.ie-hex-str(#daddee))} <===> type/output.css a { @@ -49,7 +55,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: ie-hex-str($color: #daddee)} +@use "sass:color"; +a {b: color.ie-hex-str($color: #daddee)} <===> named/output.css a { @@ -59,46 +66,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: ie-hex-str()} +@use "sass:color"; +a {b: color.ie-hex-str()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: ie-hex-str()} - | ^^^^^^^^^^^^ invocation +2 | a {b: color.ie-hex-str()} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function ie-hex-str($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: ie-hex-str(red, blue)} +@use "sass:color"; +a {b: color.ie-hex-str(red, blue)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: ie-hex-str(red, blue)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.ie-hex-str(red, blue)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function ie-hex-str($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: ie-hex-str(c)} +@use "sass:color"; +a {b: color.ie-hex-str(c)} <===> error/type/error Error: $color: c is not a color. , -1 | a {b: ie-hex-str(c)} - | ^^^^^^^^^^^^^ +2 | a {b: color.ie-hex-str(c)} + | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/invert.hrx b/spec/core_functions/color/invert.hrx index 512efa942c..3b8bbf773f 100644 --- a/spec/core_functions/color/invert.hrx +++ b/spec/core_functions/color/invert.hrx @@ -1,5 +1,6 @@ <===> white/input.scss -a {b: invert(white)} +@use "sass:color"; +a {b: color.invert(white)} <===> white/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> black/input.scss -a {b: invert(black)} +@use "sass:color"; +a {b: color.invert(black)} <===> black/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> gray/input.scss -a {b: invert(gray)} +@use "sass:color"; +a {b: color.invert(gray)} <===> gray/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> turquoise/input.scss -a {b: invert(turquoise)} +@use "sass:color"; +a {b: color.invert(turquoise)} <===> turquoise/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> weighted/min/input.scss -a {b: invert(turquoise, 0%)} +@use "sass:color"; +a {b: color.invert(turquoise, 0%)} <===> weighted/min/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> weighted/max/input.scss -a {b: invert(turquoise, 100%)} +@use "sass:color"; +a {b: color.invert(turquoise, 100%)} <===> weighted/max/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> weighted/middle/input.scss -a {b: invert(turquoise, 50%)} +@use "sass:color"; +a {b: color.invert(turquoise, 50%)} <===> weighted/middle/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> weighted/low/input.scss -a {b: invert(turquoise, 23%)} +@use "sass:color"; +a {b: color.invert(turquoise, 23%)} <===> weighted/low/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> weighted/high/input.scss -a {b: invert(turquoise, 92%)} +@use "sass:color"; +a {b: color.invert(turquoise, 92%)} <===> weighted/high/output.css a { @@ -89,27 +98,19 @@ a { <===> ================================================================================ <===> alpha/input.scss -a {b: invert(rgba(turquoise, 0.4))} +@use "sass:color"; +a {b: color.invert(rgba(turquoise, 0.4))} <===> alpha/output.css a { b: rgba(191, 31, 47, 0.4); } -<===> -================================================================================ -<===> number/input.scss -a {b: invert(10%)} - -<===> number/output.css -a { - b: invert(10%); -} - <===> ================================================================================ <===> named/input.scss -a {b: invert($color: turquoise, $weight: 0%)} +@use "sass:color"; +a {b: color.invert($color: turquoise, $weight: 0%)} <===> named/output.css a { @@ -119,7 +120,8 @@ a { <===> ================================================================================ <===> units/weight/unitless/input.scss -a {b: invert(turquoise, 10)} +@use "sass:color"; +a {b: color.invert(turquoise, 10)} <===> units/weight/unitless/output.css a { @@ -134,15 +136,16 @@ To preserve current behavior: $weight * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: invert(turquoise, 10)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(turquoise, 10)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> units/weight/unknown/input.scss -a {b: invert(turquoise, 10px)} +@use "sass:color"; +a {b: color.invert(turquoise, 10px)} <===> units/weight/unknown/output.css a { @@ -157,108 +160,105 @@ To preserve current behavior: calc($weight / 1px * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: invert(turquoise, 10px)} - | ^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(turquoise, 10px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ -<===> with_css_var/input.scss -a {b: invert(var(--c))} +<===> css_overload/input.scss +@use "sass:color"; +a {b: color.invert(1)} -<===> with_css_var/output.css +<===> css_overload/output.css a { - b: invert(var(--c)); + b: invert(1); } -<===> -================================================================================ -<===> with_calc/input.scss -a {b: invert(calc(1 + 2))} +<===> css_overload/warning +DEPRECATION WARNING: Passing a number (1) to color.invert() is deprecated. -<===> with_calc/output.css -a { - b: invert(3); -} +Recommendation: invert(1) -<===> -================================================================================ -<===> with_unquoted_calc/input.scss -a {b: invert(unquote('calc(1)'))} + , +2 | a {b: color.invert(1)} + | ^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet -<===> with_unquoted_calc/output.css -a { - b: invert(calc(1)); -} <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: invert()} +@use "sass:color"; +a {b: color.invert()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: invert()} - | ^^^^^^^^ invocation +2 | a {b: color.invert()} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function invert($color, $weight: 100%) { | ============================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: invert(turquoise, 0%, 1)} +@use "sass:color"; +a {b: color.invert(turquoise, 0%, 1)} <===> error/too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: invert(turquoise, 0%, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.invert(turquoise, 0%, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function invert($color, $weight: 100%) { | ============================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/number_with_weight/input.scss -a {b: invert(1, 50%)} +@use "sass:color"; +a {b: color.invert(1, 50%)} <===> error/number_with_weight/error Error: Only one argument may be passed to the plain-CSS invert() function. , -1 | a {b: invert(1, 50%)} - | ^^^^^^^^^^^^^^ +2 | a {b: color.invert(1, 50%)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/color/input.scss -a {b: invert(c)} +@use "sass:color"; +a {b: color.invert(c)} <===> error/type/color/error Error: $color: c is not a color. , -1 | a {b: invert(c)} - | ^^^^^^^^^ +2 | a {b: color.invert(c)} + | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ -<===> error/type/with_module/input.scss +<===> error/type/css_variable/input.scss @use 'sass:color'; a {b: color.invert(var(--c))} -<===> error/type/with_module/error +<===> error/type/css_variable/error Error: $color: var(--c) is not a color. , 2 | a {b: color.invert(var(--c))} @@ -269,38 +269,41 @@ Error: $color: var(--c) is not a color. <===> ================================================================================ <===> error/type/weight/input.scss -a {b: invert(red, c)} +@use "sass:color"; +a {b: color.invert(red, c)} <===> error/type/weight/error Error: $weight: c is not a number. , -1 | a {b: invert(red, c)} - | ^^^^^^^^^^^^^^ +2 | a {b: color.invert(red, c)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/bounds/too_low/input.scss -a {b: invert(red, -0.001%)} +@use "sass:color"; +a {b: color.invert(red, -0.001%)} <===> error/bounds/too_low/error Error: $weight: Expected -0.001% to be within 0% and 100%. , -1 | a {b: invert(red, -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(red, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/bounds/too_high/input.scss -a {b: invert(red, 100.001%)} +@use "sass:color"; +a {b: color.invert(red, 100.001%)} <===> error/bounds/too_high/error Error: $weight: Expected 100.001% to be within 0% and 100%. , -1 | a {b: invert(red, 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.invert(red, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/lighten.hrx b/spec/core_functions/color/lighten.hrx deleted file mode 100644 index 1154cd6c33..0000000000 --- a/spec/core_functions/color/lighten.hrx +++ /dev/null @@ -1,153 +0,0 @@ -<===> max/input.scss -a {b: lighten(red, 100%)} - -<===> max/output.css -a { - b: white; -} - -<===> -================================================================================ -<===> max_remaining/input.scss -a {b: lighten(red, 50%)} - -<===> max_remaining/output.css -a { - b: white; -} - -<===> -================================================================================ -<===> min/input.scss -a {b: lighten(red, 0%)} - -<===> min/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> middle/input.scss -a {b: lighten(red, 14%)} - -<===> middle/output.css -a { - b: #ff4747; -} - -<===> -================================================================================ -<===> fraction/input.scss -a {b: lighten(red, 0.5%)} - -<===> fraction/output.css -a { - b: #ff0303; -} - -<===> -================================================================================ -<===> alpha/input.scss -a {b: lighten(rgba(red, 0.4), 100%)} - -<===> alpha/output.css -a { - b: rgba(255, 255, 255, 0.4); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: lighten($color: red, $amount: 14%)} - -<===> named/output.css -a { - b: #ff4747; -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: lighten(red)} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: lighten(red)} - | ^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function lighten($color, $amount) { - | ======================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: lighten(red, 1%, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: lighten(red, 1%, 2)} - | ^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function lighten($color, $amount) { - | ======================== declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/color/input.scss -a {b: lighten(1, 2)} - -<===> error/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: lighten(1, 2)} - | ^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/type/lightness/input.scss -a {b: lighten(red, blue)} - -<===> error/type/lightness/error -Error: $amount: blue is not a number. - , -1 | a {b: lighten(red, blue)} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_low/input.scss -a {b: lighten(red, -0.001)} - -<===> error/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: lighten(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/bounds/too_high/input.scss -a {b: lighten(red, 100.001)} - -<===> error/bounds/too_high/error -Error: $amount: Expected 100.001 to be within 0 and 100. - , -1 | a {b: lighten(red, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/lightness.hrx b/spec/core_functions/color/lightness.hrx index 54f2a4eb5e..a56f66e61b 100644 --- a/spec/core_functions/color/lightness.hrx +++ b/spec/core_functions/color/lightness.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: lightness(hsl(0, 100%, 100%))} +@use "sass:color"; +a {b: color.lightness(hsl(0, 100%, 100%))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: lightness(hsl(0, 100%, 0%))} +@use "sass:color"; +a {b: color.lightness(hsl(0, 100%, 0%))} <===> min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: lightness(hsl(0, 100%, 50%))} +@use "sass:color"; +a {b: color.lightness(hsl(0, 100%, 50%))} <===> middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> fraction/input.scss -a {b: lightness(hsl(0, 100%, 0.5%))} +@use "sass:color"; +a {b: color.lightness(hsl(0, 100%, 0.5%))} <===> fraction/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: lightness($color: hsl(0, 100%, 42%))} +@use "sass:color"; +a {b: color.lightness($color: hsl(0, 100%, 42%))} <===> named/output.css a { @@ -49,46 +54,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: lightness()} +@use "sass:color"; +a {b: color.lightness()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: lightness()} - | ^^^^^^^^^^^ invocation +2 | a {b: color.lightness()} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function lightness($color) { | ================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: lightness(red, green)} +@use "sass:color"; +a {b: color.lightness(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: lightness(red, green)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.lightness(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function lightness($color) { | ================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: lightness(1)} +@use "sass:color"; +a {b: color.lightness(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: lightness(1)} - | ^^^^^^^^^^^^ +2 | a {b: color.lightness(1)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/mix.hrx b/spec/core_functions/color/mix.hrx index d1a12a05a8..d52ad609ed 100644 --- a/spec/core_functions/color/mix.hrx +++ b/spec/core_functions/color/mix.hrx @@ -1,6 +1,7 @@ <===> unweighted/min_and_max/input.scss +@use "sass:color"; // Each channel becomes the average of 255 and 0, which is 128 = 0xAA. -a {b: mix(#ff00ff, #00ff00)} +a {b: color.mix(#ff00ff, #00ff00)} <===> unweighted/min_and_max/output.css a { @@ -10,8 +11,9 @@ a { <===> ================================================================================ <===> unweighted/identical/input.scss +@use "sass:color"; // If two channels have the same values, they should be the same in the output. -a {b: mix(#123456, #123456)} +a {b: color.mix(#123456, #123456)} <===> unweighted/identical/output.css a { @@ -21,8 +23,9 @@ a { <===> ================================================================================ <===> unweighted/average/input.scss +@use "sass:color"; // All channels should be averaged across the two colors. -a {b: mix(#91e16f, #0144bf)} +a {b: color.mix(#91e16f, #0144bf)} <===> unweighted/average/output.css a { @@ -32,7 +35,8 @@ a { <===> ================================================================================ <===> explicit_weight/even/input.scss -a {b: mix(#91e16f, #0144bf, 50%)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 50%)} <===> explicit_weight/even/output.css a { @@ -42,7 +46,8 @@ a { <===> ================================================================================ <===> explicit_weight/first/input.scss -a {b: mix(#91e16f, #0144bf, 100%)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 100%)} <===> explicit_weight/first/output.css a { @@ -52,7 +57,8 @@ a { <===> ================================================================================ <===> explicit_weight/last/input.scss -a {b: mix(#91e16f, #0144bf, 0%)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 0%)} <===> explicit_weight/last/output.css a { @@ -62,7 +68,8 @@ a { <===> ================================================================================ <===> explicit_weight/firstwards/input.scss -a {b: mix(#91e16f, #0144bf, 92%)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 92%)} <===> explicit_weight/firstwards/output.css a { @@ -72,7 +79,8 @@ a { <===> ================================================================================ <===> explicit_weight/lastwards/input.scss -a {b: mix(#91e16f, #0144bf, 43%)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 43%)} <===> explicit_weight/lastwards/output.css a { @@ -82,7 +90,8 @@ a { <===> ================================================================================ <===> alpha/even/input.scss -a {b: mix(rgba(#91e16f, 0.3), rgba(#0144bf, 0.3))} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.3), rgba(#0144bf, 0.3))} <===> alpha/even/output.css a { @@ -92,7 +101,8 @@ a { <===> ================================================================================ <===> alpha/first/input.scss -a {b: mix(#91e16f, transparent)} +@use "sass:color"; +a {b: color.mix(#91e16f, transparent)} <===> alpha/first/output.css a { @@ -102,7 +112,8 @@ a { <===> ================================================================================ <===> alpha/last/input.scss -a {b: mix(transparent, #0144bf)} +@use "sass:color"; +a {b: color.mix(transparent, #0144bf)} <===> alpha/last/output.css a { @@ -112,7 +123,8 @@ a { <===> ================================================================================ <===> alpha/firstwards/input.scss -a {b: mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3))} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3))} <===> alpha/firstwards/output.css a { @@ -122,7 +134,8 @@ a { <===> ================================================================================ <===> alpha/lastwards/input.scss -a {b: mix(rgba(#91e16f, 0.4), rgba(#0144bf, 0.9))} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.4), rgba(#0144bf, 0.9))} <===> alpha/lastwards/output.css a { @@ -132,7 +145,8 @@ a { <===> ================================================================================ <===> both_weights/transparent/first/input.scss -a {b: mix(transparent, #0144bf, 70%)} +@use "sass:color"; +a {b: color.mix(transparent, #0144bf, 70%)} <===> both_weights/transparent/first/output.css a { @@ -142,7 +156,8 @@ a { <===> ================================================================================ <===> both_weights/transparent/last/input.scss -a {b: mix(#91e16f, transparent, 70%)} +@use "sass:color"; +a {b: color.mix(#91e16f, transparent, 70%)} <===> both_weights/transparent/last/output.css a { @@ -152,7 +167,8 @@ a { <===> ================================================================================ <===> both_weights/weighted/first/input.scss -a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 100%)} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 100%)} <===> both_weights/weighted/first/output.css a { @@ -162,7 +178,8 @@ a { <===> ================================================================================ <===> both_weights/weighted/last/input.scss -a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 0%)} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 0%)} <===> both_weights/weighted/last/output.css a { @@ -172,7 +189,8 @@ a { <===> ================================================================================ <===> both_weights/mixed/firstwards/input.scss -a {b: mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3), 63%)} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.8), rgba(#0144bf, 0.3), 63%)} <===> both_weights/mixed/firstwards/output.css a { @@ -182,7 +200,8 @@ a { <===> ================================================================================ <===> both_weights/mixed/lastwards/input.scss -a {b: mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 42%)} +@use "sass:color"; +a {b: color.mix(rgba(#91e16f, 0.2), rgba(#0144bf, 0.7), 42%)} <===> both_weights/mixed/lastwards/output.css a { @@ -192,10 +211,11 @@ a { <===> ================================================================================ <===> both_weights/contradiction/input.scss +@use "sass:color"; // When we weight entirely towards a transparent color, the formula for // computing the combined alpha would divide by zero, so we just return // transparent as a special case. -a {b: mix(transparent, #0144bf, 100%)} +a {b: color.mix(transparent, #0144bf, 100%)} <===> both_weights/contradiction/output.css a { @@ -205,7 +225,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: mix($color1: #91e16f, $color2: #0144bf, $weight: 92%)} +@use "sass:color"; +a {b: color.mix($color1: #91e16f, $color2: #0144bf, $weight: 92%)} <===> named/output.css a { @@ -215,7 +236,8 @@ a { <===> ================================================================================ <===> units/weight/unitless/input.scss -a {b: mix(#91e16f, #0144bf, 50)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 50)} <===> units/weight/unitless/output.css a { @@ -230,15 +252,16 @@ To preserve current behavior: $weight * 1% More info: https://sass-lang.com/d/function-units , -1 | a {b: mix(#91e16f, #0144bf, 50)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.mix(#91e16f, #0144bf, 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> units/weight/unknown/input.scss -a {b: mix(#91e16f, #0144bf, 50px)} +@use "sass:color"; +a {b: color.mix(#91e16f, #0144bf, 50px)} <===> units/weight/unknown/output.css a { @@ -253,106 +276,113 @@ To preserve current behavior: calc($weight / 1px * 1%) More info: https://sass-lang.com/d/function-units , -1 | a {b: mix(#91e16f, #0144bf, 50px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.mix(#91e16f, #0144bf, 50px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: mix(red, blue, 100, 1)} +@use "sass:color"; +a {b: color.mix(red, blue, 100, 1)} <===> error/too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: mix(red, blue, 100, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.mix(red, blue, 100, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function mix($color1, $color2, $weight: 50%) { | =================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: mix(red)} +@use "sass:color"; +a {b: color.mix(red)} <===> error/too_few_args/error Error: Missing argument $color2. ,--> input.scss -1 | a {b: mix(red)} - | ^^^^^^^^ invocation +2 | a {b: color.mix(red)} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function mix($color1, $color2, $weight: 50%) { | =================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/color1/input.scss -a {b: mix(1, blue)} +@use "sass:color"; +a {b: color.mix(1, blue)} <===> error/type/color1/error Error: $color1: 1 is not a color. , -1 | a {b: mix(1, blue)} - | ^^^^^^^^^^^^ +2 | a {b: color.mix(1, blue)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/color2/input.scss -a {b: mix(red, 1)} +@use "sass:color"; +a {b: color.mix(red, 1)} <===> error/type/color2/error Error: $color2: 1 is not a color. , -1 | a {b: mix(red, 1)} - | ^^^^^^^^^^^ +2 | a {b: color.mix(red, 1)} + | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/weight/input.scss -a {b: mix(red, blue, green)} +@use "sass:color"; +a {b: color.mix(red, blue, green)} <===> error/type/weight/error Error: $weight: green is not a number. , -1 | a {b: mix(red, blue, green)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.mix(red, blue, green)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/bounds/too_low/input.scss -a {b: mix(red, blue, -0.001%)} +@use "sass:color"; +a {b: color.mix(red, blue, -0.001%)} <===> error/bounds/too_low/error Error: $weight: Expected -0.001% to be within 0% and 100%. , -1 | a {b: mix(red, blue, -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.mix(red, blue, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/bounds/too_high/input.scss -a {b: mix(red, blue, 100.001%)} +@use "sass:color"; +a {b: color.mix(red, blue, 100.001%)} <===> error/bounds/too_high/error Error: $weight: Expected 100.001% to be within 0% and 100%. , -1 | a {b: mix(red, blue, 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: color.mix(red, blue, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/red.hrx b/spec/core_functions/color/red.hrx index a4c7be4433..21ac8a4d08 100644 --- a/spec/core_functions/color/red.hrx +++ b/spec/core_functions/color/red.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: red(rgb(255, 0, 0))} +@use "sass:color"; +a {b: color.red(rgb(255, 0, 0))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: red(rgb(0, 0, 0))} +@use "sass:color"; +a {b: color.red(rgb(0, 0, 0))} <===> min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: red(rgb(123, 0, 0))} +@use "sass:color"; +a {b: color.red(rgb(123, 0, 0))} <===> middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: red($color: rgb(234, 0, 0))} +@use "sass:color"; +a {b: color.red($color: rgb(234, 0, 0))} <===> named/output.css a { @@ -39,46 +43,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: red()} +@use "sass:color"; +a {b: color.red()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: red()} - | ^^^^^ invocation +2 | a {b: color.red()} + | ^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function red($color) { | =========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: red(red, green)} +@use "sass:color"; +a {b: color.red(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: red(red, green)} - | ^^^^^^^^^^^^^^^ invocation +2 | a {b: color.red(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function red($color) { | =========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: red(1)} +@use "sass:color"; +a {b: color.red(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: red(1)} - | ^^^^^^ +2 | a {b: color.red(1)} + | ^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/rgb/error/one_arg.hrx b/spec/core_functions/color/rgb/error/one_arg.hrx index 02053c6e34..f257795f65 100644 --- a/spec/core_functions/color/rgb/error/one_arg.hrx +++ b/spec/core_functions/color/rgb/error/one_arg.hrx @@ -149,15 +149,16 @@ Error: $blue: "var(--foo) / 0.4" is not a number. <===> ================================================================================ <===> slash_list/too_few_elements/input.scss -a {b: rgb(append((), 1 2 3, $separator: slash))} +@use "sass:list"; +a {b: rgb(list.append((), 1 2 3, $separator: slash))} <===> slash_list/too_few_elements/error Error: Only 2 slash-separated elements allowed, but 1 was passed. , -1 | a {b: rgb(append((), 1 2 3, $separator: slash))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: rgb(list.append((), 1 2 3, $separator: slash))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ diff --git a/spec/core_functions/color/rgb/four_args/special_functions.hrx b/spec/core_functions/color/rgb/four_args/special_functions.hrx index e472d64b5e..96ff01f4c4 100644 --- a/spec/core_functions/color/rgb/four_args/special_functions.hrx +++ b/spec/core_functions/color/rgb/four_args/special_functions.hrx @@ -5,7 +5,8 @@ <===> ================================================================================ <===> calc/string/arg_1/input.scss -a {b: rgb(unquote("calc(1)"), 2, 3, 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("calc(1)"), 2, 3, 0.4)} <===> calc/string/arg_1/output.css a { @@ -15,7 +16,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: rgb(1, unquote("calc(2)"), 3, 0.4)} +@use "sass:string"; +a {b: rgb(1, string.unquote("calc(2)"), 3, 0.4)} <===> calc/string/arg_2/output.css a { @@ -25,7 +27,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("calc(3)"), 0.4)} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("calc(3)"), 0.4)} <===> calc/string/arg_3/output.css a { @@ -35,7 +38,8 @@ a { <===> ================================================================================ <===> calc/string/arg_4/input.scss -a {b: rgb(1, 2, 3, unquote("calc(0.4)"))} +@use "sass:string"; +a {b: rgb(1, 2, 3, string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { @@ -165,7 +169,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: rgb(unquote("min(1)"), 2, 3, 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("min(1)"), 2, 3, 0.4)} <===> min/string/arg_1/output.css a { @@ -175,7 +180,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: rgb(1, unquote("min(2)"), 3, 0.4)} +@use "sass:string"; +a {b: rgb(1, string.unquote("min(2)"), 3, 0.4)} <===> min/string/arg_2/output.css a { @@ -185,7 +191,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("min(3)"), 0.4)} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("min(3)"), 0.4)} <===> min/string/arg_3/output.css a { @@ -195,7 +202,8 @@ a { <===> ================================================================================ <===> min/string/arg_4/input.scss -a {b: rgb(1, 2, 3, unquote("min(0.4)"))} +@use "sass:string"; +a {b: rgb(1, 2, 3, string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { @@ -205,7 +213,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: rgb(unquote("max(1)"), 2, 3, 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("max(1)"), 2, 3, 0.4)} <===> max/string/arg_1/output.css a { @@ -215,7 +224,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: rgb(1, unquote("max(2)"), 3, 0.4)} +@use "sass:string"; +a {b: rgb(1, string.unquote("max(2)"), 3, 0.4)} <===> max/string/arg_2/output.css a { @@ -225,7 +235,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("max(3)"), 0.4)} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("max(3)"), 0.4)} <===> max/string/arg_3/output.css a { @@ -235,7 +246,8 @@ a { <===> ================================================================================ <===> max/string/arg_4/input.scss -a {b: rgb(1, 2, 3, unquote("max(0.4)"))} +@use "sass:string"; +a {b: rgb(1, 2, 3, string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { @@ -245,7 +257,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: rgb(unquote("clamp(1, 2, 3)"), 2, 3, 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("clamp(1, 2, 3)"), 2, 3, 0.4)} <===> clamp/string/arg_1/output.css a { @@ -255,7 +268,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: rgb(1, unquote("clamp(2, 3, 4)"), 3, 0.4)} +@use "sass:string"; +a {b: rgb(1, string.unquote("clamp(2, 3, 4)"), 3, 0.4)} <===> clamp/string/arg_2/output.css a { @@ -265,7 +279,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("clamp(3, 4, 5)"), 0.4)} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("clamp(3, 4, 5)"), 0.4)} <===> clamp/string/arg_3/output.css a { @@ -275,7 +290,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_4/input.scss -a {b: rgb(1, 2, 3, unquote("clamp(0.4, 0.5, 0.6)"))} +@use "sass:string"; +a {b: rgb(1, 2, 3, string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { diff --git a/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx b/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx index e9f7576483..5624967010 100644 --- a/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/special_functions/alpha.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: rgb(unquote("calc(1)") 2 3 / 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("calc(1)") 2 3 / 0.4)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: rgb(1 unquote("calc(2)") 3 / 0.4)} +@use "sass:string"; +a {b: rgb(1 string.unquote("calc(2)") 3 / 0.4)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: rgb(1 2 unquote("calc(3)") / 0.4)} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("calc(3)") / 0.4)} <===> calc/string/arg_3/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> calc/string/arg_4/input.scss -a {b: rgb(1 2 3 / unquote("calc(0.4)"))} +@use "sass:string"; +a {b: rgb(1 2 3 / string.unquote("calc(0.4)"))} <===> calc/string/arg_4/output.css a { @@ -159,7 +163,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: rgb(unquote("min(1)") 2 3 / 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("min(1)") 2 3 / 0.4)} <===> min/string/arg_1/output.css a { @@ -169,7 +174,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: rgb(1 unquote("min(2)") 3 / 0.4)} +@use "sass:string"; +a {b: rgb(1 string.unquote("min(2)") 3 / 0.4)} <===> min/string/arg_2/output.css a { @@ -179,7 +185,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: rgb(1 2 unquote("min(3)") / 0.4)} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("min(3)") / 0.4)} <===> min/string/arg_3/output.css a { @@ -189,7 +196,8 @@ a { <===> ================================================================================ <===> min/string/arg_4/input.scss -a {b: rgb(1 2 3 / unquote("min(0.4)"))} +@use "sass:string"; +a {b: rgb(1 2 3 / string.unquote("min(0.4)"))} <===> min/string/arg_4/output.css a { @@ -199,7 +207,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: rgb(unquote("max(1)") 2 3 / 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("max(1)") 2 3 / 0.4)} <===> max/string/arg_1/output.css a { @@ -209,7 +218,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: rgb(1 unquote("max(2)") 3 / 0.4)} +@use "sass:string"; +a {b: rgb(1 string.unquote("max(2)") 3 / 0.4)} <===> max/string/arg_2/output.css a { @@ -219,7 +229,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: rgb(1 2 unquote("max(3)") / 0.4)} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("max(3)") / 0.4)} <===> max/string/arg_3/output.css a { @@ -229,7 +240,8 @@ a { <===> ================================================================================ <===> max/string/arg_4/input.scss -a {b: rgb(1 2 3 / unquote("max(0.4)"))} +@use "sass:string"; +a {b: rgb(1 2 3 / string.unquote("max(0.4)"))} <===> max/string/arg_4/output.css a { @@ -239,7 +251,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: rgb(unquote("clamp(1, 2, 3)") 2 3 / 0.4)} +@use "sass:string"; +a {b: rgb(string.unquote("clamp(1, 2, 3)") 2 3 / 0.4)} <===> clamp/string/arg_1/output.css a { @@ -249,7 +262,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: rgb(1 unquote("clamp(2, 3, 4)") 3 / 0.4)} +@use "sass:string"; +a {b: rgb(1 string.unquote("clamp(2, 3, 4)") 3 / 0.4)} <===> clamp/string/arg_2/output.css a { @@ -259,7 +273,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: rgb(1 2 unquote("clamp(3, 4, 5)") / 0.4)} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("clamp(3, 4, 5)") / 0.4)} <===> clamp/string/arg_3/output.css a { @@ -269,7 +284,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_4/input.scss -a {b: rgb(1 2 3 / unquote("clamp(0.4, 0.5, 0.6)"))} +@use "sass:string"; +a {b: rgb(1 2 3 / string.unquote("clamp(0.4, 0.5, 0.6)"))} <===> clamp/string/arg_4/output.css a { diff --git a/spec/core_functions/color/rgb/one_arg/special_functions/no_alpha.hrx b/spec/core_functions/color/rgb/one_arg/special_functions/no_alpha.hrx index 3b368eb732..8e63f92376 100644 --- a/spec/core_functions/color/rgb/one_arg/special_functions/no_alpha.hrx +++ b/spec/core_functions/color/rgb/one_arg/special_functions/no_alpha.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: rgb(unquote("calc(1)") 2 3)} +@use "sass:string"; +a {b: rgb(string.unquote("calc(1)") 2 3)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: rgb(1 unquote("calc(2)") 3)} +@use "sass:string"; +a {b: rgb(1 string.unquote("calc(2)") 3)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: rgb(1 2 unquote("calc(3)"))} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("calc(3)"))} <===> calc/string/arg_3/output.css a { @@ -119,7 +122,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: rgb(unquote("min(1)") 2 3)} +@use "sass:string"; +a {b: rgb(string.unquote("min(1)") 2 3)} <===> min/string/arg_1/output.css a { @@ -129,7 +133,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: rgb(1 unquote("min(2)") 3)} +@use "sass:string"; +a {b: rgb(1 string.unquote("min(2)") 3)} <===> min/string/arg_2/output.css a { @@ -139,7 +144,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: rgb(1 2 unquote("min(3)"))} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("min(3)"))} <===> min/string/arg_3/output.css a { @@ -149,7 +155,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: rgb(unquote("max(1)") 2 3)} +@use "sass:string"; +a {b: rgb(string.unquote("max(1)") 2 3)} <===> max/string/arg_1/output.css a { @@ -159,7 +166,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: rgb(1 unquote("max(2)") 3)} +@use "sass:string"; +a {b: rgb(1 string.unquote("max(2)") 3)} <===> max/string/arg_2/output.css a { @@ -169,7 +177,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: rgb(1 2 unquote("max(3)"))} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("max(3)"))} <===> max/string/arg_3/output.css a { @@ -179,7 +188,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: rgb(unquote("clamp(1, 2, 3)") 2 3)} +@use "sass:string"; +a {b: rgb(string.unquote("clamp(1, 2, 3)") 2 3)} <===> clamp/string/arg_1/output.css a { @@ -189,7 +199,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: rgb(1 unquote("clamp(2, 3, 4)") 3)} +@use "sass:string"; +a {b: rgb(1 string.unquote("clamp(2, 3, 4)") 3)} <===> clamp/string/arg_2/output.css a { @@ -199,7 +210,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: rgb(1 2 unquote("clamp(3, 4, 5)"))} +@use "sass:string"; +a {b: rgb(1 2 string.unquote("clamp(3, 4, 5)"))} <===> clamp/string/arg_3/output.css a { diff --git a/spec/core_functions/color/rgb/three_args/special_functions.hrx b/spec/core_functions/color/rgb/three_args/special_functions.hrx index e812e5b892..eaad972edd 100644 --- a/spec/core_functions/color/rgb/three_args/special_functions.hrx +++ b/spec/core_functions/color/rgb/three_args/special_functions.hrx @@ -1,5 +1,6 @@ <===> calc/string/arg_1/input.scss -a {b: rgb(unquote("calc(1)"), 2, 3)} +@use "sass:string"; +a {b: rgb(string.unquote("calc(1)"), 2, 3)} <===> calc/string/arg_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> calc/string/arg_2/input.scss -a {b: rgb(1, unquote("calc(2)"), 3)} +@use "sass:string"; +a {b: rgb(1, string.unquote("calc(2)"), 3)} <===> calc/string/arg_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> calc/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("calc(3)"))} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("calc(3)"))} <===> calc/string/arg_3/output.css a { @@ -89,7 +92,8 @@ a { <===> ================================================================================ <===> min/string/arg_1/input.scss -a {b: rgb(unquote("min(1)"), 2, 3)} +@use "sass:string"; +a {b: rgb(string.unquote("min(1)"), 2, 3)} <===> min/string/arg_1/output.css a { @@ -99,7 +103,8 @@ a { <===> ================================================================================ <===> min/string/arg_2/input.scss -a {b: rgb(1, unquote("min(2)"), 3)} +@use "sass:string"; +a {b: rgb(1, string.unquote("min(2)"), 3)} <===> min/string/arg_2/output.css a { @@ -109,7 +114,8 @@ a { <===> ================================================================================ <===> min/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("min(3)"))} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("min(3)"))} <===> min/string/arg_3/output.css a { @@ -119,7 +125,8 @@ a { <===> ================================================================================ <===> max/string/arg_1/input.scss -a {b: rgb(unquote("max(1)"), 2, 3)} +@use "sass:string"; +a {b: rgb(string.unquote("max(1)"), 2, 3)} <===> max/string/arg_1/output.css a { @@ -129,7 +136,8 @@ a { <===> ================================================================================ <===> max/string/arg_2/input.scss -a {b: rgb(1, unquote("max(2)"), 3)} +@use "sass:string"; +a {b: rgb(1, string.unquote("max(2)"), 3)} <===> max/string/arg_2/output.css a { @@ -139,7 +147,8 @@ a { <===> ================================================================================ <===> max/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("max(3)"))} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("max(3)"))} <===> max/string/arg_3/output.css a { @@ -149,7 +158,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_1/input.scss -a {b: rgb(unquote("clamp(1, 2, 3)"), 2, 3)} +@use "sass:string"; +a {b: rgb(string.unquote("clamp(1, 2, 3)"), 2, 3)} <===> clamp/string/arg_1/output.css a { @@ -159,7 +169,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_2/input.scss -a {b: rgb(1, unquote("clamp(2, 3, 4)"), 3)} +@use "sass:string"; +a {b: rgb(1, string.unquote("clamp(2, 3, 4)"), 3)} <===> clamp/string/arg_2/output.css a { @@ -169,7 +180,8 @@ a { <===> ================================================================================ <===> clamp/string/arg_3/input.scss -a {b: rgb(1, 2, unquote("clamp(3, 4, 5)"))} +@use "sass:string"; +a {b: rgb(1, 2, string.unquote("clamp(3, 4, 5)"))} <===> clamp/string/arg_3/output.css a { diff --git a/spec/core_functions/color/rgb/two_args.hrx b/spec/core_functions/color/rgb/two_args.hrx index 02fd645aa7..ee22380389 100644 --- a/spec/core_functions/color/rgb/two_args.hrx +++ b/spec/core_functions/color/rgb/two_args.hrx @@ -119,7 +119,8 @@ a { <===> ================================================================================ <===> special_functions/calc/string/arg_2/input.scss -a {b: rgb(blue, unquote("calc(0.4)"))} +@use "sass:string"; +a {b: rgb(blue, string.unquote("calc(0.4)"))} <===> special_functions/calc/string/arg_2/output.css a { diff --git a/spec/core_functions/color/saturate.hrx b/spec/core_functions/color/saturate.hrx index 87841ed452..492c1c842a 100644 --- a/spec/core_functions/color/saturate.hrx +++ b/spec/core_functions/color/saturate.hrx @@ -1,253 +1,76 @@ -<===> one_arg/README.md +<===> css_overload/README.md Sass supports saturate() with one argument for compatibility with [plain CSS][]. [plain CSS]: https://developer.mozilla.org/en-US/docs/Web/CSS/filter-function/saturate <===> ================================================================================ -<===> one_arg/unit/input.scss +<===> css_overload/unit/input.scss a {b: saturate(50%)} -<===> one_arg/unit/output.css +<===> css_overload/unit/output.css a { b: saturate(50%); } <===> ================================================================================ -<===> one_arg/unitless/input.scss +<===> css_overload/unitless/input.scss a {b: saturate(1)} -<===> one_arg/unitless/output.css +<===> css_overload/unitless/output.css a { b: saturate(1); } <===> ================================================================================ -<===> one_arg/with_sass_var/input.scss +<===> css_overload/with_sass_var/input.scss $c: 1; a {b: saturate($c)} -<===> one_arg/with_sass_var/output.css +<===> css_overload/with_sass_var/output.css a { b: saturate(1); } <===> ================================================================================ -<===> one_arg/with_css_var/input.scss +<===> css_overload/with_css_var/input.scss a {b: saturate(var(--c))} -<===> one_arg/with_css_var/output.css +<===> css_overload/with_css_var/output.css a { b: saturate(var(--c)); } <===> ================================================================================ -<===> one_arg/with_calc/input.scss +<===> css_overload/with_calc/input.scss a {b: saturate(calc(1 + 2))} -<===> one_arg/with_calc/output.css +<===> css_overload/with_calc/output.css a { b: saturate(3); } <===> ================================================================================ -<===> one_arg/with_unquoted_calc/input.scss -a {b: saturate(unquote('calc(1)'))} +<===> css_overload/with_unquoted_calc/input.scss +@use "sass:string"; +a {b: saturate(string.unquote('calc(1)'))} -<===> one_arg/with_unquoted_calc/output.css +<===> css_overload/with_unquoted_calc/output.css a { b: saturate(calc(1)); } <===> ================================================================================ -<===> one_arg/named/input.scss +<===> css_overload/named/input.scss a {b: saturate($amount: 50%)} -<===> one_arg/named/output.css +<===> css_overload/named/output.css a { b: saturate(50%); } - -<===> -================================================================================ -<===> two_args/max/input.scss -a {b: saturate(plum, 100%)} - -<===> two_args/max/output.css -a { - b: #ff7eff; -} - -<===> -================================================================================ -<===> two_args/max_remaining/input.scss -a {b: saturate(plum, 53%)} - -<===> two_args/max_remaining/output.css -a { - b: #ff7eff; -} - -<===> -================================================================================ -<===> two_args/min/input.scss -a {b: saturate(plum, 0%)} - -<===> two_args/min/output.css -a { - b: plum; -} - -<===> -================================================================================ -<===> two_args/middle/input.scss -a {b: saturate(plum, 14%)} - -<===> two_args/middle/output.css -a { - b: #e697e6; -} - -<===> -================================================================================ -<===> two_args/alpha/input.scss -a {b: saturate(rgba(plum, 0.5), 100%)} - -<===> two_args/alpha/output.css -a { - b: rgba(255, 126, 255, 0.5); -} - -<===> -================================================================================ -<===> two_args/named/input.scss -a {b: saturate($color: plum, $amount: 14%)} - -<===> two_args/named/output.css -a { - b: #e697e6; -} - -<===> -================================================================================ -<===> error/too_few_args/input.scss -a {b: saturate()} - -<===> error/too_few_args/error -Error: Missing argument $amount. - ,--> input.scss -1 | a {b: saturate()} - | ^^^^^^^^^^ invocation - ' - , -1 | @function saturate($amount) { - | ================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/too_many_args/input.scss -a {b: saturate(plum, 1%, 2)} - -<===> error/too_many_args/error -Error: Only 2 arguments allowed, but 3 were passed. - ,--> input.scss -1 | a {b: saturate(plum, 1%, 2)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation - ' - , -1 | @function saturate($color, $amount) { - | ========================= declaration - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/one_arg/type/input.scss -a {b: saturate(red)} - -<===> error/one_arg/type/error -Error: $amount: red is not a number. - , -1 | a {b: saturate(red)} - | ^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - - -<===> -================================================================================ -<===> error/with_module/one_arg/type/input.scss -@use 'sass:color'; -a {b: color.saturate(var(--c))} - -<===> error/with_module/one_arg/type/error -Error: Missing argument $amount. - ,--> input.scss -2 | a {b: color.saturate(var(--c))} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation - ' - ,--> sass:color -1 | @function saturate($color, $amount) { - | ========================= declaration - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/two_args/type/color/input.scss -a {b: saturate(1, 2)} - -<===> error/two_args/type/color/error -Error: $color: 1 is not a color. - , -1 | a {b: saturate(1, 2)} - | ^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/two_args/type/lightness/input.scss -a {b: saturate(plum, blue)} - -<===> error/two_args/type/lightness/error -Error: $amount: blue is not a number. - , -1 | a {b: saturate(plum, blue)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/two_args/bounds/too_low/input.scss -a {b: saturate(plum, -0.001)} - -<===> error/two_args/bounds/too_low/error -Error: $amount: Expected -0.001 to be within 0 and 100. - , -1 | a {b: saturate(plum, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/two_args/bounds/too_high/input.scss -a {b: saturate(plum, 100.001)} - -<===> error/two_args/bounds/too_high/error -Error: $amount: Expected 100.001 to be within 0 and 100. - , -1 | a {b: saturate(plum, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/saturation.hrx b/spec/core_functions/color/saturation.hrx index ed8fde80ad..abe94b95f1 100644 --- a/spec/core_functions/color/saturation.hrx +++ b/spec/core_functions/color/saturation.hrx @@ -1,5 +1,6 @@ <===> max/input.scss -a {b: saturation(hsl(0, 100%, 50%))} +@use "sass:color"; +a {b: color.saturation(hsl(0, 100%, 50%))} <===> max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> min/input.scss -a {b: saturation(hsl(0, 0%, 50%))} +@use "sass:color"; +a {b: color.saturation(hsl(0, 0%, 50%))} <===> min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: saturation(hsl(0, 50%, 50%))} +@use "sass:color"; +a {b: color.saturation(hsl(0, 50%, 50%))} <===> middle/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> fraction/input.scss -a {b: saturation(hsl(0, 0.5%, 50%))} +@use "sass:color"; +a {b: color.saturation(hsl(0, 0.5%, 50%))} <===> fraction/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: saturation($color: hsl(0, 42%, 50%))} +@use "sass:color"; +a {b: color.saturation($color: hsl(0, 42%, 50%))} <===> named/output.css a { @@ -49,46 +54,49 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: saturation()} +@use "sass:color"; +a {b: color.saturation()} <===> error/too_few_args/error Error: Missing argument $color. ,--> input.scss -1 | a {b: saturation()} - | ^^^^^^^^^^^^ invocation +2 | a {b: color.saturation()} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function saturation($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: saturation(red, green)} +@use "sass:color"; +a {b: color.saturation(red, green)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: saturation(red, green)} - | ^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: color.saturation(red, green)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function saturation($color) { | ================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: saturation(1)} +@use "sass:color"; +a {b: color.saturation(1)} <===> error/type/error Error: $color: 1 is not a color. , -1 | a {b: saturation(1)} - | ^^^^^^^^^^^^^ +2 | a {b: color.saturation(1)} + | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/args.hrx b/spec/core_functions/color/scale_color/error/args.hrx index ed538796c5..2b844dc62f 100644 --- a/spec/core_functions/color/scale_color/error/args.hrx +++ b/spec/core_functions/color/scale_color/error/args.hrx @@ -1,40 +1,58 @@ <===> too_few/input.scss -a {b: scale-color()} +@use "sass:color"; +a {b: color.scale()} <===> too_few/error Error: Missing argument $color. ,--> input.scss -1 | a {b: scale-color()} +2 | a {b: color.scale()} | ^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function scale($color, $kwargs...) { | ========================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many/input.scss -a {b: scale-color(red, 1)} +@use "sass:color"; +a {b: color.scale(red, 1)} <===> too_many/error Error: Only one positional argument is allowed. All other arguments must be passed by name. , -1 | a {b: scale-color(red, 1)} +2 | a {b: color.scale(red, 1)} | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unknown/input.scss -a {b: scale-color(red, $hue: 10%)} +@use "sass:color"; +a {b: color.scale(red, $hue: 10%)} <===> unknown/error Error: No argument named $hue. , -1 | a {b: scale-color(red, $hue: 10%)} +2 | a {b: color.scale(red, $hue: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:color"; +a {b: color.scale-color(#abcdef, $red: 10%)} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: color.scale-color(#abcdef, $red: 10%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + diff --git a/spec/core_functions/color/scale_color/error/bounds.hrx b/spec/core_functions/color/scale_color/error/bounds.hrx index f43a45eee9..a4b001d642 100644 --- a/spec/core_functions/color/scale_color/error/bounds.hrx +++ b/spec/core_functions/color/scale_color/error/bounds.hrx @@ -1,206 +1,221 @@ <===> red/too_low/input.scss -a {b: scale-color(red, $red: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $red: -100.001%)} <===> red/too_low/error Error: $red: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $red: -100.001%)} +2 | a {b: color.scale(red, $red: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/too_high/input.scss -a {b: scale-color(red, $red: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $red: 100.001%)} <===> red/too_high/error Error: $red: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $red: 100.001%)} +2 | a {b: color.scale(red, $red: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/too_low/input.scss -a {b: scale-color(green, $green: -100.001%)} +@use "sass:color"; +a {b: color.scale(green, $green: -100.001%)} <===> green/too_low/error Error: $green: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(green, $green: -100.001%)} +2 | a {b: color.scale(green, $green: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/too_high/input.scss -a {b: scale-color(green, $green: 100.001%)} +@use "sass:color"; +a {b: color.scale(green, $green: 100.001%)} <===> green/too_high/error Error: $green: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(green, $green: 100.001%)} +2 | a {b: color.scale(green, $green: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/too_low/input.scss -a {b: scale-color(blue, $blue: -100.001%)} +@use "sass:color"; +a {b: color.scale(blue, $blue: -100.001%)} <===> blue/too_low/error Error: $blue: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(blue, $blue: -100.001%)} +2 | a {b: color.scale(blue, $blue: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/too_high/input.scss -a {b: scale-color(blue, $blue: 100.001%)} +@use "sass:color"; +a {b: color.scale(blue, $blue: 100.001%)} <===> blue/too_high/error Error: $blue: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(blue, $blue: 100.001%)} +2 | a {b: color.scale(blue, $blue: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/too_low/input.scss -a {b: scale-color(red, $saturation: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $saturation: -100.001%)} <===> saturation/too_low/error Error: $saturation: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $saturation: -100.001%)} +2 | a {b: color.scale(red, $saturation: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/too_high/input.scss -a {b: scale-color(red, $saturation: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $saturation: 100.001%)} <===> saturation/too_high/error Error: $saturation: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $saturation: 100.001%)} +2 | a {b: color.scale(red, $saturation: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/too_low/input.scss -a {b: scale-color(red, $lightness: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: -100.001%)} <===> lightness/too_low/error Error: $lightness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $lightness: -100.001%)} +2 | a {b: color.scale(red, $lightness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/too_high/input.scss -a {b: scale-color(red, $lightness: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 100.001%)} <===> lightness/too_high/error Error: $lightness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $lightness: 100.001%)} +2 | a {b: color.scale(red, $lightness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/too_low/input.scss -a {b: scale-color(red, $alpha: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $alpha: -100.001%)} <===> alpha/too_low/error Error: $alpha: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $alpha: -100.001%)} +2 | a {b: color.scale(red, $alpha: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/too_high/input.scss -a {b: scale-color(red, $alpha: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $alpha: 100.001%)} <===> alpha/too_high/error Error: $alpha: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $alpha: 100.001%)} +2 | a {b: color.scale(red, $alpha: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/too_low/input.scss -a {b: scale-color(red, $blackness: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $blackness: -100.001%)} <===> blackness/too_low/error Error: $blackness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $blackness: -100.001%)} +2 | a {b: color.scale(red, $blackness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/too_high/input.scss -a {b: scale-color(red, $blackness: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $blackness: 100.001%)} <===> blackness/too_high/error Error: $blackness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $blackness: 100.001%)} +2 | a {b: color.scale(red, $blackness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_low/input.scss -a {b: scale-color(red, $whiteness: -100.001%)} +@use "sass:color"; +a {b: color.scale(red, $whiteness: -100.001%)} <===> whiteness/too_low/error Error: $whiteness: Expected -100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $whiteness: -100.001%)} +2 | a {b: color.scale(red, $whiteness: -100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/too_high/input.scss -a {b: scale-color(red, $whiteness: 100.001%)} +@use "sass:color"; +a {b: color.scale(red, $whiteness: 100.001%)} <===> whiteness/too_high/error Error: $whiteness: Expected 100.001% to be within -100% and 100%. , -1 | a {b: scale-color(red, $whiteness: 100.001%)} +2 | a {b: color.scale(red, $whiteness: 100.001%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/mixed_formats.hrx b/spec/core_functions/color/scale_color/error/mixed_formats.hrx index bf5b89e820..bce79e9f9c 100644 --- a/spec/core_functions/color/scale_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/scale_color/error/mixed_formats.hrx @@ -1,89 +1,95 @@ <===> red_and_saturation/input.scss -a {b: scale-color(red, $red: 1%, $saturation: 1%)} +@use "sass:color"; +a {b: color.scale(red, $red: 1%, $saturation: 1%)} <===> red_and_saturation/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: scale-color(red, $red: 1%, $saturation: 1%)} +2 | a {b: color.scale(red, $red: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_saturation/input.scss -a {b: scale-color(red, $green: 1%, $saturation: 1%)} +@use "sass:color"; +a {b: color.scale(red, $green: 1%, $saturation: 1%)} <===> green_and_saturation/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: scale-color(red, $green: 1%, $saturation: 1%)} +2 | a {b: color.scale(red, $green: 1%, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue_and_lightness/input.scss -a {b: scale-color(red, $blue: 1%, $lightness: 1%)} +@use "sass:color"; +a {b: color.scale(red, $blue: 1%, $lightness: 1%)} <===> blue_and_lightness/error Error: RGB parameters may not be passed along with HSL parameters. , -1 | a {b: scale-color(red, $blue: 1%, $lightness: 1%)} +2 | a {b: color.scale(red, $blue: 1%, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red_and_blackness/input.scss -a {b: scale-color(red, $red: 1%, $blackness: 1%)} +@use "sass:color"; +a {b: color.scale(red, $red: 1%, $blackness: 1%)} <===> red_and_blackness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: scale-color(red, $red: 1%, $blackness: 1%)} +2 | a {b: color.scale(red, $red: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_whiteness/input.scss -a {b: scale-color(red, $green: 1%, $whiteness: 1%)} +@use "sass:color"; +a {b: color.scale(red, $green: 1%, $whiteness: 1%)} <===> green_and_whiteness/error Error: RGB parameters may not be passed along with HWB parameters. , -1 | a {b: scale-color(red, $green: 1%, $whiteness: 1%)} +2 | a {b: color.scale(red, $green: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation_and_blackness/input.scss -a {b: scale-color(red, $saturation: 1%, $blackness: 1%)} +@use "sass:color"; +a {b: color.scale(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: scale-color(red, $saturation: 1%, $blackness: 1%)} +2 | a {b: color.scale(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness_and_whiteness/input.scss -a {b: scale-color(red, $lightness: 1%, $whiteness: 1%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error Error: HSL parameters may not be passed along with HWB parameters. , -1 | a {b: scale-color(red, $lightness: 1%, $whiteness: 1%)} +2 | a {b: color.scale(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/type.hrx b/spec/core_functions/color/scale_color/error/type.hrx index aa01247e85..43da61715b 100644 --- a/spec/core_functions/color/scale_color/error/type.hrx +++ b/spec/core_functions/color/scale_color/error/type.hrx @@ -1,115 +1,123 @@ <===> color/input.scss -a {b: scale-color(1)} +@use "sass:color"; +a {b: color.scale(1)} <===> color/error Error: $color: 1 is not a color. , -1 | a {b: scale-color(1)} +2 | a {b: color.scale(1)} | ^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/input.scss -a {b: scale-color(red, $red: c)} +@use "sass:color"; +a {b: color.scale(red, $red: c)} <===> red/error Error: $red: c is not a number. , -1 | a {b: scale-color(red, $red: c)} +2 | a {b: color.scale(red, $red: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/input.scss -a {b: scale-color(red, $green: c)} +@use "sass:color"; +a {b: color.scale(red, $green: c)} <===> green/error Error: $green: c is not a number. , -1 | a {b: scale-color(red, $green: c)} +2 | a {b: color.scale(red, $green: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/input.scss -a {b: scale-color(red, $blue: c)} +@use "sass:color"; +a {b: color.scale(red, $blue: c)} <===> blue/error Error: $blue: c is not a number. , -1 | a {b: scale-color(red, $blue: c)} +2 | a {b: color.scale(red, $blue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/input.scss -a {b: scale-color(red, $saturation: c)} +@use "sass:color"; +a {b: color.scale(red, $saturation: c)} <===> saturation/error Error: $saturation: c is not a number. , -1 | a {b: scale-color(red, $saturation: c)} +2 | a {b: color.scale(red, $saturation: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/input.scss -a {b: scale-color(red, $lightness: c)} +@use "sass:color"; +a {b: color.scale(red, $lightness: c)} <===> lightness/error Error: $lightness: c is not a number. , -1 | a {b: scale-color(red, $lightness: c)} +2 | a {b: color.scale(red, $lightness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/input.scss -a {b: scale-color(red, $alpha: c)} +@use "sass:color"; +a {b: color.scale(red, $alpha: c)} <===> alpha/error Error: $alpha: c is not a number. , -1 | a {b: scale-color(red, $alpha: c)} +2 | a {b: color.scale(red, $alpha: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/input.scss -a {b: scale-color(red, $blackness: c)} +@use "sass:color"; +a {b: color.scale(red, $blackness: c)} <===> blackness/error Error: $blackness: c is not a number. , -1 | a {b: scale-color(red, $blackness: c)} +2 | a {b: color.scale(red, $blackness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/input.scss -a {b: scale-color(red, $whiteness: c)} +@use "sass:color"; +a {b: color.scale(red, $whiteness: c)} <===> whiteness/error Error: $whiteness: c is not a number. , -1 | a {b: scale-color(red, $whiteness: c)} +2 | a {b: color.scale(red, $whiteness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/error/units.hrx b/spec/core_functions/color/scale_color/error/units.hrx index 395f26a302..35669fadba 100644 --- a/spec/core_functions/color/scale_color/error/units.hrx +++ b/spec/core_functions/color/scale_color/error/units.hrx @@ -1,206 +1,221 @@ <===> none/red/input.scss -a {b: scale-color(red, $red: 1px)} +@use "sass:color"; +a {b: color.scale(red, $red: 1px)} <===> none/red/error Error: $red: Expected 1px to have unit "%". , -1 | a {b: scale-color(red, $red: 1px)} +2 | a {b: color.scale(red, $red: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/green/input.scss -a {b: scale-color(green, $green: 1)} +@use "sass:color"; +a {b: color.scale(green, $green: 1)} <===> none/green/error Error: $green: Expected 1 to have unit "%". , -1 | a {b: scale-color(green, $green: 1)} +2 | a {b: color.scale(green, $green: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/blue/input.scss -a {b: scale-color(blue, $blue: 1)} +@use "sass:color"; +a {b: color.scale(blue, $blue: 1)} <===> none/blue/error Error: $blue: Expected 1 to have unit "%". , -1 | a {b: scale-color(blue, $blue: 1)} +2 | a {b: color.scale(blue, $blue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/saturation/input.scss -a {b: scale-color(red, $saturation: 1)} +@use "sass:color"; +a {b: color.scale(red, $saturation: 1)} <===> none/saturation/error Error: $saturation: Expected 1 to have unit "%". , -1 | a {b: scale-color(red, $saturation: 1)} +2 | a {b: color.scale(red, $saturation: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/lightness/input.scss -a {b: scale-color(red, $lightness: 1)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 1)} <===> none/lightness/error Error: $lightness: Expected 1 to have unit "%". , -1 | a {b: scale-color(red, $lightness: 1)} +2 | a {b: color.scale(red, $lightness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/whiteness/input.scss -a {b: scale-color(white, $whiteness: 1)} +@use "sass:color"; +a {b: color.scale(white, $whiteness: 1)} <===> none/whiteness/error Error: $whiteness: Expected 1 to have unit "%". , -1 | a {b: scale-color(white, $whiteness: 1)} +2 | a {b: color.scale(white, $whiteness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/blackness/input.scss -a {b: scale-color(black, $blackness: 1)} +@use "sass:color"; +a {b: color.scale(black, $blackness: 1)} <===> none/blackness/error Error: $blackness: Expected 1 to have unit "%". , -1 | a {b: scale-color(black, $blackness: 1)} +2 | a {b: color.scale(black, $blackness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/alpha/input.scss -a {b: scale-color(red, $alpha: 1)} +@use "sass:color"; +a {b: color.scale(red, $alpha: 1)} <===> none/alpha/error Error: $alpha: Expected 1 to have unit "%". , -1 | a {b: scale-color(red, $alpha: 1)} +2 | a {b: color.scale(red, $alpha: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/red/input.scss -a {b: scale-color(red, $red: 1px)} +@use "sass:color"; +a {b: color.scale(red, $red: 1px)} <===> wrong/red/error Error: $red: Expected 1px to have unit "%". , -1 | a {b: scale-color(red, $red: 1px)} +2 | a {b: color.scale(red, $red: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/green/input.scss -a {b: scale-color(green, $green: 1px)} +@use "sass:color"; +a {b: color.scale(green, $green: 1px)} <===> wrong/green/error Error: $green: Expected 1px to have unit "%". , -1 | a {b: scale-color(green, $green: 1px)} +2 | a {b: color.scale(green, $green: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/blue/input.scss -a {b: scale-color(blue, $blue: 1px)} +@use "sass:color"; +a {b: color.scale(blue, $blue: 1px)} <===> wrong/blue/error Error: $blue: Expected 1px to have unit "%". , -1 | a {b: scale-color(blue, $blue: 1px)} +2 | a {b: color.scale(blue, $blue: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/saturation/input.scss -a {b: scale-color(red, $saturation: 1px)} +@use "sass:color"; +a {b: color.scale(red, $saturation: 1px)} <===> wrong/saturation/error Error: $saturation: Expected 1px to have unit "%". , -1 | a {b: scale-color(red, $saturation: 1px)} +2 | a {b: color.scale(red, $saturation: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/lightness/input.scss -a {b: scale-color(red, $lightness: 1px)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 1px)} <===> wrong/lightness/error Error: $lightness: Expected 1px to have unit "%". , -1 | a {b: scale-color(red, $lightness: 1px)} +2 | a {b: color.scale(red, $lightness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/whiteness/input.scss -a {b: scale-color(white, $whiteness: 1px)} +@use "sass:color"; +a {b: color.scale(white, $whiteness: 1px)} <===> wrong/whiteness/error Error: $whiteness: Expected 1px to have unit "%". , -1 | a {b: scale-color(white, $whiteness: 1px)} +2 | a {b: color.scale(white, $whiteness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/blackness/input.scss -a {b: scale-color(black, $blackness: 1px)} +@use "sass:color"; +a {b: color.scale(black, $blackness: 1px)} <===> wrong/blackness/error Error: $blackness: Expected 1px to have unit "%". , -1 | a {b: scale-color(black, $blackness: 1px)} +2 | a {b: color.scale(black, $blackness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/alpha/input.scss -a {b: scale-color(red, $alpha: 1px)} +@use "sass:color"; +a {b: color.scale(red, $alpha: 1px)} <===> wrong/alpha/error Error: $alpha: Expected 1px to have unit "%". , -1 | a {b: scale-color(red, $alpha: 1px)} +2 | a {b: color.scale(red, $alpha: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/scale_color/hsl.hrx b/spec/core_functions/color/scale_color/hsl.hrx index 2ec6a59500..bebb7a5704 100644 --- a/spec/core_functions/color/scale_color/hsl.hrx +++ b/spec/core_functions/color/scale_color/hsl.hrx @@ -1,5 +1,6 @@ <===> saturation/max/input.scss -a {b: scale-color(plum, $saturation: 100%)} +@use "sass:color"; +a {b: color.scale(plum, $saturation: 100%)} <===> saturation/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> saturation/zero/input.scss -a {b: scale-color(plum, $saturation: 0%)} +@use "sass:color"; +a {b: color.scale(plum, $saturation: 0%)} <===> saturation/zero/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> saturation/min/input.scss -a {b: scale-color(plum, $saturation: -100%)} +@use "sass:color"; +a {b: color.scale(plum, $saturation: -100%)} <===> saturation/min/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> saturation/high/input.scss -a {b: scale-color(plum, $saturation: 67%)} +@use "sass:color"; +a {b: color.scale(plum, $saturation: 67%)} <===> saturation/high/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> saturation/low/input.scss -a {b: scale-color(plum, $saturation: -43%)} +@use "sass:color"; +a {b: color.scale(plum, $saturation: -43%)} <===> saturation/low/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> lightness/max/input.scss -a {b: scale-color(red, $lightness: 100%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 100%)} <===> lightness/max/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> lightness/zero/input.scss -a {b: scale-color(red, $lightness: 0%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 0%)} <===> lightness/zero/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> lightness/min/input.scss -a {b: scale-color(red, $lightness: -100%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: -100%)} <===> lightness/min/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> lightness/high/input.scss -a {b: scale-color(red, $lightness: 94%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: 94%)} <===> lightness/high/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> lightness/low/input.scss -a {b: scale-color(red, $lightness: -14%)} +@use "sass:color"; +a {b: color.scale(red, $lightness: -14%)} <===> lightness/low/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: scale-color(turquoise, $saturation: 24%, $lightness: -48%)} +@use "sass:color"; +a {b: color.scale(turquoise, $saturation: 24%, $lightness: -48%)} <===> all/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: scale-color(rgba(turquoise, 0.7), $saturation: 24%, $lightness: -48%)} +@use "sass:color"; +a {b: color.scale(rgba(turquoise, 0.7), $saturation: 24%, $lightness: -48%)} <===> alpha_input/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: scale-color(turquoise, $saturation: 24%, $lightness: -48%, $alpha: -70%)} +@use "sass:color"; +a {b: color.scale(turquoise, $saturation: 24%, $lightness: -48%, $alpha: -70%)} <===> alpha_arg/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: scale-color($color: turquoise, $saturation: 24%, $lightness: -48%)} +@use "sass:color"; +a {b: color.scale($color: turquoise, $saturation: 24%, $lightness: -48%)} <===> named/output.css a { diff --git a/spec/core_functions/color/scale_color/hwb.hrx b/spec/core_functions/color/scale_color/hwb.hrx index 91d2edce68..042cee6be1 100644 --- a/spec/core_functions/color/scale_color/hwb.hrx +++ b/spec/core_functions/color/scale_color/hwb.hrx @@ -1,5 +1,6 @@ <===> whiteness/max/input.scss -a {b: scale-color(#66cc99, $whiteness: 100%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: 100%)} <===> whiteness/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> whiteness/zero/input.scss -a {b: scale-color(#66cc99, $whiteness: 0%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: 0%)} <===> whiteness/zero/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> whiteness/min/input.scss -a {b: scale-color(#66cc99, $whiteness: -100%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: -100%)} <===> whiteness/min/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> whiteness/high/input.scss -a {b: scale-color(#33cc80, $whiteness: 50%)} +@use "sass:color"; +a {b: color.scale(#33cc80, $whiteness: 50%)} <===> whiteness/high/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> whiteness/low/input.scss -a {b: scale-color(#66cc99, $whiteness: -50%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: -50%)} <===> whiteness/low/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> blackness/max/input.scss -a {b: scale-color(#339966, $blackness: 100%)} +@use "sass:color"; +a {b: color.scale(#339966, $blackness: 100%)} <===> blackness/max/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> blackness/zero/input.scss -a {b: scale-color(#339966, $blackness: 0%)} +@use "sass:color"; +a {b: color.scale(#339966, $blackness: 0%)} <===> blackness/zero/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> blackness/min/input.scss -a {b: scale-color(#339966, $blackness: -100%)} +@use "sass:color"; +a {b: color.scale(#339966, $blackness: -100%)} <===> blackness/min/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> blackness/high/input.scss -a {b: scale-color(#33cc80, $blackness: 50%)} +@use "sass:color"; +a {b: color.scale(#33cc80, $blackness: 50%)} <===> blackness/high/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> blackness/low/input.scss -a {b: scale-color(#339966, $blackness: -50%)} +@use "sass:color"; +a {b: color.scale(#339966, $blackness: -50%)} <===> blackness/low/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: scale-color(#66cc99, $whiteness: -50%, $blackness: 50%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: -50%, $blackness: 50%)} <===> all/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: scale-color(rgba(#66cc99, 0.7), $whiteness: -50%, $blackness: 50%)} +@use "sass:color"; +a {b: color.scale(rgba(#66cc99, 0.7), $whiteness: -50%, $blackness: 50%)} <===> alpha_input/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: scale-color(#66cc99, $whiteness: -50%, $blackness: 50%, $alpha: -70%)} +@use "sass:color"; +a {b: color.scale(#66cc99, $whiteness: -50%, $blackness: 50%, $alpha: -70%)} <===> alpha_arg/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: scale-color($color: #66cc99, $whiteness: -50%, $blackness: 50%)} +@use "sass:color"; +a {b: color.scale($color: #66cc99, $whiteness: -50%, $blackness: 50%)} <===> named/output.css a { diff --git a/spec/core_functions/color/scale_color/no_rgb_hsl.hrx b/spec/core_functions/color/scale_color/no_rgb_hsl.hrx index 634574c8c2..a07bee6631 100644 --- a/spec/core_functions/color/scale_color/no_rgb_hsl.hrx +++ b/spec/core_functions/color/scale_color/no_rgb_hsl.hrx @@ -1,5 +1,6 @@ <===> positional/input.scss -a {b: scale-color(red)} +@use "sass:color"; +a {b: color.scale(red)} <===> positional/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: scale-color($color: red)} +@use "sass:color"; +a {b: color.scale($color: red)} <===> named/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> alpha/max/input.scss -a {b: scale-color(rgba(red, 0.5), $alpha: 100%)} +@use "sass:color"; +a {b: color.scale(rgba(red, 0.5), $alpha: 100%)} <===> alpha/max/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> alpha/zero/input.scss -a {b: scale-color(rgba(red, 0.5), $alpha: 0%)} +@use "sass:color"; +a {b: color.scale(rgba(red, 0.5), $alpha: 0%)} <===> alpha/zero/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> alpha/min/input.scss -a {b: scale-color(rgba(red, 0.5), $alpha: -100%)} +@use "sass:color"; +a {b: color.scale(rgba(red, 0.5), $alpha: -100%)} <===> alpha/min/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> alpha/high/input.scss -a {b: scale-color(rgba(red, 0.5), $alpha: 14%)} +@use "sass:color"; +a {b: color.scale(rgba(red, 0.5), $alpha: 14%)} <===> alpha/high/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> alpha/low/input.scss -a {b: scale-color(rgba(red, 0.3), $alpha: -36%)} +@use "sass:color"; +a {b: color.scale(rgba(red, 0.3), $alpha: -36%)} <===> alpha/low/output.css a { diff --git a/spec/core_functions/color/scale_color/rgb.hrx b/spec/core_functions/color/scale_color/rgb.hrx index 25b93dc925..33141a026e 100644 --- a/spec/core_functions/color/scale_color/rgb.hrx +++ b/spec/core_functions/color/scale_color/rgb.hrx @@ -1,5 +1,6 @@ <===> red/max/input.scss -a {b: scale-color(black, $red: 100%)} +@use "sass:color"; +a {b: color.scale(black, $red: 100%)} <===> red/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> red/min/input.scss -a {b: scale-color(red, $red: -100%)} +@use "sass:color"; +a {b: color.scale(red, $red: -100%)} <===> red/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> red/zero/input.scss -a {b: scale-color(black, $red: 0%)} +@use "sass:color"; +a {b: color.scale(black, $red: 0%)} <===> red/zero/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> red/low/input.scss -a {b: scale-color(lightcoral, $red: -33%)} +@use "sass:color"; +a {b: color.scale(lightcoral, $red: -33%)} <===> red/low/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> red/high/input.scss -a {b: scale-color(turquoise, $red: 86%)} +@use "sass:color"; +a {b: color.scale(turquoise, $red: 86%)} <===> red/high/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> green/max/input.scss -a {b: scale-color(black, $green: 100%)} +@use "sass:color"; +a {b: color.scale(black, $green: 100%)} <===> green/max/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> green/min/input.scss -a {b: scale-color(lime, $green: -100%)} +@use "sass:color"; +a {b: color.scale(lime, $green: -100%)} <===> green/min/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> green/zero/input.scss -a {b: scale-color(black, $green: 0%)} +@use "sass:color"; +a {b: color.scale(black, $green: 0%)} <===> green/zero/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> green/low/input.scss -a {b: scale-color(seagreen, $green: -86%)} +@use "sass:color"; +a {b: color.scale(seagreen, $green: -86%)} <===> green/low/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> green/high/input.scss -a {b: scale-color(cadetblue, $green: 12%)} +@use "sass:color"; +a {b: color.scale(cadetblue, $green: 12%)} <===> green/high/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> blue/max/input.scss -a {b: scale-color(black, $blue: 100%)} +@use "sass:color"; +a {b: color.scale(black, $blue: 100%)} <===> blue/max/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> blue/min/input.scss -a {b: scale-color(blue, $blue: -100%)} +@use "sass:color"; +a {b: color.scale(blue, $blue: -100%)} <===> blue/min/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> blue/zero/input.scss -a {b: scale-color(black, $blue: 0%)} +@use "sass:color"; +a {b: color.scale(black, $blue: 0%)} <===> blue/zero/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> blue/low/input.scss -a {b: scale-color(slategray, $blue: -16%)} +@use "sass:color"; +a {b: color.scale(slategray, $blue: -16%)} <===> blue/low/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> blue/high/input.scss -a {b: scale-color(salmon, $blue: 42%)} +@use "sass:color"; +a {b: color.scale(salmon, $blue: 42%)} <===> blue/high/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> all/input.scss -a {b: scale-color(sienna, $red: 12%, $green: 24%, $blue: 48%)} +@use "sass:color"; +a {b: color.scale(sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> all/output.css a { @@ -159,7 +175,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: scale-color(rgba(sienna, 0.3), $red: 12%, $green: 24%, $blue: 48%)} +@use "sass:color"; +a {b: color.scale(rgba(sienna, 0.3), $red: 12%, $green: 24%, $blue: 48%)} <===> alpha_input/output.css a { @@ -169,7 +186,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: scale-color(sienna, $red: 12%, $green: 24%, $blue: 48%, $alpha: -70%)} +@use "sass:color"; +a {b: color.scale(sienna, $red: 12%, $green: 24%, $blue: 48%, $alpha: -70%)} <===> alpha_arg/output.css a { @@ -179,7 +197,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: scale-color($color: sienna, $red: 12%, $green: 24%, $blue: 48%)} +@use "sass:color"; +a {b: color.scale($color: sienna, $red: 12%, $green: 24%, $blue: 48%)} <===> named/output.css a { diff --git a/spec/core_functions/modules/general.hrx b/spec/core_functions/general.hrx similarity index 100% rename from spec/core_functions/modules/general.hrx rename to spec/core_functions/general.hrx diff --git a/spec/core_functions/global/README.md b/spec/core_functions/global/README.md new file mode 100644 index 0000000000..0b26a775e1 --- /dev/null +++ b/spec/core_functions/global/README.md @@ -0,0 +1,12 @@ +This directory tests the global versions of the core functions that are +accessible from the `sass:` modules as defined in [the module system proposal]. + +It just tests that each individual function is accessible with the correct name, +as the actual implementations of these functions are already tested using the +`sass:` modules. + +Note: Only the function being tested uses the global name here. `sass:` modules +may still be loaded to access other functions used as part of the test (e.g. +`meta.inspect()`). + +[the module system proposal]: https://github.com/sass/sass/blob/master/accepted/module-system.md#built-in-modules-1 diff --git a/spec/core_functions/global/color.hrx b/spec/core_functions/global/color.hrx new file mode 100644 index 0000000000..99424ea459 --- /dev/null +++ b/spec/core_functions/global/color.hrx @@ -0,0 +1,379 @@ +<===> red/input.scss +a {b: red(#abcdef)} + +<===> red/output.css +a { + b: 171; +} + +<===> +================================================================================ +<===> green/input.scss +a {b: green(#abcdef)} + +<===> green/output.css +a { + b: 205; +} + +<===> +================================================================================ +<===> blue/input.scss +a {b: blue(#abcdef)} + +<===> blue/output.css +a { + b: 239; +} + +<===> +================================================================================ +<===> hue/input.scss +a {b: hue(#abcdef)} + +<===> hue/output.css +a { + b: 210deg; +} + +<===> +================================================================================ +<===> saturation/input.scss +a {b: saturation(#abcdef)} + +<===> saturation/output.css +a { + b: 68%; +} + +<===> +================================================================================ +<===> lightness/input.scss +a {b: lightness(#abcdef)} + +<===> lightness/output.css +a { + b: 80.3921568627%; +} + +<===> +================================================================================ +<===> mix/input.scss +a {b: mix(#abcdef, #daddee)} + +<===> mix/output.css +a { + b: #c3d5ef; +} + +<===> +================================================================================ +<===> complement/input.scss +a {b: complement(#abcdef)} + +<===> complement/output.css +a { + b: #efcdab; +} + +<===> +================================================================================ +<===> darken/input.scss +a {b: darken(#abcdef, 10%)} + +<===> darken/output.css +a { + b: #80b4e7; +} + +<===> +================================================================================ +<===> desaturate/input.scss +a {b: desaturate(#abcdef, 10%)} + +<===> desaturate/output.css +a { + b: #b0cdea; +} + +<===> +================================================================================ +<===> fade-in/input.scss +a {b: fade-in(rgba(red, 0.5), 0.3)} + +<===> fade-in/output.css +a { + b: rgba(255, 0, 0, 0.8); +} + + +<===> +================================================================================ +<===> opacify/input.scss +a {b: opacify(rgba(red, 0.5), 0.3)} + +<===> opacify/output.css +a { + b: rgba(255, 0, 0, 0.8); +} + +<===> +================================================================================ +<===> fade-out/input.scss +a {b: fade-out(rgba(red, 0.5), 0.3)} + +<===> fade-out/output.css +a { + b: rgba(255, 0, 0, 0.2); +} + +<===> +================================================================================ +<===> transparentize/input.scss +a {b: transparentize(rgba(red, 0.5), 0.3)} + +<===> transparentize/output.css +a { + b: rgba(255, 0, 0, 0.2); +} + +<===> +================================================================================ +<===> lighten/input.scss +a {b: lighten(#abcdef, 10%)} + +<===> lighten/output.css +a { + b: #d6e7f7; +} + +<===> +================================================================================ +<===> saturate/input.scss +a {b: saturate(#abcdef, 10%)} + +<===> saturate/output.css +a { + b: #a6cdf4; +} + +<===> +================================================================================ +<===> alpha/input.scss +a {b: alpha(#abcdef)} + +<===> alpha/output.css +a { + b: 1; +} + +<===> +================================================================================ +<===> scale/input.scss +a {b: scale-color(#abcdef, $red: 10%)} + +<===> scale/output.css +a { + b: #b3cdef; +} + +<===> +================================================================================ +<===> change/input.scss +a {b: change-color(#abcdef, $red: 10)} + +<===> change/output.css +a { + b: #0acdef; +} + +<===> +================================================================================ +<===> ie_hex_str/input.scss +a {b: ie-hex-str(#abcdef)} + +<===> ie_hex_str/output.css +a { + b: #FFABCDEF; +} + +<===> +================================================================================ +<===> grayscale/with_color/input.scss +a {b: grayscale(red)} + +<===> grayscale/with_color/output.css +a { + b: gray; +} + +<===> +================================================================================ +<===> grayscale/with_number/input.scss +// A number should produce a plain function string, for CSS filter functions. +a {b: grayscale(15%)} + +<===> grayscale/with_number/output.css +a { + b: grayscale(15%); +} + +<===> +================================================================================ +<===> grayscale/with_css_var/input.scss +a {b: grayscale(var(--c))} + +<===> grayscale/with_css_var/output.css +a { + b: grayscale(var(--c)); +} + +<===> +================================================================================ +<===> grayscale/with_calc/input.scss +a {b: grayscale(calc(1 + 2))} + +<===> grayscale/with_calc/output.css +a { + b: grayscale(3); +} + +<===> +================================================================================ +<===> grayscale/with_unquoted_calc/input.scss +@use "sass:string"; +a {b: grayscale(string.unquote('calc(1)'))} + +<===> grayscale/with_unquoted_calc/output.css +a { + b: grayscale(calc(1)); +} + +<===> +================================================================================ +<===> invert/with_color/input.scss +a {b: invert(#abcdef)} + +<===> invert/with_color/output.css +a { + b: #543210; +} + +<===> +================================================================================ +<===> invert/with_number/input.scss +a {b: invert(10%)} + +<===> invert/with_number/output.css +a { + b: invert(10%); +} + +<===> +================================================================================ +<===> invert/with_css_var/input.scss +a {b: invert(var(--c))} + +<===> invert/with_css_var/output.css +a { + b: invert(var(--c)); +} + +<===> +================================================================================ +<===> invert/with_calc/input.scss +a {b: invert(calc(1 + 2))} + +<===> invert/with_calc/output.css +a { + b: invert(3); +} + +<===> +================================================================================ +<===> invert/with_unquoted_calc/input.scss +@use "sass:string"; +a {b: invert(string.unquote('calc(1)'))} + +<===> invert/with_unquoted_calc/output.css +a { + b: invert(calc(1)); +} + +<===> +================================================================================ +<===> error/too_low/lighten/input.scss +a {b: lighten(red, -0.001)} + +<===> error/too_low/lighten/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: lighten(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_low/darken/input.scss +a {b: darken(red, -0.001)} + +<===> error/too_low/darken/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: darken(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_low/saturate/input.scss +a {b: saturate(red, -0.001)} + +<===> error/too_low/saturate/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: saturate(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_low/desaturate/input.scss +a {b: desaturate(red, -0.001)} + +<===> error/too_low/desaturate/error +Error: $amount: Expected -0.001 to be within 0 and 100. + , +1 | a {b: desaturate(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_low/fade_in/input.scss +a {b: fade-in(red, -0.001)} + +<===> error/too_low/fade_in/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-in(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/too_low/fade_out/input.scss +a {b: fade-out(red, -0.001)} + +<===> error/too_low/fade_out/error +Error: $amount: Expected -0.001 to be within 0 and 1. + , +1 | a {b: fade-out(red, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/global/list.hrx b/spec/core_functions/global/list.hrx new file mode 100644 index 0000000000..74e6f365ac --- /dev/null +++ b/spec/core_functions/global/list.hrx @@ -0,0 +1,78 @@ +<===> append/input.scss +a {b: append(c d, e)} + +<===> append/output.css +a { + b: c d e; +} + +<===> +================================================================================ +<===> index/input.scss +a {b: index(a b c, b)} + +<===> index/output.css +a { + b: 2; +} + +<===> +================================================================================ +<===> join/input.scss +a {b: join(c d, e f)} + +<===> join/output.css +a { + b: c d e f; +} + +<===> +================================================================================ +<===> length/input.scss +a {b: length(a b c)} + +<===> length/output.css +a { + b: 3; +} + +<===> +================================================================================ +<===> nth/input.scss +a {b: nth(a b c, 3)} + +<===> nth/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> list-separator/input.scss +a {b: list-separator(a b c)} + +<===> list-separator/output.css +a { + b: space; +} + +<===> +================================================================================ +<===> set-nth/input.scss +a {b: set-nth(c d e, 2, f)} + +<===> set-nth/output.css +a { + b: c f e; +} + + +<===> +================================================================================ +<===> zip/input.scss +a {b: zip(1 2 3, c d e)} + +<===> zip/output.css +a { + b: 1 c, 2 d, 3 e; +} diff --git a/spec/core_functions/global/map.hrx b/spec/core_functions/global/map.hrx new file mode 100644 index 0000000000..6026106b91 --- /dev/null +++ b/spec/core_functions/global/map.hrx @@ -0,0 +1,59 @@ +<===> get/input.scss +a {b: map-get((c: d), c)} + +<===> get/output.css +a { + b: d; +} + +<===> +================================================================================ +<===> merge/input.scss +@use "sass:meta"; +a {b: meta.inspect(map-merge((c: d), (e: f)))} + +<===> merge/output.css +a { + b: (c: d, e: f); +} + +<===> +================================================================================ +<===> remove/input.scss +@use "sass:meta"; +a {b: meta.inspect(map-remove((c: d), c))} + +<===> remove/output.css +a { + b: (); +} + +<===> +================================================================================ +<===> keys/input.scss +a {b: map-keys((c: d))} + +<===> keys/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> values/input.scss +a {b: map-values((c: d))} + +<===> values/output.css +a { + b: d; +} + +<===> +================================================================================ +<===> has_key/input.scss +a {b: map-has-key((c: d), c)} + +<===> has_key/output.css +a { + b: true; +} diff --git a/spec/core_functions/modules/math.hrx b/spec/core_functions/global/math.hrx similarity index 54% rename from spec/core_functions/modules/math.hrx rename to spec/core_functions/global/math.hrx index 5b07e6d7ab..65d00c4f94 100644 --- a/spec/core_functions/modules/math.hrx +++ b/spec/core_functions/global/math.hrx @@ -1,6 +1,5 @@ <===> percentage/input.scss -@use "sass:math"; -a {b: math.percentage(0.5)} +a {b: percentage(0.5)} <===> percentage/output.css a { @@ -11,8 +10,7 @@ a { <===> ================================================================================ <===> round/input.scss -@use "sass:math"; -a {b: math.round(0.5)} +a {b: round(0.5)} <===> round/output.css a { @@ -22,8 +20,7 @@ a { <===> ================================================================================ <===> ceil/input.scss -@use "sass:math"; -a {b: math.ceil(0.5)} +a {b: ceil(0.5)} <===> ceil/output.css a { @@ -33,8 +30,7 @@ a { <===> ================================================================================ <===> floor/input.scss -@use "sass:math"; -a {b: math.floor(0.5)} +a {b: floor(0.5)} <===> floor/output.css a { @@ -44,8 +40,7 @@ a { <===> ================================================================================ <===> abs/input.scss -@use "sass:math"; -a {b: math.abs(-1)} +a {b: abs(-1)} <===> abs/output.css a { @@ -55,8 +50,7 @@ a { <===> ================================================================================ <===> min/input.scss -@use "sass:math"; -a {b: math.min(1, 2, 3)} +a {b: min(1, 2, 3)} <===> min/output.css a { @@ -66,8 +60,7 @@ a { <===> ================================================================================ <===> max/input.scss -@use "sass:math"; -a {b: math.max(1, 2, 3)} +a {b: max(1, 2, 3)} <===> max/output.css a { @@ -77,8 +70,7 @@ a { <===> ================================================================================ <===> random/input.scss -@use "sass:math"; -a {b: math.random(5) <= 5} +a {b: random(5) <= 5} <===> random/output.css a { @@ -88,8 +80,7 @@ a { <===> ================================================================================ <===> unit/input.scss -@use "sass:math"; -a {b: math.unit(5px)} +a {b: unit(5px)} <===> unit/output.css a { @@ -98,50 +89,20 @@ a { <===> ================================================================================ -<===> is_unitless/input.scss -@use "sass:math"; -a {b: math.is-unitless(1)} +<===> unitless/input.scss +a {b: unitless(1)} -<===> is_unitless/output.css +<===> unitless/output.css a { b: true; } <===> ================================================================================ -<===> compatible/input.scss -@use "sass:math"; -a {b: math.compatible(1px, 1in)} +<===> comparable/input.scss +a {b: comparable(1px, 1in)} -<===> compatible/output.css +<===> comparable/output.css a { b: true; } - -<===> -================================================================================ -<===> error/unitless/input.scss -@use "sass:math"; -a {b: math.unitless(1)} - -<===> error/unitless/error -Error: Undefined function. - , -2 | a {b: math.unitless(1)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/comparable/input.scss -@use "sass:math"; -a {b: math.comparable(1px, 1in)} - -<===> error/comparable/error -Error: Undefined function. - , -2 | a {b: math.comparable(1px, 1in)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/meta.hrx b/spec/core_functions/global/meta.hrx similarity index 76% rename from spec/core_functions/modules/meta.hrx rename to spec/core_functions/global/meta.hrx index 5836feaf47..cda938d11b 100644 --- a/spec/core_functions/modules/meta.hrx +++ b/spec/core_functions/global/meta.hrx @@ -1,6 +1,5 @@ <===> inspect/input.scss -@use "sass:meta"; -a {b: meta.inspect(())} +a {b: inspect(())} <===> inspect/output.css a { @@ -10,8 +9,7 @@ a { <===> ================================================================================ <===> feature_exists/input.scss -@use "sass:meta"; -a {b: meta.feature-exists(at-error)} +a {b: feature-exists(at-error)} <===> feature_exists/output.css a { @@ -21,8 +19,7 @@ a { <===> ================================================================================ <===> variable_exists/input.scss -@use "sass:meta"; -a {b: meta.variable-exists(c)} +a {b: variable-exists(c)} <===> variable_exists/output.css a { @@ -32,8 +29,7 @@ a { <===> ================================================================================ <===> global_variable_exists/input.scss -@use "sass:meta"; -a {b: meta.global-variable-exists(c)} +a {b: global-variable-exists(c)} <===> global_variable_exists/output.css a { @@ -43,8 +39,7 @@ a { <===> ================================================================================ <===> function_exists/input.scss -@use "sass:meta"; -a {b: meta.function-exists(c)} +a {b: function-exists(c)} <===> function_exists/output.css a { @@ -54,8 +49,7 @@ a { <===> ================================================================================ <===> mixin_exists/input.scss -@use "sass:meta"; -a {b: meta.mixin-exists(c)} +a {b: mixin-exists(c)} <===> mixin_exists/output.css a { @@ -66,7 +60,7 @@ a { ================================================================================ <===> get_function/input.scss @use "sass:meta"; -a {b: meta.inspect(meta.get-function(rgb))} +a {b: meta.inspect(get-function(rgb))} <===> get_function/output.css a { @@ -76,8 +70,7 @@ a { <===> ================================================================================ <===> type_of/input.scss -@use "sass:meta"; -a {b: meta.type-of(())} +a {b: type-of(())} <===> type_of/output.css a { @@ -88,7 +81,7 @@ a { ================================================================================ <===> call/input.scss @use "sass:meta"; -a {b: meta.call(meta.get-function("rgb"), 1, 2, 3)} +a {b: call(meta.get-function("rgb"), 1, 2, 3)} <===> call/output.css a { @@ -98,10 +91,8 @@ a { <===> ================================================================================ <===> content_exists/input.scss -@use "sass:meta"; - @mixin print-content-exists { - a {b: meta.content-exists()} + a {b: content-exists()} } @include print-content-exists; @@ -116,11 +107,11 @@ a { <===> keywords/input.scss @use "sass:meta"; -@function keywords($args...) { - @return meta.keywords($args); +@function helper($args...) { + @return keywords($args); } -a {b: meta.inspect(keywords($c: d))} +a {b: meta.inspect(helper($c: d))} <===> keywords/output.css a { diff --git a/spec/core_functions/global/selector.hrx b/spec/core_functions/global/selector.hrx new file mode 100644 index 0000000000..e8a153cce0 --- /dev/null +++ b/spec/core_functions/global/selector.hrx @@ -0,0 +1,77 @@ +<===> nest/input.scss +a {b: selector-nest(c, d)} + +<===> nest/output.css +a { + b: c d; +} + +<===> +================================================================================ +<===> append/input.scss +a {b: selector-append(c, d)} + +<===> append/output.css +a { + b: cd; +} + +<===> +================================================================================ +<===> replace/input.scss +a {b: selector-replace(c, c, d)} + +<===> replace/output.css +a { + b: d; +} + +<===> +================================================================================ +<===> extend/input.scss +a {b: selector-extend(c, c, d)} + +<===> extend/output.css +a { + b: c, d; +} + +<===> +================================================================================ +<===> unify/input.scss +a {b: selector-unify(".c", ".d")} + +<===> unify/output.css +a { + b: .c.d; +} + +<===> +================================================================================ +<===> is_superselector/input.scss +a {b: is-superselector(c, d)} + +<===> is_superselector/output.css +a { + b: false; +} + +<===> +================================================================================ +<===> simple_selectors/input.scss +a {b: simple-selectors(".c.d")} + +<===> simple_selectors/output.css +a { + b: .c, .d; +} + +<===> +================================================================================ +<===> parse/input.scss +a {b: selector-parse(".c, .d")} + +<===> parse/output.css +a { + b: .c, .d; +} diff --git a/spec/core_functions/global/string.hrx b/spec/core_functions/global/string.hrx new file mode 100644 index 0000000000..e9c90b9fbd --- /dev/null +++ b/spec/core_functions/global/string.hrx @@ -0,0 +1,78 @@ +<===> unquote/input.scss +a {b: unquote("c")} + +<===> unquote/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> quote/input.scss +a {b: quote(c)} + +<===> quote/output.css +a { + b: "c"; +} + +<===> +================================================================================ +<===> length/input.scss +a {b: str-length("c")} + +<===> length/output.css +a { + b: 1; +} + +<===> +================================================================================ +<===> insert/input.scss +a {b: str-insert("c", "d", 1)} + +<===> insert/output.css +a { + b: "dc"; +} + +<===> +================================================================================ +<===> index/input.scss +a {b: str-index("c", "c")} + +<===> index/output.css +a { + b: 1; +} + +<===> +================================================================================ +<===> slice/input.scss +a {b: str-slice("c", 1, 1)} + +<===> slice/output.css +a { + b: "c"; +} + +<===> +================================================================================ +<===> to_upper_case/input.scss +a {b: to-upper-case("c")} + +<===> to_upper_case/output.css +a { + b: "C"; +} + +<===> +================================================================================ +<===> unique_id/input.scss +@use "sass:meta"; +a {b: meta.type-of(unique-id())} + +<===> unique_id/output.css +a { + b: string; +} diff --git a/spec/core_functions/list/_utils.scss b/spec/core_functions/list/_utils.scss index 6515accf7f..0ac7ee2cc3 100644 --- a/spec/core_functions/list/_utils.scss +++ b/spec/core_functions/list/_utils.scss @@ -11,25 +11,28 @@ // lists, but in order to thoroughly test their behavior we want to be able // to distinguish lists that are internally space-separated from those that // are internally undecided. +@use "sass:list"; +@use "sass:map"; /// Like `list-separator()` but returns `undecided` for lists with undecided /// separators. @function real-separator($list) { - @if list-separator(join($list, 1 2)) != list-separator(join($list, (1, 2))) { + @if list.separator(list.join($list, 1 2)) != + list.separator(list.join($list, (1, 2))) { @return undecided; } @else { - @return list-separator($list); + @return list.separator($list); } } /// Returns a copy of `$list` with the given `$separator`. @function with-separator($list, $separator) { - @return join($list, (), $separator); + @return list.join($list, (), $separator); } /// An empty map, created by removing a value from a map. This *should* be /// treated as identical to the literal `()`. -$empty-map: map-remove((a: b), a); +$empty-map: map.remove((a: b), a); /// The value `()` has an undefined separator, but we can construct an empty /// list with a defined space separator. diff --git a/spec/core_functions/list/append.hrx b/spec/core_functions/list/append.hrx index ab7f555224..f7ec743133 100644 --- a/spec/core_functions/list/append.hrx +++ b/spec/core_functions/list/append.hrx @@ -1,11 +1,13 @@ <===> empty/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: append((), 1); +$result: list.append((), 1); a { value: $result; - type: type-of($result); - separator: real-separator($result); + type: meta.type-of($result); + separator: utils.real-separator($result); } <===> empty/undecided/output.css @@ -18,13 +20,15 @@ a { <===> ================================================================================ <===> empty/space/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: append($empty-space-list, 1); +$result: list.append(utils.$empty-space-list, 1); a { value: $result; - type: type-of($result); - separator: real-separator($result); + type: meta.type-of($result); + separator: utils.real-separator($result); } <===> empty/space/output.css @@ -37,13 +41,15 @@ a { <===> ================================================================================ <===> empty/comma/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: append($empty-comma-list, 1); +$result: list.append(utils.$empty-comma-list, 1); a { value: $result; - type: type-of($result); - separator: real-separator($result); + type: meta.type-of($result); + separator: utils.real-separator($result); } <===> empty/comma/output.css @@ -56,7 +62,8 @@ a { <===> ================================================================================ <===> single/undecided/input.scss -a {b: append(1, 2)} +@use "sass:list"; +a {b: list.append(1, 2)} <===> single/undecided/output.css a { @@ -66,8 +73,9 @@ a { <===> ================================================================================ <===> single/space/input.scss -@import "core_functions/list/utils"; -a {b: append(with-separator(1, space), 2)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.append(utils.with-separator(1, space), 2)} <===> single/space/output.css a { @@ -77,7 +85,8 @@ a { <===> ================================================================================ <===> single/comma/input.scss -a {b: append((1,), 2)} +@use "sass:list"; +a {b: list.append((1,), 2)} <===> single/comma/output.css a { @@ -87,7 +96,8 @@ a { <===> ================================================================================ <===> space/default/input.scss -a {b: append(1 2 3, 4)} +@use "sass:list"; +a {b: list.append(1 2 3, 4)} <===> space/default/output.css a { @@ -97,7 +107,8 @@ a { <===> ================================================================================ <===> space/overridden/input.scss -a {b: append((1, 2, 3), 4, $separator: space)} +@use "sass:list"; +a {b: list.append((1, 2, 3), 4, $separator: space)} <===> space/overridden/output.css a { @@ -107,7 +118,8 @@ a { <===> ================================================================================ <===> comma/default/input.scss -a {b: append((1, 2, 3), 4)} +@use "sass:list"; +a {b: list.append((1, 2, 3), 4)} <===> comma/default/output.css a { @@ -117,7 +129,8 @@ a { <===> ================================================================================ <===> comma/overridden/input.scss -a {b: append(1 2 3, 4, $separator: comma)} +@use "sass:list"; +a {b: list.append(1 2 3, 4, $separator: comma)} <===> comma/overridden/output.css a { @@ -128,7 +141,7 @@ a { ================================================================================ <===> slash/default/input.scss @use "sass:list"; -a {b: append(list.slash(c, d), e)} +a {b: list.append(list.slash(c, d), e)} <===> slash/default/output.css a { @@ -138,7 +151,8 @@ a { <===> ================================================================================ <===> slash/overridden/input.scss -a {b: append(c d, e, $separator: slash)} +@use "sass:list"; +a {b: list.append(c d, e, $separator: slash)} <===> slash/overridden/output.css a { @@ -148,7 +162,8 @@ a { <===> ================================================================================ <===> bracketed/input.scss -a {b: append([], 1)} +@use "sass:list"; +a {b: list.append([], 1)} <===> bracketed/output.css a { @@ -158,13 +173,15 @@ a { <===> ================================================================================ <===> map/empty/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: append($empty-map, 1); +$result: list.append(utils.$empty-map, 1); a { value: $result; - type: type-of($result); - separator: real-separator($result); + type: meta.type-of($result); + separator: utils.real-separator($result); } <===> map/empty/output.css @@ -177,7 +194,8 @@ a { <===> ================================================================================ <===> map/non_empty/input.scss -a {b: append((c: d, e: f), g)} +@use "sass:list"; +a {b: list.append((c: d, e: f), g)} <===> map/non_empty/output.css a { @@ -187,7 +205,8 @@ a { <===> ================================================================================ <===> non_list/input.scss -a {b: append(c, d)} +@use "sass:list"; +a {b: list.append(c, d)} <===> non_list/output.css a { @@ -197,7 +216,8 @@ a { <===> ================================================================================ <===> auto/input.scss -a {b: append(c d, e, $separator: auto)} +@use "sass:list"; +a {b: list.append(c d, e, $separator: auto)} <===> auto/output.css a { @@ -207,7 +227,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: append($list: c d, $val: e, $separator: comma)} +@use "sass:list"; +a {b: list.append($list: c d, $val: e, $separator: comma)} <===> named/output.css a { @@ -217,59 +238,63 @@ a { <===> ================================================================================ <===> error/type/separator/input.scss -a {b: append(c, d, $separator: 1)} +@use "sass:list"; +a {b: list.append(c, d, $separator: 1)} <===> error/type/separator/error Error: $separator: 1 is not a string. , -1 | a {b: append(c, d, $separator: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.append(c, d, $separator: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: append(c, d, comma, e)} +@use "sass:list"; +a {b: list.append(c, d, comma, e)} <===> error/too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: append(c, d, comma, e)} - | ^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.append(c, d, comma, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function append($list, $val, $separator: auto) { | ===================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: append(c)} +@use "sass:list"; +a {b: list.append(c)} <===> error/too_few_args/error Error: Missing argument $val. ,--> input.scss -1 | a {b: append(c)} - | ^^^^^^^^^ invocation +2 | a {b: list.append(c)} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function append($list, $val, $separator: auto) { | ===================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/unknown_separator/input.scss -a {b: append(c, d, $separator: e)} +@use "sass:list"; +a {b: list.append(c, d, $separator: e)} <===> error/unknown_separator/error Error: $separator: Must be "space", "comma", "slash", or "auto". , -1 | a {b: append(c, d, $separator: e)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.append(c, d, $separator: e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/index.hrx b/spec/core_functions/list/index.hrx index 030ac14091..5ce89c6ceb 100644 --- a/spec/core_functions/list/index.hrx +++ b/spec/core_functions/list/index.hrx @@ -1,5 +1,6 @@ <===> found/single/input.scss -a {b: index([c], c)} +@use "sass:list"; +a {b: list.index([c], c)} <===> found/single/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> found/first/input.scss -a {b: index(a b c, a)} +@use "sass:list"; +a {b: list.index(a b c, a)} <===> found/first/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> found/last/input.scss -a {b: index(a b c, c)} +@use "sass:list"; +a {b: list.index(a b c, c)} <===> found/last/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> found/sass_equality/input.scss -a {b: index(1px 1in 1cm, 96px)} +@use "sass:list"; +a {b: list.index(1px 1in 1cm, 96px)} <===> found/sass_equality/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> found/multiple/input.scss -a {b: index(a b c a b c, b)} +@use "sass:list"; +a {b: list.index(a b c a b c, b)} <===> found/multiple/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> found/map/input.scss -a {b: index((c: d, e: f, g: h), e f)} +@use "sass:list"; +a {b: list.index((c: d, e: f, g: h), e f)} <===> found/map/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> found/non_list/input.scss -a {b: index(c, c)} +@use "sass:list"; +a {b: list.index(c, c)} <===> found/non_list/output.css a { @@ -69,7 +76,9 @@ a { <===> ================================================================================ <===> not_found/empty/input.scss -a {b: inspect(index((), c))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.index((), c))} <===> not_found/empty/output.css a { @@ -79,7 +88,9 @@ a { <===> ================================================================================ <===> not_found/non_empty/input.scss -a {b: inspect(index(c d e, f))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.index(c d e, f))} <===> not_found/non_empty/output.css a { @@ -89,8 +100,10 @@ a { <===> ================================================================================ <===> not_found/map/empty/input.scss -@import "core_functions/list/utils"; -a {b: inspect(index($empty-map, e))} +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; +a {b: meta.inspect(list.index(utils.$empty-map, e))} <===> not_found/map/empty/output.css a { @@ -100,7 +113,9 @@ a { <===> ================================================================================ <===> not_found/map/non_empty/input.scss -a {b: inspect(index((c: d, e: f, g: h), e))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.index((c: d, e: f, g: h), e))} <===> not_found/map/non_empty/output.css a { @@ -110,7 +125,9 @@ a { <===> ================================================================================ <===> not_found/non_list/input.scss -a {b: inspect(index(c, d))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.index(c, d))} <===> not_found/non_list/output.css a { @@ -120,7 +137,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: index($list: c d e, $value: d)} +@use "sass:list"; +a {b: list.index($list: c d e, $value: d)} <===> named/output.css a { @@ -130,33 +148,35 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: index(c d e)} +@use "sass:list"; +a {b: list.index(c d e)} <===> error/too_few_args/error Error: Missing argument $value. ,--> input.scss -1 | a {b: index(c d e)} - | ^^^^^^^^^^^^ invocation +2 | a {b: list.index(c d e)} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function index($list, $value) { | ==================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: index(c d e, d, e)} +@use "sass:list"; +a {b: list.index(c d e, d, e)} <===> error/too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: index(c d e, d, e)} - | ^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.index(c d e, d, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function index($list, $value) { | ==================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/join/empty.hrx b/spec/core_functions/list/join/empty.hrx index f13e243a99..b775ca9370 100644 --- a/spec/core_functions/list/join/empty.hrx +++ b/spec/core_functions/list/join/empty.hrx @@ -1,13 +1,15 @@ <===> both/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join((), ()); +$result: list.join((), ()); a { - value: inspect($result); + value: meta.inspect($result); // `join()` should always produce a real separator, even when the inputs have // undecided separators. It should default to `space`. - separator: real-separator($result); + separator: utils.real-separator($result); } <===> both/undecided/output.css @@ -19,12 +21,14 @@ a { <===> ================================================================================ <===> both/space/first/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join($empty-space-list, ()); +$result: list.join(utils.$empty-space-list, ()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/space/first/output.css @@ -36,12 +40,14 @@ a { <===> ================================================================================ <===> both/space/last/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join((), $empty-space-list); +$result: list.join((), utils.$empty-space-list); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/space/last/output.css @@ -53,12 +59,14 @@ a { <===> ================================================================================ <===> both/comma/first/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join($empty-comma-list, ()); +$result: list.join(utils.$empty-comma-list, ()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/comma/first/output.css @@ -70,12 +78,14 @@ a { <===> ================================================================================ <===> both/comma/last/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join((), $empty-comma-list); +$result: list.join((), utils.$empty-comma-list); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/comma/last/output.css @@ -87,13 +97,15 @@ a { <===> ================================================================================ <===> both/slash/first/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$empty-slash-list: join((), (), $separator: slash); -$result: join($empty-slash-list, ()); +$empty-slash-list: list.join((), (), $separator: slash); +$result: list.join($empty-slash-list, ()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/slash/first/output.css @@ -105,13 +117,15 @@ a { <===> ================================================================================ <===> both/slash/last/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$empty-slash-list: join((), (), $separator: slash); -$result: join((), $empty-slash-list); +$empty-slash-list: list.join((), (), $separator: slash); +$result: list.join((), $empty-slash-list); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> both/slash/last/output.css @@ -123,7 +137,8 @@ a { <===> ================================================================================ <===> first/undecided/and_space/input.scss -a {b: join((), 1 2 3)} +@use "sass:list"; +a {b: list.join((), 1 2 3)} <===> first/undecided/and_space/output.css a { @@ -133,7 +148,8 @@ a { <===> ================================================================================ <===> first/undecided/and_comma/input.scss -a {b: join((), (1, 2, 3))} +@use "sass:list"; +a {b: list.join((), (1, 2, 3))} <===> first/undecided/and_comma/output.css a { @@ -144,7 +160,7 @@ a { ================================================================================ <===> first/undecided/and_slash/input.scss @use "sass:list"; -a {b: join((), list.slash(1, 2, 3))} +a {b: list.join((), list.slash(1, 2, 3))} <===> first/undecided/and_slash/output.css a { @@ -154,8 +170,9 @@ a { <===> ================================================================================ <===> first/space/input.scss -@import "core_functions/list/utils"; -a {b: join($empty-space-list, (1, 2, 3))} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.$empty-space-list, (1, 2, 3))} <===> first/space/output.css a { @@ -165,8 +182,9 @@ a { <===> ================================================================================ <===> first/comma/input.scss -@import "core_functions/list/utils"; -a {b: join($empty-comma-list, 1 2 3)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.$empty-comma-list, 1 2 3)} <===> first/comma/output.css a { @@ -176,8 +194,9 @@ a { <===> ================================================================================ <===> first/slash/input.scss -$empty-slash-list: join((), (), $separator: slash); -a {b: join($empty-slash-list, 1 2 3)} +@use "sass:list"; +$empty-slash-list: list.join((), (), $separator: slash); +a {b: list.join($empty-slash-list, 1 2 3)} <===> first/slash/output.css a { @@ -187,7 +206,8 @@ a { <===> ================================================================================ <===> second/undecided/space/input.scss -a {b: join(1 2 3, ())} +@use "sass:list"; +a {b: list.join(1 2 3, ())} <===> second/undecided/space/output.css a { @@ -197,7 +217,8 @@ a { <===> ================================================================================ <===> second/undecided/comma/input.scss -a {b: join((1, 2, 3), ())} +@use "sass:list"; +a {b: list.join((1, 2, 3), ())} <===> second/undecided/comma/output.css a { @@ -208,7 +229,7 @@ a { ================================================================================ <===> second/undecided/slash/input.scss @use "sass:list"; -a {b: join(list.slash(1, 2, 3), ())} +a {b: list.join(list.slash(1, 2, 3), ())} <===> second/undecided/slash/output.css a { @@ -218,8 +239,9 @@ a { <===> ================================================================================ <===> second/space/input.scss -@import "core_functions/list/utils"; -a {b: join((1, 2, 3), $empty-space-list)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join((1, 2, 3), utils.$empty-space-list)} <===> second/space/output.css a { @@ -229,8 +251,9 @@ a { <===> ================================================================================ <===> second/comma/input.scss -@import "core_functions/list/utils"; -a {b: join(1 2 3, $empty-comma-list)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(1 2 3, utils.$empty-comma-list)} <===> second/comma/output.css a { @@ -240,8 +263,9 @@ a { <===> ================================================================================ <===> second/slash/input.scss -$empty-slash-list: join((), (), $separator: slash); -a {b: join(1 2 3, $empty-slash-list)} +@use "sass:list"; +$empty-slash-list: list.join((), (), $separator: slash); +a {b: list.join(1 2 3, $empty-slash-list)} <===> second/slash/output.css a { @@ -251,12 +275,14 @@ a { <===> ================================================================================ <===> map/first/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join($empty-map, ()); +$result: list.join(utils.$empty-map, ()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> map/first/undecided/output.css @@ -268,8 +294,9 @@ a { <===> ================================================================================ <===> map/first/space/input.scss -@import "core_functions/list/utils"; -a {b: join($empty-map, 1 2 3)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.$empty-map, 1 2 3)} <===> map/first/space/output.css a { @@ -279,8 +306,9 @@ a { <===> ================================================================================ <===> map/first/comma/input.scss -@import "core_functions/list/utils"; -a {b: join($empty-map, (1, 2, 3))} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.$empty-map, (1, 2, 3))} <===> map/first/comma/output.css a { @@ -291,8 +319,8 @@ a { ================================================================================ <===> map/first/slash/input.scss @use "sass:list"; -@import "core_functions/list/utils"; -a {b: join($empty-map, list.slash(1, 2, 3))} +@use "core_functions/list/utils"; +a {b: list.join(utils.$empty-map, list.slash(1, 2, 3))} <===> map/first/slash/output.css a { @@ -302,8 +330,9 @@ a { <===> ================================================================================ <===> map/second/space/input.scss -@import "core_functions/list/utils"; -a {b: join(1 2 3, $empty-map)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(1 2 3, utils.$empty-map)} <===> map/second/space/output.css a { @@ -313,8 +342,9 @@ a { <===> ================================================================================ <===> map/second/comma/input.scss -@import "core_functions/list/utils"; -a {b: join((1, 2, 3), $empty-map)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join((1, 2, 3), utils.$empty-map)} <===> map/second/comma/output.css a { @@ -325,8 +355,8 @@ a { ================================================================================ <===> map/second/slash/input.scss @use "sass:list"; -@import "core_functions/list/utils"; -a {b: join(list.slash(1, 2, 3), $empty-map)} +@use "core_functions/list/utils"; +a {b: list.join(list.slash(1, 2, 3), utils.$empty-map)} <===> map/second/slash/output.css a { @@ -336,12 +366,14 @@ a { <===> ================================================================================ <===> map/second/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join($empty-map, ()); +$result: list.join(utils.$empty-map, ()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> map/second/undecided/output.css diff --git a/spec/core_functions/list/join/error.hrx b/spec/core_functions/list/join/error.hrx index 67539f79da..71f237cfdb 100644 --- a/spec/core_functions/list/join/error.hrx +++ b/spec/core_functions/list/join/error.hrx @@ -7,93 +7,99 @@ invalid calls. <===> ================================================================================ <===> type/separator/input.scss -a {b: join(c, d, $separator: 1)} +@use "sass:list"; +a {b: list.join(c, d, $separator: 1)} <===> type/separator/error Error: $separator: 1 is not a string. , -1 | a {b: join(c, d, $separator: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.join(c, d, $separator: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many_args/input.scss -a {b: join(c, d, comma, true, false)} +@use "sass:list"; +a {b: list.join(c, d, comma, true, false)} <===> too_many_args/error Error: Only 4 arguments allowed, but 5 were passed. ,--> input.scss -1 | a {b: join(c, d, comma, true, false)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.join(c, d, comma, true, false)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function join($list1, $list2, $separator: auto, $bracketed: auto) { | ======================================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_few_args/input.scss -a {b: join(c)} +@use "sass:list"; +a {b: list.join(c)} <===> too_few_args/error Error: Missing argument $list2. ,--> input.scss -1 | a {b: join(c)} - | ^^^^^^^ invocation +2 | a {b: list.join(c)} + | ^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function join($list1, $list2, $separator: auto, $bracketed: auto) { | ======================================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: join(c, d, $invalid: true)} +@use "sass:list"; +a {b: list.join(c, d, $invalid: true)} <===> named/error Error: No argument named $invalid. ,--> input.scss -1 | a {b: join(c, d, $invalid: true)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.join(c, d, $invalid: true)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function join($list1, $list2, $separator: auto, $bracketed: auto) { | ======================================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> positional_and_named/input.scss -a {b: join(c, d, comma, true, false, $invalid: true)} +@use "sass:list"; +a {b: list.join(c, d, comma, true, false, $invalid: true)} <===> positional_and_named/error Error: Only 4 positional arguments allowed, but 5 were passed. ,--> input.scss -1 | a {b: join(c, d, comma, true, false, $invalid: true)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.join(c, d, comma, true, false, $invalid: true)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function join($list1, $list2, $separator: auto, $bracketed: auto) { | ======================================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unknown_separator/input.scss -a {b: join(c, d, $separator: e)} +@use "sass:list"; +a {b: list.join(c, d, $separator: e)} <===> unknown_separator/error Error: $separator: Must be "space", "comma", "slash", or "auto". , -1 | a {b: join(c, d, $separator: e)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.join(c, d, $separator: e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/join/multi.hrx b/spec/core_functions/list/join/multi.hrx index 5c954f50a5..f4e4cac197 100644 --- a/spec/core_functions/list/join/multi.hrx +++ b/spec/core_functions/list/join/multi.hrx @@ -1,5 +1,6 @@ <===> auto/separator/input.scss -a {b: join((c, d), e f, $separator: auto)} +@use "sass:list"; +a {b: list.join((c, d), e f, $separator: auto)} <===> auto/separator/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> auto/bracketed/input.scss -a {b: join(c d, e f, $bracketed: auto)} +@use "sass:list"; +a {b: list.join(c d, e f, $bracketed: auto)} <===> auto/bracketed/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> comma/both/input.scss -a {b: join((c, d), (e, f))} +@use "sass:list"; +a {b: list.join((c, d), (e, f))} <===> comma/both/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> comma/first/input.scss -a {b: join((c, d), e f)} +@use "sass:list"; +a {b: list.join((c, d), e f)} <===> comma/first/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> comma/second/input.scss -a {b: join(c d, (e, f))} +@use "sass:list"; +a {b: list.join(c d, (e, f))} <===> comma/second/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> comma/separator/forces_comma/input.scss -a {b: join(c, d, $separator: comma)} +@use "sass:list"; +a {b: list.join(c, d, $separator: comma)} <===> comma/separator/forces_comma/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> comma/separator/forces_not_comma/input.scss -a {b: join((c, d), (e, f), $separator: space)} +@use "sass:list"; +a {b: list.join((c, d), (e, f), $separator: space)} <===> comma/separator/forces_not_comma/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> space/both/input.scss -a {b: join(c d, e f)} +@use "sass:list"; +a {b: list.join(c d, e f)} <===> space/both/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> space/separator/forces_space/input.scss -a {b: join(c, d, $separator: space)} +@use "sass:list"; +a {b: list.join(c, d, $separator: space)} <===> space/separator/forces_space/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> space/separator/forces_not_space/input.scss -a {b: join(c d, e f, $separator: comma)} +@use "sass:list"; +a {b: list.join(c d, e f, $separator: comma)} <===> space/separator/forces_not_space/output.css a { @@ -100,7 +110,7 @@ a { ================================================================================ <===> slash/both/input.scss @use "sass:list"; -a {b: join(list.slash(c, d), list.slash(e, f))} +a {b: list.join(list.slash(c, d), list.slash(e, f))} <===> slash/both/output.css a { @@ -111,7 +121,7 @@ a { ================================================================================ <===> slash/first/input.scss @use "sass:list"; -a {b: join(list.slash(c, d), e f)} +a {b: list.join(list.slash(c, d), e f)} <===> slash/first/output.css a { @@ -122,7 +132,7 @@ a { ================================================================================ <===> slash/second/input.scss @use "sass:list"; -a {b: join(c d, list.slash(e, f))} +a {b: list.join(c d, list.slash(e, f))} <===> slash/second/output.css a { @@ -132,7 +142,8 @@ a { <===> ================================================================================ <===> slash/separator/forces_slash/input.scss -a {b: join(c, d, $separator: slash)} +@use "sass:list"; +a {b: list.join(c, d, $separator: slash)} <===> slash/separator/forces_slash/output.css a { @@ -143,7 +154,7 @@ a { ================================================================================ <===> slash/separator/forces_not_slash/input.scss @use "sass:list"; -a {b: join(list.slash(c, d), list.slash(e, f), $separator: space)} +a {b: list.join(list.slash(c, d), list.slash(e, f), $separator: space)} <===> slash/separator/forces_not_slash/output.css a { @@ -153,7 +164,8 @@ a { <===> ================================================================================ <===> bracketed/both/input.scss -a {b: join([c d], [e f])} +@use "sass:list"; +a {b: list.join([c d], [e f])} <===> bracketed/both/output.css a { @@ -163,7 +175,8 @@ a { <===> ================================================================================ <===> bracketed/first/input.scss -a {b: join([c d], e f)} +@use "sass:list"; +a {b: list.join([c d], e f)} <===> bracketed/first/output.css a { @@ -173,7 +186,8 @@ a { <===> ================================================================================ <===> bracketed/second/input.scss -a {b: join(c d, [e f])} +@use "sass:list"; +a {b: list.join(c d, [e f])} <===> bracketed/second/output.css a { @@ -183,7 +197,8 @@ a { <===> ================================================================================ <===> bracketed/true/input.scss -a {b: join(c, d, $bracketed: true)} +@use "sass:list"; +a {b: list.join(c, d, $bracketed: true)} <===> bracketed/true/output.css a { @@ -193,7 +208,8 @@ a { <===> ================================================================================ <===> bracketed/false/input.scss -a {b: join([c], [d], $bracketed: false)} +@use "sass:list"; +a {b: list.join([c], [d], $bracketed: false)} <===> bracketed/false/output.css a { @@ -203,7 +219,8 @@ a { <===> ================================================================================ <===> bracketed/and_separator/input.scss -a {b: join(c, d, $bracketed: true, $separator: comma)} +@use "sass:list"; +a {b: list.join(c, d, $bracketed: true, $separator: comma)} <===> bracketed/and_separator/output.css a { @@ -213,7 +230,8 @@ a { <===> ================================================================================ <===> bracketed/positional/input.scss -a {b: join(c, d, comma, true)} +@use "sass:list"; +a {b: list.join(c, d, comma, true)} <===> bracketed/positional/output.css a { @@ -223,7 +241,8 @@ a { <===> ================================================================================ <===> bracketed/truthy/input.scss -a {b: join(c, d, $bracketed: e)} +@use "sass:list"; +a {b: list.join(c, d, $bracketed: e)} <===> bracketed/truthy/output.css a { @@ -233,7 +252,8 @@ a { <===> ================================================================================ <===> bracketed/falsey/input.scss -a {b: join([c], [d], $bracketed: null)} +@use "sass:list"; +a {b: list.join([c], [d], $bracketed: null)} <===> bracketed/falsey/output.css a { @@ -243,7 +263,8 @@ a { <===> ================================================================================ <===> map/both/input.scss -a {b: join((c: d, e: f), (g: h, i: j))} +@use "sass:list"; +a {b: list.join((c: d, e: f), (g: h, i: j))} <===> map/both/output.css a { @@ -253,7 +274,9 @@ a { <===> ================================================================================ <===> map/first/space/input.scss -a {b: inspect(join((c: d, e: f), g h))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.join((c: d, e: f), g h))} <===> map/first/space/output.css a { @@ -263,7 +286,8 @@ a { <===> ================================================================================ <===> map/first/comma/input.scss -a {b: join((c: d, e: f), (g, h))} +@use "sass:list"; +a {b: list.join((c: d, e: f), (g, h))} <===> map/first/comma/output.css a { @@ -274,7 +298,7 @@ a { ================================================================================ <===> map/first/slash/input.scss @use "sass:list"; -a {b: join((c: d, e: f), list.slash(g, h))} +a {b: list.join((c: d, e: f), list.slash(g, h))} <===> map/first/slash/output.css a { @@ -284,8 +308,10 @@ a { <===> ================================================================================ <===> map/second/space/input.scss +@use "sass:list"; +@use "sass:meta"; // Use inspect() to prove that the map is converted to a list of pairs. -a {b: inspect(join(c d, (e: f, g: h)))} +a {b: meta.inspect(list.join(c d, (e: f, g: h)))} <===> map/second/space/output.css a { @@ -295,7 +321,8 @@ a { <===> ================================================================================ <===> map/second/comma/input.scss -a {b: join((c, d), (e: f, g: h))} +@use "sass:list"; +a {b: list.join((c, d), (e: f, g: h))} <===> map/second/comma/output.css a { @@ -306,7 +333,7 @@ a { ================================================================================ <===> map/second/slash/input.scss @use "sass:list"; -a {b: join(list.slash(c, d), (e: f, g: h))} +a {b: list.join(list.slash(c, d), (e: f, g: h))} <===> map/second/slash/output.css a { @@ -316,7 +343,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: join($list1: a b, $list2: c d, $separator: comma, $bracketed: true)} +@use "sass:list"; +a {b: list.join($list1: a b, $list2: c d, $separator: comma, $bracketed: true)} <===> named/output.css a { diff --git a/spec/core_functions/list/join/single.hrx b/spec/core_functions/list/join/single.hrx index 50ff260962..939d37d851 100644 --- a/spec/core_functions/list/join/single.hrx +++ b/spec/core_functions/list/join/single.hrx @@ -1,5 +1,6 @@ <===> both/undecided/input.scss -a {b: join([1], [2])} +@use "sass:list"; +a {b: list.join([1], [2])} <===> both/undecided/output.css a { @@ -9,8 +10,9 @@ a { <===> ================================================================================ <===> both/space/first/input.scss -@import "core_functions/list/utils"; -a {b: join(with-separator(1, space), [2])} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.with-separator(1, space), [2])} <===> both/space/first/output.css a { @@ -20,8 +22,9 @@ a { <===> ================================================================================ <===> both/space/last/input.scss -@import "core_functions/list/utils"; -a {b: join([1], with-separator(2, space))} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join([1], utils.with-separator(2, space))} <===> both/space/last/output.css a { @@ -31,8 +34,9 @@ a { <===> ================================================================================ <===> both/comma/first/input.scss -@import "core_functions/list/utils"; -a {b: join((1,), [2])} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join((1,), [2])} <===> both/comma/first/output.css a { @@ -42,9 +46,10 @@ a { <===> ================================================================================ <===> both/comma/last/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "core_functions/list/utils"; -a {b: join([1], (2,))} +a {b: list.join([1], (2,))} <===> both/comma/last/output.css a { @@ -54,7 +59,8 @@ a { <===> ================================================================================ <===> both/slash/first/input.scss -a {b: join(join(1, (), $separator: slash), [2])} +@use "sass:list"; +a {b: list.join(list.join(1, (), $separator: slash), [2])} <===> both/slash/first/output.css a { @@ -64,7 +70,8 @@ a { <===> ================================================================================ <===> both/slash/last/input.scss -a {b: join([1], join(2, (), $separator: slash))} +@use "sass:list"; +a {b: list.join([1], list.join(2, (), $separator: slash))} <===> both/slash/last/output.css a { @@ -74,7 +81,8 @@ a { <===> ================================================================================ <===> first/undecided/and_space/input.scss -a {b: join([1], 2 3 4)} +@use "sass:list"; +a {b: list.join([1], 2 3 4)} <===> first/undecided/and_space/output.css a { @@ -84,7 +92,8 @@ a { <===> ================================================================================ <===> first/undecided/and_comma/input.scss -a {b: join([1], (2, 3, 4))} +@use "sass:list"; +a {b: list.join([1], (2, 3, 4))} <===> first/undecided/and_comma/output.css a { @@ -95,7 +104,7 @@ a { ================================================================================ <===> first/undecided/and_slash/input.scss @use "sass:list"; -a {b: join([1], list.slash(2, 3, 4))} +a {b: list.join([1], list.slash(2, 3, 4))} <===> first/undecided/and_slash/output.css a { @@ -105,8 +114,9 @@ a { <===> ================================================================================ <===> first/space/input.scss -@import "core_functions/list/utils"; -a {b: join(with-separator(1, space), (2, 3, 4))} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join(utils.with-separator(1, space), (2, 3, 4))} <===> first/space/output.css a { @@ -116,7 +126,8 @@ a { <===> ================================================================================ <===> first/comma/input.scss -a {b: join((1,), 2 3 4)} +@use "sass:list"; +a {b: list.join((1,), 2 3 4)} <===> first/comma/output.css a { @@ -126,7 +137,8 @@ a { <===> ================================================================================ <===> first/slash/input.scss -a {b: join(join(1, (), $separator: slash), 2 3 4)} +@use "sass:list"; +a {b: list.join(list.join(1, (), $separator: slash), 2 3 4)} <===> first/slash/output.css a { @@ -136,7 +148,8 @@ a { <===> ================================================================================ <===> second/undecided/space/input.scss -a {b: join(1 2 3, [4])} +@use "sass:list"; +a {b: list.join(1 2 3, [4])} <===> second/undecided/space/output.css a { @@ -146,7 +159,8 @@ a { <===> ================================================================================ <===> second/undecided/comma/input.scss -a {b: join((1, 2, 3), [4])} +@use "sass:list"; +a {b: list.join((1, 2, 3), [4])} <===> second/undecided/comma/output.css a { @@ -157,7 +171,7 @@ a { ================================================================================ <===> second/undecided/slash/input.scss @use "sass:list"; -a {b: join(list.slash(1, 2, 3), [4])} +a {b: list.join(list.slash(1, 2, 3), [4])} <===> second/undecided/slash/output.css a { @@ -167,8 +181,9 @@ a { <===> ================================================================================ <===> second/space/input.scss -@import "core_functions/list/utils"; -a {b: join((1, 2, 3), with-separator(4, space))} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.join((1, 2, 3), utils.with-separator(4, space))} <===> second/space/output.css a { @@ -178,7 +193,8 @@ a { <===> ================================================================================ <===> second/comma/input.scss -a {b: join(1 2 3, (4,))} +@use "sass:list"; +a {b: list.join(1 2 3, (4,))} <===> second/comma/output.css a { @@ -188,7 +204,8 @@ a { <===> ================================================================================ <===> second/slash/input.scss -a {b: join(1 2 3, join(4, (), $separator: slash))} +@use "sass:list"; +a {b: list.join(1 2 3, list.join(4, (), $separator: slash))} <===> second/slash/output.css a { @@ -198,7 +215,8 @@ a { <===> ================================================================================ <===> non_list/both/input.scss -a {b: join(c, d)} +@use "sass:list"; +a {b: list.join(c, d)} <===> non_list/both/output.css a { @@ -208,7 +226,9 @@ a { <===> ================================================================================ <===> non_list/first/space/input.scss -a {b: inspect(join(c, d e))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.join(c, d e))} <===> non_list/first/space/output.css a { @@ -218,7 +238,8 @@ a { <===> ================================================================================ <===> non_list/first/comma/input.scss -a {b: join(c, (d, e))} +@use "sass:list"; +a {b: list.join(c, (d, e))} <===> non_list/first/comma/output.css a { @@ -229,7 +250,7 @@ a { ================================================================================ <===> non_list/first/slash/input.scss @use "sass:list"; -a {b: join(c, list.slash(d, e))} +a {b: list.join(c, list.slash(d, e))} <===> non_list/first/slash/output.css a { @@ -239,16 +260,18 @@ a { <===> ================================================================================ <===> non_list/first/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join(c, ()); +$result: list.join(c, ()); a { - value: inspect($result); - type: type-of($result); + value: meta.inspect($result); + type: meta.type-of($result); // Note: LibSass's output here is strange but not strictly-speaking wrong. // See sass/libsass#2926 for details. - separator: real-separator($result); + separator: utils.real-separator($result); } <===> non_list/first/undecided/output.css @@ -261,7 +284,9 @@ a { <===> ================================================================================ <===> non_list/second/space/input.scss -a {b: inspect(join(c d, e))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.join(c d, e))} <===> non_list/second/space/output.css a { @@ -271,7 +296,8 @@ a { <===> ================================================================================ <===> non_list/second/comma/input.scss -a {b: join((c, d), e)} +@use "sass:list"; +a {b: list.join((c, d), e)} <===> non_list/second/comma/output.css a { @@ -282,7 +308,7 @@ a { ================================================================================ <===> non_list/second/slash/input.scss @use "sass:list"; -a {b: join(list.slash(c, d), e)} +a {b: list.join(list.slash(c, d), e)} <===> non_list/second/slash/output.css a { @@ -292,16 +318,18 @@ a { <===> ================================================================================ <===> non_list/second/undecided/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: join((), c); +$result: list.join((), c); a { - value: inspect($result); - type: type-of($result); + value: meta.inspect($result); + type: meta.type-of($result); // Note: LibSass's output here is strange but not strictly-speaking wrong. // See sass/libsass#2926 for details. - separator: real-separator($result); + separator: utils.real-separator($result); } <===> non_list/second/undecided/output.css diff --git a/spec/core_functions/list/length.hrx b/spec/core_functions/list/length.hrx index e0a70ff077..79f2db68dd 100644 --- a/spec/core_functions/list/length.hrx +++ b/spec/core_functions/list/length.hrx @@ -1,5 +1,6 @@ <===> 0/input.scss -a {b: length(())} +@use "sass:list"; +a {b: list.length(())} <===> 0/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> 1/input.scss -a {b: length(join((), 1))} +@use "sass:list"; +a {b: list.length(list.join((), 1))} <===> 1/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> 2/input.scss -a {b: length(c d)} +@use "sass:list"; +a {b: list.length(c d)} <===> 2/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> many/input.scss -a {b: length((1, 2, 3, 4, 5))} +@use "sass:list"; +a {b: list.length((1, 2, 3, 4, 5))} <===> many/output.css a { @@ -39,8 +43,9 @@ a { <===> ================================================================================ <===> map/empty/input.scss -@import "core_functions/list/utils"; -a {b: length($empty-map)} +@use "sass:list"; +@use "core_functions/list/utils"; +a {b: list.length(utils.$empty-map)} <===> map/empty/output.css a { @@ -50,7 +55,8 @@ a { <===> ================================================================================ <===> map/non_empty/input.scss -a {b: length((1: 2, 3: 4))} +@use "sass:list"; +a {b: list.length((1: 2, 3: 4))} <===> map/non_empty/output.css a { @@ -60,7 +66,8 @@ a { <===> ================================================================================ <===> non_list/input.scss -a {b: length(c)} +@use "sass:list"; +a {b: list.length(c)} <===> non_list/output.css a { @@ -70,8 +77,9 @@ a { <===> ================================================================================ <===> null_list_item/input.scss +@use "sass:list"; // regression test for scssphp/scssphp#403 -a {b: length((null))} +a {b: list.length((null))} <===> null_list_item/output.css a { @@ -81,7 +89,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: length($list: 1 2 3)} +@use "sass:list"; +a {b: list.length($list: 1 2 3)} <===> named/output.css a { @@ -91,33 +100,35 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: length()} +@use "sass:list"; +a {b: list.length()} <===> error/too_few_args/error Error: Missing argument $list. ,--> input.scss -1 | a {b: length()} - | ^^^^^^^^ invocation +2 | a {b: list.length()} + | ^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function length($list) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: length(1, 2)} +@use "sass:list"; +a {b: list.length(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: length(1, 2)} - | ^^^^^^^^^^^^ invocation +2 | a {b: list.length(1, 2)} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function length($list) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/nth.hrx b/spec/core_functions/list/nth.hrx index bc282f1ebf..1a1977b9c4 100644 --- a/spec/core_functions/list/nth.hrx +++ b/spec/core_functions/list/nth.hrx @@ -1,5 +1,6 @@ <===> 1/of_1/input.scss -a {b: nth(join((), c), 1)} +@use "sass:list"; +a {b: list.nth(list.join((), c), 1)} <===> 1/of_1/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> 1/of_2/input.scss -a {b: nth(c d, 1)} +@use "sass:list"; +a {b: list.nth(c d, 1)} <===> 1/of_2/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> 2/of_2/input.scss -a {b: nth(c d, 2)} +@use "sass:list"; +a {b: list.nth(c d, 2)} <===> 2/of_2/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> 2/of_4/input.scss -a {b: nth(c d e f, 2)} +@use "sass:list"; +a {b: list.nth(c d e f, 2)} <===> 2/of_4/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> negative/1/of_1/input.scss -a {b: nth(join((), c), -1)} +@use "sass:list"; +a {b: list.nth(list.join((), c), -1)} <===> negative/1/of_1/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> negative/1/of_2/input.scss -a {b: nth(c d, -1)} +@use "sass:list"; +a {b: list.nth(c d, -1)} <===> negative/1/of_2/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> negative/2/of_2/input.scss -a {b: nth(c d, -2)} +@use "sass:list"; +a {b: list.nth(c d, -2)} <===> negative/2/of_2/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> negative/2/of_4/input.scss -a {b: nth(c d e f, -2)} +@use "sass:list"; +a {b: list.nth(c d e f, -2)} <===> negative/2/of_4/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> map/input.scss -a {b: nth((c: d, e: f, g: h), 2)} +@use "sass:list"; +a {b: list.nth((c: d, e: f, g: h), 2)} <===> map/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> non_list/input.scss -a {b: nth(c, 1)} +@use "sass:list"; +a {b: list.nth(c, 1)} <===> non_list/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: nth($list: c d, $n: 1)} +@use "sass:list"; +a {b: list.nth($list: c d, $n: 1)} <===> named/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> bracketed/input.scss -a {b: nth([c, d], 2)} +@use "sass:list"; +a {b: list.nth([c, d], 2)} <===> bracketed/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> units/input.scss -a {b: nth(c d, 1px)} +@use "sass:list"; +a {b: list.nth(c d, 1px)} <===> units/output.css a { @@ -134,93 +147,99 @@ To preserve current behavior: calc($n / 1px) More info: https://sass-lang.com/d/function-units , -1 | a {b: nth(c d, 1px)} - | ^^^^^^^^^^^^^ +2 | a {b: list.nth(c d, 1px)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: nth(c d, e)} +@use "sass:list"; +a {b: list.nth(c d, e)} <===> error/type/error Error: $n: e is not a number. , -1 | a {b: nth(c d, e)} - | ^^^^^^^^^^^ +2 | a {b: list.nth(c d, e)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/0/input.scss -a {b: nth(c d, 0)} +@use "sass:list"; +a {b: list.nth(c d, 0)} <===> error/index/0/error Error: $n: List index may not be 0. , -1 | a {b: nth(c d, 0)} - | ^^^^^^^^^^^ +2 | a {b: list.nth(c d, 0)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_high/input.scss -a {b: nth(c d, 3)} +@use "sass:list"; +a {b: list.nth(c d, 3)} <===> error/index/too_high/error Error: $n: Invalid index 3 for a list with 2 elements. , -1 | a {b: nth(c d, 3)} - | ^^^^^^^^^^^ +2 | a {b: list.nth(c d, 3)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_low/input.scss -a {b: nth(c d, -3)} +@use "sass:list"; +a {b: list.nth(c d, -3)} <===> error/index/too_low/error Error: $n: Invalid index -3 for a list with 2 elements. , -1 | a {b: nth(c d, -3)} - | ^^^^^^^^^^^^ +2 | a {b: list.nth(c d, -3)} + | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: nth(c d)} +@use "sass:list"; +a {b: list.nth(c d)} <===> error/too_few_args/error Error: Missing argument $n. ,--> input.scss -1 | a {b: nth(c d)} - | ^^^^^^^^ invocation +2 | a {b: list.nth(c d)} + | ^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function nth($list, $n) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: nth(c d, 1, 2)} +@use "sass:list"; +a {b: list.nth(c d, 1, 2)} <===> error/too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: nth(c d, 1, 2)} - | ^^^^^^^^^^^^^^ invocation +2 | a {b: list.nth(c d, 1, 2)} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function nth($list, $n) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/separator.hrx b/spec/core_functions/list/separator.hrx index 274ae1c272..82215dcdf3 100644 --- a/spec/core_functions/list/separator.hrx +++ b/spec/core_functions/list/separator.hrx @@ -1,5 +1,6 @@ <===> empty/space/input.scss -a {b: list-separator(())} +@use "sass:list"; +a {b: list.separator(())} <===> empty/space/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> empty/comma/input.scss -a {b: list-separator(join((), (), comma))} +@use "sass:list"; +a {b: list.separator(list.join((), (), comma))} <===> empty/comma/output.css a { @@ -19,9 +21,10 @@ a { <===> ================================================================================ <===> empty/map/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "core_functions/list/utils"; -a {b: list-separator($empty-map)} +a {b: list.separator(utils.$empty-map)} <===> empty/map/output.css a { @@ -31,7 +34,8 @@ a { <===> ================================================================================ <===> single/space/input.scss -a {b: list-separator([1])} +@use "sass:list"; +a {b: list.separator([1])} <===> single/space/output.css a { @@ -41,7 +45,8 @@ a { <===> ================================================================================ <===> single/comma/input.scss -a {b: list-separator((1,))} +@use "sass:list"; +a {b: list.separator((1,))} <===> single/comma/output.css a { @@ -51,7 +56,8 @@ a { <===> ================================================================================ <===> single/slash/input.scss -a {b: list-separator(join(1, (), $separator: slash))} +@use "sass:list"; +a {b: list.separator(list.join(1, (), $separator: slash))} <===> single/slash/output.css a { @@ -61,7 +67,8 @@ a { <===> ================================================================================ <===> single/non_list/input.scss -a {b: list-separator(1)} +@use "sass:list"; +a {b: list.separator(1)} <===> single/non_list/output.css a { @@ -71,7 +78,8 @@ a { <===> ================================================================================ <===> multi/space/input.scss -a {b: list-separator(1 2 3)} +@use "sass:list"; +a {b: list.separator(1 2 3)} <===> multi/space/output.css a { @@ -81,7 +89,8 @@ a { <===> ================================================================================ <===> multi/comma/input.scss -a {b: list-separator((1, 2, 3))} +@use "sass:list"; +a {b: list.separator((1, 2, 3))} <===> multi/comma/output.css a { @@ -92,7 +101,7 @@ a { ================================================================================ <===> multi/slash/input.scss @use 'sass:list'; -a {b: list-separator(list.slash(1, 2, 3))} +a {b: list.separator(list.slash(1, 2, 3))} <===> multi/slash/output.css a { @@ -102,7 +111,8 @@ a { <===> ================================================================================ <===> multi/map/input.scss -a {b: list-separator((c: d, e: f, g: h))} +@use "sass:list"; +a {b: list.separator((c: d, e: f, g: h))} <===> multi/map/output.css a { @@ -112,7 +122,8 @@ a { <===> ================================================================================ <===> bracketed/input.scss -a {b: list-separator([c, d])} +@use "sass:list"; +a {b: list.separator([c, d])} <===> bracketed/output.css a { @@ -122,33 +133,35 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: list-separator()} +@use "sass:list"; +a {b: list.separator()} <===> error/too_few_args/error Error: Missing argument $list. ,--> input.scss -1 | a {b: list-separator()} +2 | a {b: list.separator()} | ^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function separator($list) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: list-separator(c, d)} +@use "sass:list"; +a {b: list.separator(c, d)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: list-separator(c, d)} +2 | a {b: list.separator(c, d)} | ^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function separator($list) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/set_nth.hrx b/spec/core_functions/list/set_nth.hrx index fc8c018d99..acf23ea78c 100644 --- a/spec/core_functions/list/set_nth.hrx +++ b/spec/core_functions/list/set_nth.hrx @@ -1,8 +1,10 @@ <===> 1/of_1/input.scss -$result: set-nth(join((), b), 1, c); +@use "sass:list"; +@use "sass:meta"; +$result: list.set-nth(list.join((), b), 1, c); a { result: $result; - type: type-of($result); + type: meta.type-of($result); } <===> 1/of_1/output.css @@ -14,7 +16,8 @@ a { <===> ================================================================================ <===> 1/of_2/input.scss -a {b: set-nth(c d, 1, e)} +@use "sass:list"; +a {b: list.set-nth(c d, 1, e)} <===> 1/of_2/output.css a { @@ -24,7 +27,8 @@ a { <===> ================================================================================ <===> 2/of_2/input.scss -a {b: set-nth(c d, 2, e)} +@use "sass:list"; +a {b: list.set-nth(c d, 2, e)} <===> 2/of_2/output.css a { @@ -34,7 +38,8 @@ a { <===> ================================================================================ <===> 2/of_4/input.scss -a {b: set-nth(c d e f, 2, g)} +@use "sass:list"; +a {b: list.set-nth(c d e f, 2, g)} <===> 2/of_4/output.css a { @@ -44,10 +49,12 @@ a { <===> ================================================================================ <===> negative/1/of_1/input.scss -$result: set-nth(join((), b), -1, c); +@use "sass:list"; +@use "sass:meta"; +$result: list.set-nth(list.join((), b), -1, c); a { result: $result; - type: type-of($result); + type: meta.type-of($result); } <===> negative/1/of_1/output.css @@ -59,7 +66,8 @@ a { <===> ================================================================================ <===> negative/1/of_2/input.scss -a {b: set-nth(c d, -1, e)} +@use "sass:list"; +a {b: list.set-nth(c d, -1, e)} <===> negative/1/of_2/output.css a { @@ -69,7 +77,8 @@ a { <===> ================================================================================ <===> negative/2/of_2/input.scss -a {b: set-nth(c d, -2, e)} +@use "sass:list"; +a {b: list.set-nth(c d, -2, e)} <===> negative/2/of_2/output.css a { @@ -79,7 +88,8 @@ a { <===> ================================================================================ <===> negative/2/of_4/input.scss -a {b: set-nth(c d e f, -2, g)} +@use "sass:list"; +a {b: list.set-nth(c d e f, -2, g)} <===> negative/2/of_4/output.css a { @@ -89,7 +99,8 @@ a { <===> ================================================================================ <===> map/input.scss -a {b: set-nth((c: d, e: f, g: h), 2, i)} +@use "sass:list"; +a {b: list.set-nth((c: d, e: f, g: h), 2, i)} <===> map/output.css a { @@ -99,10 +110,12 @@ a { <===> ================================================================================ <===> non_list/input.scss -$result: set-nth(b, 1, c); +@use "sass:list"; +@use "sass:meta"; +$result: list.set-nth(b, 1, c); a { result: $result; - type: type-of($result); + type: meta.type-of($result); } <===> non_list/output.css @@ -114,7 +127,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: set-nth($list: c d, $n: 1, $value: e)} +@use "sass:list"; +a {b: list.set-nth($list: c d, $n: 1, $value: e)} <===> named/output.css a { @@ -124,7 +138,8 @@ a { <===> ================================================================================ <===> bracketed/input.scss -a {b: set-nth([c, d], 2, e)} +@use "sass:list"; +a {b: list.set-nth([c, d], 2, e)} <===> bracketed/output.css a { @@ -134,7 +149,8 @@ a { <===> ================================================================================ <===> units/input.scss -a {b: set-nth(c d, 1px, e)} +@use "sass:list"; +a {b: list.set-nth(c d, 1px, e)} <===> units/output.css a { @@ -149,93 +165,99 @@ To preserve current behavior: calc($n / 1px) More info: https://sass-lang.com/d/function-units , -1 | a {b: set-nth(c d, 1px, e)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.set-nth(c d, 1px, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: set-nth(c d, e, f)} +@use "sass:list"; +a {b: list.set-nth(c d, e, f)} <===> error/type/error Error: $n: e is not a number. , -1 | a {b: set-nth(c d, e, f)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: list.set-nth(c d, e, f)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/0/input.scss -a {b: set-nth(c d, 0, e)} +@use "sass:list"; +a {b: list.set-nth(c d, 0, e)} <===> error/index/0/error Error: $n: List index may not be 0. , -1 | a {b: set-nth(c d, 0, e)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: list.set-nth(c d, 0, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_high/input.scss -a {b: set-nth(c d, 3, e)} +@use "sass:list"; +a {b: list.set-nth(c d, 3, e)} <===> error/index/too_high/error Error: $n: Invalid index 3 for a list with 2 elements. , -1 | a {b: set-nth(c d, 3, e)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: list.set-nth(c d, 3, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_low/input.scss -a {b: set-nth(c d, -3, e)} +@use "sass:list"; +a {b: list.set-nth(c d, -3, e)} <===> error/index/too_low/error Error: $n: Invalid index -3 for a list with 2 elements. , -1 | a {b: set-nth(c d, -3, e)} - | ^^^^^^^^^^^^^^^^^^^ +2 | a {b: list.set-nth(c d, -3, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_few_args/input.scss -a {b: set-nth(c d, 1)} +@use "sass:list"; +a {b: list.set-nth(c d, 1)} <===> error/index/too_few_args/error Error: Missing argument $value. ,--> input.scss -1 | a {b: set-nth(c d, 1)} - | ^^^^^^^^^^^^^^^ invocation +2 | a {b: list.set-nth(c d, 1)} + | ^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function set-nth($list, $n, $value) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/index/too_many_args/input.scss -a {b: set-nth(c d, 1, 2, 3)} +@use "sass:list"; +a {b: list.set-nth(c d, 1, 2, 3)} <===> error/index/too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: set-nth(c d, 1, 2, 3)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: list.set-nth(c d, 1, 2, 3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:list 1 | @function set-nth($list, $n, $value) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/list/utils.hrx b/spec/core_functions/list/utils.hrx index 3de41a7d62..bf4339943a 100644 --- a/spec/core_functions/list/utils.hrx +++ b/spec/core_functions/list/utils.hrx @@ -4,8 +4,8 @@ These tests verify that `_utils.scss` works as intended. <===> ================================================================================ <===> real_separator/empty/undecided/input.scss -@import "core_functions/list/utils"; -a {b: real-separator(())} +@use "core_functions/list/utils"; +a {b: utils.real-separator(())} <===> real_separator/empty/undecided/output.css a { @@ -15,8 +15,8 @@ a { <===> ================================================================================ <===> real_separator/empty/space/input.scss -@import "core_functions/list/utils"; -a {b: real-separator($empty-space-list)} +@use "core_functions/list/utils"; +a {b: utils.real-separator(utils.$empty-space-list)} <===> real_separator/empty/space/output.css a { @@ -26,8 +26,8 @@ a { <===> ================================================================================ <===> real_separator/empty/comma/input.scss -@import "core_functions/list/utils"; -a {b: real-separator($empty-comma-list)} +@use "core_functions/list/utils"; +a {b: utils.real-separator(utils.$empty-comma-list)} <===> real_separator/empty/comma/output.css a { @@ -37,8 +37,8 @@ a { <===> ================================================================================ <===> real_separator/single/undecided/input.scss -@import "core_functions/list/utils"; -a {b: real-separator([1])} +@use "core_functions/list/utils"; +a {b: utils.real-separator([1])} <===> real_separator/single/undecided/output.css a { @@ -48,8 +48,8 @@ a { <===> ================================================================================ <===> real_separator/single/comma/input.scss -@import "core_functions/list/utils"; -a {b: real-separator((1,))} +@use "core_functions/list/utils"; +a {b: utils.real-separator((1,))} <===> real_separator/single/comma/output.css a { @@ -59,8 +59,8 @@ a { <===> ================================================================================ <===> real_separator/multi/space/input.scss -@import "core_functions/list/utils"; -a {b: real-separator(1 2)} +@use "core_functions/list/utils"; +a {b: utils.real-separator(1 2)} <===> real_separator/multi/space/output.css a { @@ -70,8 +70,8 @@ a { <===> ================================================================================ <===> real_separator/multi/comma/input.scss -@import "core_functions/list/utils"; -a {b: real-separator((1, 2))} +@use "core_functions/list/utils"; +a {b: utils.real-separator((1, 2))} <===> real_separator/multi/comma/output.css a { @@ -81,8 +81,8 @@ a { <===> ================================================================================ <===> with_separator/single/space/input.scss -@import "core_functions/list/utils"; -a {b: real-separator(with-separator((1,), space))} +@use "core_functions/list/utils"; +a {b: utils.real-separator(utils.with-separator((1,), space))} <===> with_separator/single/space/output.css a { @@ -92,8 +92,8 @@ a { <===> ================================================================================ <===> with_separator/single/comma/input.scss -@import "core_functions/list/utils"; -a {b: real-separator(with-separator([1], comma))} +@use "core_functions/list/utils"; +a {b: utils.real-separator(utils.with-separator([1], comma))} <===> with_separator/single/comma/output.css a { @@ -103,8 +103,8 @@ a { <===> ================================================================================ <===> with_separator/multi/space/input.scss -@import "core_functions/list/utils"; -a {b: with-separator((1, 2), space)} +@use "core_functions/list/utils"; +a {b: utils.with-separator((1, 2), space)} <===> with_separator/multi/space/output.css a { @@ -114,8 +114,8 @@ a { <===> ================================================================================ <===> with_separator/multi/comma/input.scss -@import "core_functions/list/utils"; -a {b: with-separator(1 2, comma)} +@use "core_functions/list/utils"; +a {b: utils.with-separator(1 2, comma)} <===> with_separator/multi/comma/output.css a { @@ -125,8 +125,8 @@ a { <===> ================================================================================ <===> empty_map/same_as_empty_list/input.scss -@import "core_functions/list/utils"; -a {b: $empty-map == ()} +@use "core_functions/list/utils"; +a {b: utils.$empty-map == ()} <===> empty_map/same_as_empty_list/output.css a { diff --git a/spec/core_functions/list/zip.hrx b/spec/core_functions/list/zip.hrx index a05a2401e2..7a4565c006 100644 --- a/spec/core_functions/list/zip.hrx +++ b/spec/core_functions/list/zip.hrx @@ -7,12 +7,14 @@ passing invalid named parameters, it has no error tests. <===> ================================================================================ <===> no_lists/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: zip(); +$result: list.zip(); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> no_lists/output.css @@ -24,12 +26,14 @@ a { <===> ================================================================================ <===> one_list/empty/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: zip(()); +$result: list.zip(()); a { - value: inspect($result); - separator: real-separator($result); + value: meta.inspect($result); + separator: utils.real-separator($result); } <===> one_list/empty/output.css @@ -41,16 +45,18 @@ a { <===> ================================================================================ <===> one_list/space/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: zip(1 2 3); -$element: nth($result, 2); +$result: list.zip(1 2 3); +$element: list.nth($result, 2); a { value: $result; element: $element { - type: type-of($element); - separator: real-separator($element); + type: meta.type-of($element); + separator: utils.real-separator($element); } } @@ -65,16 +71,18 @@ a { <===> ================================================================================ <===> one_list/comma/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: zip((1, 2, 3)); -$element: nth($result, 2); +$result: list.zip((1, 2, 3)); +$element: list.nth($result, 2); a { value: $result; element: $element { - type: type-of($element); - separator: real-separator($element); + type: meta.type-of($element); + separator: utils.real-separator($element); } } @@ -89,16 +97,18 @@ a { <===> ================================================================================ <===> one_list/bracketed/input.scss -@import "core_functions/list/utils"; +@use "sass:list"; +@use "sass:meta"; +@use "core_functions/list/utils"; -$result: zip([1 2 3]); -$element: nth($result, 2); +$result: list.zip([1 2 3]); +$element: list.nth($result, 2); a { value: $result; element: $element { - type: type-of($element); - separator: real-separator($element); + type: meta.type-of($element); + separator: utils.real-separator($element); } } @@ -113,7 +123,9 @@ a { <===> ================================================================================ <===> two_lists/first_empty/input.scss -a {b: inspect(zip((), 1 2 3))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.zip((), 1 2 3))} <===> two_lists/first_empty/output.css a { @@ -123,7 +135,9 @@ a { <===> ================================================================================ <===> two_lists/second_empty/input.scss -a {b: inspect(zip(1 2 3, ()))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.zip(1 2 3, ()))} <===> two_lists/second_empty/output.css a { @@ -133,7 +147,8 @@ a { <===> ================================================================================ <===> two_lists/first_longer/input.scss -a {b: zip(1 2 3 4, c d)} +@use "sass:list"; +a {b: list.zip(1 2 3 4, c d)} <===> two_lists/first_longer/output.css a { @@ -143,7 +158,8 @@ a { <===> ================================================================================ <===> two_lists/second_longer/input.scss -a {b: zip(1 2, c d e f)} +@use "sass:list"; +a {b: list.zip(1 2, c d e f)} <===> two_lists/second_longer/output.css a { @@ -153,7 +169,8 @@ a { <===> ================================================================================ <===> two_lists/same_length/input.scss -a {b: zip(1 2 3, c d e)} +@use "sass:list"; +a {b: list.zip(1 2 3, c d e)} <===> two_lists/same_length/output.css a { @@ -163,7 +180,8 @@ a { <===> ================================================================================ <===> three_lists/input.scss -a {b: zip(1 2 3, c d e, red green blue)} +@use "sass:list"; +a {b: list.zip(1 2 3, c d e, red green blue)} <===> three_lists/output.css a { @@ -173,7 +191,10 @@ a { <===> ================================================================================ <===> map/empty/input.scss -a {b: inspect(zip(map-remove((c: d), c)))} +@use "sass:list"; +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(list.zip(map.remove((c: d), c)))} <===> map/empty/output.css a { @@ -183,7 +204,9 @@ a { <===> ================================================================================ <===> map/non_empty/input.scss -a {b: inspect(zip((c: d, e: f, g: h), 1 2 3))} +@use "sass:list"; +@use "sass:meta"; +a {b: meta.inspect(list.zip((c: d, e: f, g: h), 1 2 3))} <===> map/non_empty/output.css a { @@ -193,7 +216,8 @@ a { <===> ================================================================================ <===> non_list/input.scss -a {b: zip(c, d, e)} +@use "sass:list"; +a {b: list.zip(c, d, e)} <===> non_list/output.css a { diff --git a/spec/core_functions/map/deep_merge.hrx b/spec/core_functions/map/deep_merge.hrx index aff4cba084..2cb849a0c2 100644 --- a/spec/core_functions/map/deep_merge.hrx +++ b/spec/core_functions/map/deep_merge.hrx @@ -1,6 +1,7 @@ <===> shallow/empty/both/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((), ()))} +a {b: meta.inspect(map.deep-merge((), ()))} <===> shallow/empty/both/output.css a { @@ -10,8 +11,9 @@ a { <===> ================================================================================ <===> shallow/empty/first/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((), (c: d, e: f)))} +a {b: meta.inspect(map.deep-merge((), (c: d, e: f)))} <===> shallow/empty/first/output.css a { @@ -21,8 +23,9 @@ a { <===> ================================================================================ <===> shallow/empty/second/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: d, e: f), ()))} +a {b: meta.inspect(map.deep-merge((c: d, e: f), ()))} <===> shallow/empty/second/output.css a { @@ -32,8 +35,9 @@ a { <===> ================================================================================ <===> shallow/different_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: d, e: f), (1: 2, 3: 4)))} +a {b: meta.inspect(map.deep-merge((c: d, e: f), (1: 2, 3: 4)))} <===> shallow/different_keys/output.css a { @@ -43,8 +47,9 @@ a { <===> ================================================================================ <===> shallow/same_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: d, e: f), (c: 1, e: 2)))} +a {b: meta.inspect(map.deep-merge((c: d, e: f), (c: 1, e: 2)))} <===> shallow/same_keys/output.css a { @@ -54,8 +59,9 @@ a { <===> ================================================================================ <===> shallow/overlapping_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: d, e: f, g: h), (i: 1, e: 2, j: 3)))} +a {b: meta.inspect(map.deep-merge((c: d, e: f, g: h), (i: 1, e: 2, j: 3)))} <===> shallow/overlapping_keys/output.css a { @@ -65,8 +71,9 @@ a { <===> ================================================================================ <===> deep/empty/first/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: ()), (c: (d: e))))} +a {b: meta.inspect(map.deep-merge((c: ()), (c: (d: e))))} <===> deep/empty/first/output.css a { @@ -76,8 +83,9 @@ a { <===> ================================================================================ <===> deep/empty/second/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: (d: e)), (c: ())))} +a {b: meta.inspect(map.deep-merge((c: (d: e)), (c: ())))} <===> deep/empty/second/output.css a { @@ -87,8 +95,9 @@ a { <===> ================================================================================ <===> deep/different_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: (d: e, f: g)), (c: (1: 2, 3: 4))))} +a {b: meta.inspect(map.deep-merge((c: (d: e, f: g)), (c: (1: 2, 3: 4))))} <===> deep/different_keys/output.css a { @@ -98,8 +107,9 @@ a { <===> ================================================================================ <===> deep/same_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: (d: e, f: g)), (c: (d: 1, f: 2))))} +a {b: meta.inspect(map.deep-merge((c: (d: e, f: g)), (c: (d: 1, f: 2))))} <===> deep/same_keys/output.css a { @@ -109,8 +119,9 @@ a { <===> ================================================================================ <===> deep/overlapping_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: (d: e, f: g, h: i)), (c: (j: 1, f: 2, k: 3))))} +a {b: meta.inspect(map.deep-merge((c: (d: e, f: g, h: i)), (c: (j: 1, f: 2, k: 3))))} <===> deep/overlapping_keys/output.css a { @@ -120,8 +131,9 @@ a { <===> ================================================================================ <===> deep/multiple_layers/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge((c: (d: (e: (f: g)))), (c: (d: (e: (1: 2))))))} +a {b: meta.inspect(map.deep-merge((c: (d: (e: (f: g)))), (c: (d: (e: (1: 2))))))} <===> deep/multiple_layers/output.css a { @@ -131,8 +143,9 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-merge($map1: (c: d), $map2: (1: 2)))} +a {b: meta.inspect(map.deep-merge($map1: (c: d), $map2: (1: 2)))} <===> named/output.css a { diff --git a/spec/core_functions/map/deep_remove.hrx b/spec/core_functions/map/deep_remove.hrx index 58278d0d74..29fa7e650b 100644 --- a/spec/core_functions/map/deep_remove.hrx +++ b/spec/core_functions/map/deep_remove.hrx @@ -1,6 +1,7 @@ <===> not_found/empty/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((), 1))} +a {b: meta.inspect(map.deep-remove((), 1))} <===> not_found/empty/output.css a { @@ -10,8 +11,9 @@ a { <===> ================================================================================ <===> not_found/top_level/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: d), d))} +a {b: meta.inspect(map.deep-remove((c: d), d))} <===> not_found/top_level/output.css a { @@ -21,8 +23,9 @@ a { <===> ================================================================================ <===> not_found/nested/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e)), c, e))} +a {b: meta.inspect(map.deep-remove((c: (d: e)), c, e))} <===> not_found/nested/output.css a { @@ -32,8 +35,9 @@ a { <===> ================================================================================ <===> not_found/not_a_map/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e)), c, d, e))} +a {b: meta.inspect(map.deep-remove((c: (d: e)), c, d, e))} <===> not_found/not_a_map/output.css a { @@ -43,8 +47,9 @@ a { <===> ================================================================================ <===> not_found/extra_keys/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e)), c, d, e, f, g))} +a {b: meta.inspect(map.deep-remove((c: (d: e)), c, d, e, f, g))} <===> not_found/extra_keys/output.css a { @@ -54,8 +59,9 @@ a { <===> ================================================================================ <===> found/top_level/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: d), c))} +a {b: meta.inspect(map.deep-remove((c: d), c))} <===> found/top_level/output.css a { @@ -65,8 +71,9 @@ a { <===> ================================================================================ <===> found/nested/single/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e)), c, d))} +a {b: meta.inspect(map.deep-remove((c: (d: e)), c, d))} <===> found/nested/single/output.css a { @@ -76,8 +83,9 @@ a { <===> ================================================================================ <===> found/nested/first/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, d))} +a {b: meta.inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, d))} <===> found/nested/first/output.css a { @@ -87,8 +95,9 @@ a { <===> ================================================================================ <===> found/nested/middle/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, f))} +a {b: meta.inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, f))} <===> found/nested/middle/output.css a { @@ -98,8 +107,9 @@ a { <===> ================================================================================ <===> found/nested/last/input.scss +@use "sass:meta"; @use 'sass:map'; -a {b: inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, h))} +a {b: meta.inspect(map.deep-remove((c: (d: e, f: g, h: i)), c, h))} <===> found/nested/last/output.css a { diff --git a/spec/core_functions/map/get.hrx b/spec/core_functions/map/get.hrx index 7cbd606379..28de8026ff 100644 --- a/spec/core_functions/map/get.hrx +++ b/spec/core_functions/map/get.hrx @@ -1,5 +1,7 @@ <===> not_found/empty/input.scss -a {b: inspect(map-get((), 1))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((), 1))} <===> not_found/empty/output.css a { @@ -9,7 +11,9 @@ a { <===> ================================================================================ <===> not_found/non_empty/input.scss -a {b: inspect(map-get((c: d), d))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c: d), d))} <===> not_found/non_empty/output.css a { @@ -19,7 +23,9 @@ a { <===> ================================================================================ <===> not_found/dash_sensitive/input.scss -a {b: inspect(map-get((c-d: e), c_d))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c-d: e), c_d))} <===> not_found/dash_sensitive/output.css a { @@ -29,7 +35,8 @@ a { <===> ================================================================================ <===> found/single/input.scss -a {b: map-get((c: d), c)} +@use "sass:map"; +a {b: map.get((c: d), c)} <===> found/single/output.css a { @@ -39,7 +46,8 @@ a { <===> ================================================================================ <===> found/first/input.scss -a {b: map-get((1: 2, 3: 4, 5: 6), 1)} +@use "sass:map"; +a {b: map.get((1: 2, 3: 4, 5: 6), 1)} <===> found/first/output.css a { @@ -49,7 +57,8 @@ a { <===> ================================================================================ <===> found/middle/input.scss -a {b: map-get((1: 2, 3: 4, 5: 6), 3)} +@use "sass:map"; +a {b: map.get((1: 2, 3: 4, 5: 6), 3)} <===> found/middle/output.css a { @@ -59,7 +68,8 @@ a { <===> ================================================================================ <===> found/last/input.scss -a {b: map-get((1: 2, 3: 4, 5: 6), 5)} +@use "sass:map"; +a {b: map.get((1: 2, 3: 4, 5: 6), 5)} <===> found/last/output.css a { @@ -69,7 +79,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: map-get($map: (c: d), $key: c)} +@use "sass:map"; +a {b: map.get($map: (c: d), $key: c)} <===> named/output.css a { @@ -79,7 +90,9 @@ a { <===> ================================================================================ <===> nested/found/partial_path/input.scss -a {b: inspect(map-get((c: (d: (e: f))), c, d))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c: (d: (e: f))), c, d))} <===> nested/found/partial_path/output.css a { @@ -89,7 +102,8 @@ a { <===> ================================================================================ <===> nested/found/full_path/input.scss -a {b: map-get((c: (d: (e: f))), c, d, e)} +@use "sass:map"; +a {b: map.get((c: (d: (e: f))), c, d, e)} <===> nested/found/full_path/output.css a { @@ -99,7 +113,9 @@ a { <===> ================================================================================ <===> nested/not_found/top_level/input.scss -a {b: inspect(map-get((c: (d: (e: f))), d))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c: (d: (e: f))), d))} <===> nested/not_found/top_level/output.css a { @@ -109,7 +125,9 @@ a { <===> ================================================================================ <===> nested/not_found/deep/input.scss -a {b: inspect(map-get((c: (d: (e: f))), c, d, g))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c: (d: (e: f))), c, d, g))} <===> nested/not_found/deep/output.css a { @@ -119,39 +137,57 @@ a { <===> ================================================================================ <===> nested/not_found/too_many_keys/input.scss -a {b: inspect(map-get((c: (d: (e: f))), c, d, e, f))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.get((c: (d: (e: f))), c, d, e, f))} <===> nested/not_found/too_many_keys/output.css a { b: null; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-get((c: d), c)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-get((c: d), c)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/map/input.scss -a {b: map-get(1, 2)} +@use "sass:map"; +a {b: map.get(1, 2)} <===> error/type/map/error Error: $map: 1 is not a map. , -1 | a {b: map-get(1, 2)} +2 | a {b: map.get(1, 2)} | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: map-get(1)} +@use "sass:map"; +a {b: map.get(1)} <===> error/too_few_args/error Error: Missing argument $key. ,--> input.scss -1 | a {b: map-get(1)} +2 | a {b: map.get(1)} | ^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function get($map, $key, $keys...) { | ========================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/map/has_key.hrx b/spec/core_functions/map/has_key.hrx index 7cc7df9104..6340b36cbb 100644 --- a/spec/core_functions/map/has_key.hrx +++ b/spec/core_functions/map/has_key.hrx @@ -1,5 +1,6 @@ <===> not_found/empty/input.scss -a {b: map-has-key((), 1)} +@use "sass:map"; +a {b: map.has-key((), 1)} <===> not_found/empty/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> not_found/non_empty/input.scss -a {b: map-has-key((c: d), d)} +@use "sass:map"; +a {b: map.has-key((c: d), d)} <===> not_found/non_empty/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> found/single/input.scss -a {b: map-has-key((c: d), c)} +@use "sass:map"; +a {b: map.has-key((c: d), c)} <===> found/single/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> found/first/input.scss -a {b: map-has-key((1: 2, 3: 4, 5: 6), 1)} +@use "sass:map"; +a {b: map.has-key((1: 2, 3: 4, 5: 6), 1)} <===> found/first/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> found/middle/input.scss -a {b: map-has-key((1: 2, 3: 4, 5: 6), 3)} +@use "sass:map"; +a {b: map.has-key((1: 2, 3: 4, 5: 6), 3)} <===> found/middle/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> found/last/input.scss -a {b: map-has-key((1: 2, 3: 4, 5: 6), 5)} +@use "sass:map"; +a {b: map.has-key((1: 2, 3: 4, 5: 6), 5)} <===> found/last/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: map-has-key($map: (c: d), $key: c)} +@use "sass:map"; +a {b: map.has-key($map: (c: d), $key: c)} <===> named/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> nested/found/partial_path/input.scss -a {b: map-has-key((c: (d: (e: f))), c, d)} +@use "sass:map"; +a {b: map.has-key((c: (d: (e: f))), c, d)} <===> nested/found/partial_path/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> nested/found/full_path/input.scss -a {b: map-has-key((c: (d: (e: f))), c, d, e)} +@use "sass:map"; +a {b: map.has-key((c: (d: (e: f))), c, d, e)} <===> nested/found/full_path/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> nested/not_found/top_level/input.scss -a {b: map-has-key((c: (d: (e: f))), d)} +@use "sass:map"; +a {b: map.has-key((c: (d: (e: f))), d)} <===> nested/not_found/top_level/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> nested/not_found/deep/input.scss -a {b: map-has-key((c: (d: (e: f))), c, d, g)} +@use "sass:map"; +a {b: map.has-key((c: (d: (e: f))), c, d, g)} <===> nested/not_found/deep/output.css a { @@ -109,39 +120,56 @@ a { <===> ================================================================================ <===> nested/not_found/too_many_keys/input.scss -a {b: map-has-key((c: (d: (e: f))), c, d, e, f)} +@use "sass:map"; +a {b: map.has-key((c: (d: (e: f))), c, d, e, f)} <===> nested/not_found/too_many_keys/output.css a { b: false; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-has-key((c: d), c)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-has-key((c: d), c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/map/input.scss -a {b: map-has-key(1, 2)} +@use "sass:map"; +a {b: map.has-key(1, 2)} <===> error/type/map/error Error: $map: 1 is not a map. , -1 | a {b: map-has-key(1, 2)} +2 | a {b: map.has-key(1, 2)} | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: map-has-key(1)} +@use "sass:map"; +a {b: map.has-key(1)} <===> error/too_few_args/error Error: Missing argument $key. ,--> input.scss -1 | a {b: map-has-key(1)} +2 | a {b: map.has-key(1)} | ^^^^^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function has-key($map, $key, $keys...) { | ============================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/map/keys.hrx b/spec/core_functions/map/keys.hrx index 0a0ae11b18..2ddd216984 100644 --- a/spec/core_functions/map/keys.hrx +++ b/spec/core_functions/map/keys.hrx @@ -1,8 +1,11 @@ <===> empty/input.scss -$result: map-keys(()); +@use "sass:list"; +@use "sass:map"; +@use "sass:meta"; +$result: map.keys(()); a { - value: inspect($result); - separator: list-separator($result); + value: meta.inspect($result); + separator: list.separator($result); } <===> empty/output.css @@ -14,11 +17,14 @@ a { <===> ================================================================================ <===> single/input.scss -$result: map-keys((1: 2)); +@use "sass:list"; +@use "sass:map"; +@use "sass:meta"; +$result: map.keys((1: 2)); a { value: $result; - type: type-of($result); - separator: list-separator($result); + type: meta.type-of($result); + separator: list.separator($result); } <===> single/output.css @@ -31,7 +37,8 @@ a { <===> ================================================================================ <===> multiple/input.scss -a {b: map-keys((c: d, e: f, g: h))} +@use "sass:map"; +a {b: map.keys((c: d, e: f, g: h))} <===> multiple/output.css a { @@ -41,7 +48,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: map-keys($map: (1: 2, 3: 4))} +@use "sass:map"; +a {b: map.keys($map: (1: 2, 3: 4))} <===> named/output.css a { @@ -51,47 +59,64 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: map-keys(1)} +@use "sass:map"; +a {b: map.keys(1)} <===> error/type/error Error: $map: 1 is not a map. , -1 | a {b: map-keys(1)} +2 | a {b: map.keys(1)} | ^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-keys((c: d))} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-keys((c: d))} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: map-keys()} +@use "sass:map"; +a {b: map.keys()} <===> error/too_few_args/error Error: Missing argument $map. ,--> input.scss -1 | a {b: map-keys()} +2 | a {b: map.keys()} | ^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function keys($map) { | ========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: map-keys((c: d), (e: f))} +@use "sass:map"; +a {b: map.keys((c: d), (e: f))} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: map-keys((c: d), (e: f))} +2 | a {b: map.keys((c: d), (e: f))} | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function keys($map) { | ========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/map/merge.hrx b/spec/core_functions/map/merge.hrx index 96d449dc43..4a011d1625 100644 --- a/spec/core_functions/map/merge.hrx +++ b/spec/core_functions/map/merge.hrx @@ -1,5 +1,7 @@ <===> empty/both/input.scss -a {b: inspect(map-merge((), ()))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((), ()))} <===> empty/both/output.css a { @@ -9,7 +11,9 @@ a { <===> ================================================================================ <===> empty/first/input.scss -a {b: inspect(map-merge((), (c: d, e: f)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((), (c: d, e: f)))} <===> empty/first/output.css a { @@ -19,7 +23,9 @@ a { <===> ================================================================================ <===> empty/second/input.scss -a {b: inspect(map-merge((c: d, e: f), ()))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: d, e: f), ()))} <===> empty/second/output.css a { @@ -29,7 +35,9 @@ a { <===> ================================================================================ <===> different_keys/input.scss -a {b: inspect(map-merge((c: d, e: f), (1: 2, 3: 4)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: d, e: f), (1: 2, 3: 4)))} <===> different_keys/output.css a { @@ -39,7 +47,9 @@ a { <===> ================================================================================ <===> same_keys/input.scss -a {b: inspect(map-merge((c: d, e: f), (c: 1, e: 2)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: d, e: f), (c: 1, e: 2)))} <===> same_keys/output.css a { @@ -49,7 +59,9 @@ a { <===> ================================================================================ <===> overlapping_keys/input.scss -a {b: inspect(map-merge((c: d, e: f, g: h), (i: 1, e: 2, j: 3)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: d, e: f, g: h), (i: 1, e: 2, j: 3)))} <===> overlapping_keys/output.css a { @@ -59,7 +71,9 @@ a { <===> ================================================================================ <===> nested/empty/both/input.scss -a {b: inspect(map-merge((c: ()), c, ()))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: ()), c, ()))} <===> nested/empty/both/output.css a { @@ -69,7 +83,9 @@ a { <===> ================================================================================ <===> nested/empty/first/input.scss -a {b: inspect(map-merge((c: ()), c, (d: e, f: g)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: ()), c, (d: e, f: g)))} <===> nested/empty/first/output.css a { @@ -79,7 +95,9 @@ a { <===> ================================================================================ <===> nested/empty/second/input.scss -a {b: inspect(map-merge((c: (d: e, f: g)), c, ()))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: (d: e, f: g)), c, ()))} <===> nested/empty/second/output.css a { @@ -89,7 +107,9 @@ a { <===> ================================================================================ <===> nested/different_keys/input.scss -a {b: inspect(map-merge((c: (d: e, f: g)), c, (1: 2, 3: 4)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: (d: e, f: g)), c, (1: 2, 3: 4)))} <===> nested/different_keys/output.css a { @@ -99,7 +119,9 @@ a { <===> ================================================================================ <===> nested/same_keys/input.scss -a {b: inspect(map-merge((c: (d: e, f: g)), c, (d: 1, f: 2)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: (d: e, f: g)), c, (d: 1, f: 2)))} <===> nested/same_keys/output.css a { @@ -109,7 +131,9 @@ a { <===> ================================================================================ <===> nested/overlapping_keys/input.scss -a {b: inspect(map-merge((c: (d: e, f: g, h: i)), c, (j: 1, f: 2, k: 3)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: (d: e, f: g, h: i)), c, (j: 1, f: 2, k: 3)))} <===> nested/overlapping_keys/output.css a { @@ -119,7 +143,9 @@ a { <===> ================================================================================ <===> nested/intermediate_value_is_not_a_map/input.scss -a {b: inspect(map-merge((c: 1), c, d, (e: f)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: 1), c, d, (e: f)))} <===> nested/intermediate_value_is_not_a_map/output.css a { @@ -129,7 +155,9 @@ a { <===> ================================================================================ <===> nested/leaf_value_is_not_a_map/input.scss -a {b: inspect(map-merge((c: 1), c, (d: e)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: 1), c, (d: e)))} <===> nested/leaf_value_is_not_a_map/output.css a { @@ -139,7 +167,9 @@ a { <===> ================================================================================ <===> nested/multiple_keys/input.scss -a {b: inspect(map-merge((c: (d: (e: (f: (g: h))))), c, d, e, f, (g: 1)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge((c: (d: (e: (f: (g: h))))), c, d, e, f, (g: 1)))} <===> nested/multiple_keys/output.css a { @@ -149,91 +179,113 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: inspect(map-merge($map1: (c: d), $map2: (1: 2)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.merge($map1: (c: d), $map2: (1: 2)))} <===> named/output.css a { b: (c: d, 1: 2); } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-merge((c: d), (1: 2))} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-merge((c: d), (1: 2))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/map1/input.scss -a {b: map-merge(1, (c: d))} +@use "sass:map"; +a {b: map.merge(1, (c: d))} <===> error/type/map1/error Error: $map1: 1 is not a map. , -1 | a {b: map-merge(1, (c: d))} +2 | a {b: map.merge(1, (c: d))} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/map2/input.scss -a {b: map-merge((c: d), 1)} +@use "sass:map"; +a {b: map.merge((c: d), 1)} <===> error/type/map2/error Error: $map2: 1 is not a map. , -1 | a {b: map-merge((c: d), 1)} +2 | a {b: map.merge((c: d), 1)} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/nested/map1/input.scss -a {b: map-merge(1, c, (d: e))} +@use "sass:map"; +a {b: map.merge(1, c, (d: e))} <===> error/type/nested/map1/error Error: $map1: 1 is not a map. , -1 | a {b: map-merge(1, c, (d: e))} +2 | a {b: map.merge(1, c, (d: e))} | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/nested/map2/input.scss -a {b: map-merge((c: d), e, 1)} +@use "sass:map"; +a {b: map.merge((c: d), e, 1)} <===> error/type/nested/map2/error Error: $map2: 1 is not a map. , -1 | a {b: map-merge((c: d), e, 1)} +2 | a {b: map.merge((c: d), e, 1)} | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/zero_args/input.scss -a {b: map-merge()} +@use "sass:map"; +a {b: map.merge()} <===> error/zero_args/error Error: Missing argument $map1. ,--> input.scss -1 | a {b: map-merge()} +2 | a {b: map.merge()} | ^^^^^^^^^^^ invocation ' , 1 | @function merge($map1, $args...) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/one_arg/input.scss -a {b: map-merge((c: d))} +@use "sass:map"; +a {b: map.merge((c: d))} <===> error/one_arg/error Error: Expected $args to contain a key. , -1 | a {b: map-merge((c: d))} +2 | a {b: map.merge((c: d))} | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/map/remove.hrx b/spec/core_functions/map/remove.hrx index 2478bec047..9fa32d9a93 100644 --- a/spec/core_functions/map/remove.hrx +++ b/spec/core_functions/map/remove.hrx @@ -1,5 +1,7 @@ <===> not_found/empty/input.scss -a {b: inspect(map-remove((), 1))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((), 1))} <===> not_found/empty/output.css a { @@ -9,7 +11,9 @@ a { <===> ================================================================================ <===> not_found/non_empty/input.scss -a {b: inspect(map-remove((c: d), d))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((c: d), d))} <===> not_found/non_empty/output.css a { @@ -19,7 +23,9 @@ a { <===> ================================================================================ <===> not_found/no_keys/input.scss -a {b: inspect(map-remove((c: d)))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((c: d)))} <===> not_found/no_keys/output.css a { @@ -29,7 +35,9 @@ a { <===> ================================================================================ <===> not_found/multiple/input.scss -a {b: inspect(map-remove((c: d), e, f, g))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((c: d), e, f, g))} <===> not_found/multiple/output.css a { @@ -39,7 +47,9 @@ a { <===> ================================================================================ <===> found/single/input.scss -a {b: inspect(map-remove((c: d), c))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((c: d), c))} <===> found/single/output.css a { @@ -49,7 +59,9 @@ a { <===> ================================================================================ <===> found/first/input.scss -a {b: inspect(map-remove((1: 2, 3: 4, 5: 6), 1))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((1: 2, 3: 4, 5: 6), 1))} <===> found/first/output.css a { @@ -59,7 +71,9 @@ a { <===> ================================================================================ <===> found/middle/input.scss -a {b: inspect(map-remove((1: 2, 3: 4, 5: 6), 3))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((1: 2, 3: 4, 5: 6), 3))} <===> found/middle/output.css a { @@ -69,7 +83,9 @@ a { <===> ================================================================================ <===> found/last/input.scss -a {b: inspect(map-remove((1: 2, 3: 4, 5: 6), 5))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((1: 2, 3: 4, 5: 6), 5))} <===> found/last/output.css a { @@ -79,7 +95,9 @@ a { <===> ================================================================================ <===> found/multiple/all/input.scss -a {b: inspect(map-remove((1: 2, 3: 4, 5: 6, 7: 8, 9: 10), 1, 5, 9))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((1: 2, 3: 4, 5: 6, 7: 8, 9: 10), 1, 5, 9))} <===> found/multiple/all/output.css a { @@ -89,7 +107,9 @@ a { <===> ================================================================================ <===> found/multiple/some/input.scss -a {b: inspect(map-remove((1: 2, 3: 4, 5: 6, 7: 8), 1, 5, 9))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove((1: 2, 3: 4, 5: 6, 7: 8), 1, 5, 9))} <===> found/multiple/some/output.css a { @@ -99,52 +119,71 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: inspect(map-remove($map: (c: d), $key: c))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.inspect(map.remove($map: (c: d), $key: c))} <===> named/output.css a { b: (); } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-remove((c: d), c)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-remove((c: d), c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/map/input.scss -a {b: map-remove(1)} +@use "sass:map"; +a {b: map.remove(1)} <===> error/type/map/error Error: $map: 1 is not a map. , -1 | a {b: map-remove(1)} +2 | a {b: map.remove(1)} | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: map-remove()} +@use "sass:map"; +a {b: map.remove()} <===> error/too_few_args/error Error: Missing argument $map. ,--> input.scss -1 | a {b: map-remove()} +2 | a {b: map.remove()} | ^^^^^^^^^^^^ invocation ' , 1 | @function remove($map) { | ============ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/positional_and_named/input.scss -a {b: map-remove((c: d, e: f), c, $key: e)} +@use "sass:map"; +a {b: map.remove((c: d, e: f), c, $key: e)} <===> error/positional_and_named/error Error: Argument $key was passed both by position and by name. , -1 | a {b: map-remove((c: d, e: f), c, $key: e)} +2 | a {b: map.remove((c: d, e: f), c, $key: e)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/map/set.hrx b/spec/core_functions/map/set.hrx index 3d153ac484..92717585db 100644 --- a/spec/core_functions/map/set.hrx +++ b/spec/core_functions/map/set.hrx @@ -1,6 +1,7 @@ <===> empty/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((), c, d))} +a {b: meta.inspect(map.set((), c, d))} <===> empty/output.css a { @@ -10,8 +11,9 @@ a { <===> ================================================================================ <===> update_existing_key/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: d), c, e))} +a {b: meta.inspect(map.set((c: d), c, e))} <===> update_existing_key/output.css a { @@ -21,8 +23,9 @@ a { <===> ================================================================================ <===> new_key/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: d), e, f))} +a {b: meta.inspect(map.set((c: d), e, f))} <===> new_key/output.css a { @@ -32,8 +35,9 @@ a { <===> ================================================================================ <===> nested/empty/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: ()), c, d, e, f))} +a {b: meta.inspect(map.set((c: ()), c, d, e, f))} <===> nested/empty/output.css a { @@ -43,8 +47,9 @@ a { <===> ================================================================================ <===> nested/update_existing_key/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: (d: e)), c, d, f))} +a {b: meta.inspect(map.set((c: (d: e)), c, d, f))} <===> nested/update_existing_key/output.css a { @@ -54,8 +59,9 @@ a { <===> ================================================================================ <===> nested/new_key/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: (d: e)), c, f, g))} +a {b: meta.inspect(map.set((c: (d: e)), c, f, g))} <===> nested/new_key/output.css a { @@ -65,8 +71,9 @@ a { <===> ================================================================================ <===> nested/value_is_not_a_map/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: 1), c, d, f))} +a {b: meta.inspect(map.set((c: 1), c, d, f))} <===> nested/value_is_not_a_map/output.css a { @@ -76,8 +83,9 @@ a { <===> ================================================================================ <===> nested/long/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set((c: (d: (e: (f: (g: h))))), c, d, e, f, g, i))} +a {b: meta.inspect(map.set((c: (d: (e: (f: (g: h))))), c, d, e, f, g, i))} <===> nested/long/output.css a { @@ -87,8 +95,9 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @use "sass:map"; -a {b: inspect(map.set($map: (c: d), $key: c, $value: e))} +a {b: meta.inspect(map.set($map: (c: d), $key: c, $value: e))} <===> named/output.css a { diff --git a/spec/core_functions/map/values.hrx b/spec/core_functions/map/values.hrx index 0c0da1432a..ad27f638b7 100644 --- a/spec/core_functions/map/values.hrx +++ b/spec/core_functions/map/values.hrx @@ -1,8 +1,11 @@ <===> empty/input.scss -$result: map-values(()); +@use "sass:list"; +@use "sass:map"; +@use "sass:meta"; +$result: map.values(()); a { - value: inspect($result); - separator: list-separator($result); + value: meta.inspect($result); + separator: list.separator($result); } <===> empty/output.css @@ -14,11 +17,14 @@ a { <===> ================================================================================ <===> single/input.scss -$result: map-values((1: 2)); +@use "sass:list"; +@use "sass:map"; +@use "sass:meta"; +$result: map.values((1: 2)); a { value: $result; - type: type-of($result); - separator: list-separator($result); + type: meta.type-of($result); + separator: list.separator($result); } <===> single/output.css @@ -31,7 +37,8 @@ a { <===> ================================================================================ <===> multiple/input.scss -a {b: map-values((c: d, e: f, g: h))} +@use "sass:map"; +a {b: map.values((c: d, e: f, g: h))} <===> multiple/output.css a { @@ -41,57 +48,75 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: map-values($map: (1: 2, 3: 4))} +@use "sass:map"; +a {b: map.values($map: (1: 2, 3: 4))} <===> named/output.css a { b: 2, 4; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:map"; +a {b: map.map-values((c: d))} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: map.map-values((c: d))} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss -a {b: map-values(1)} +@use "sass:map"; +a {b: map.values(1)} <===> error/type/error Error: $map: 1 is not a map. , -1 | a {b: map-values(1)} +2 | a {b: map.values(1)} | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: map-values()} +@use "sass:map"; +a {b: map.values()} <===> error/too_few_args/error Error: Missing argument $map. ,--> input.scss -1 | a {b: map-values()} +2 | a {b: map.values()} | ^^^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function values($map) { | ============ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: map-values((c: d), (e: f))} +@use "sass:map"; +a {b: map.values((c: d), (e: f))} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: map-values((c: d), (e: f))} +2 | a {b: map.values((c: d), (e: f))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:map 1 | @function values($map) { | ============ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/ceil.hrx b/spec/core_functions/math/ceil.hrx index 62291120f4..ce673e665d 100644 --- a/spec/core_functions/math/ceil.hrx +++ b/spec/core_functions/math/ceil.hrx @@ -1,5 +1,6 @@ <===> integer/input.scss -a {b: ceil(1)} +@use "sass:math"; +a {b: math.ceil(1)} <===> integer/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> high/input.scss -a {b: ceil(2.9)} +@use "sass:math"; +a {b: math.ceil(2.9)} <===> high/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> low/input.scss -a {b: ceil(6.000000000000001)} +@use "sass:math"; +a {b: math.ceil(6.000000000000001)} <===> low/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> negative/input.scss -a {b: ceil(-7.6)} +@use "sass:math"; +a {b: math.ceil(-7.6)} <===> negative/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> preserves_units/input.scss -a {b: ceil(7px / 4em) * 1em} +@use "sass:math"; +a {b: math.ceil(7px / 4em) * 1em} <===> preserves_units/output.css a { @@ -54,15 +59,16 @@ Recommendation: math.div(7px, 4em) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: ceil(7px / 4em) * 1em} - | ^^^^^^^^^ +2 | a {b: math.ceil(7px / 4em) * 1em} + | ^^^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: ceil($number: 1.6)} +@use "sass:math"; +a {b: math.ceil($number: 1.6)} <===> named/output.css a { @@ -72,47 +78,50 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: ceil(c)} +@use "sass:math"; +a {b: math.ceil(c)} <===> error/type/error Error: $number: c is not a number. , -1 | a {b: ceil(c)} - | ^^^^^^^ +2 | a {b: math.ceil(c)} + | ^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: ceil()} +@use "sass:math"; +a {b: math.ceil()} <===> error/too_few_args/error Error: Missing argument $number. ,--> input.scss -1 | a {b: ceil()} - | ^^^^^^ invocation +2 | a {b: math.ceil()} + | ^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function ceil($number) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: ceil(1, 2)} +@use "sass:math"; +a {b: math.ceil(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: ceil(1, 2)} - | ^^^^^^^^^^ invocation +2 | a {b: math.ceil(1, 2)} + | ^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function ceil($number) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/comparable.hrx b/spec/core_functions/math/comparable.hrx index f8e1b3dbd9..f293f5daa3 100644 --- a/spec/core_functions/math/comparable.hrx +++ b/spec/core_functions/math/comparable.hrx @@ -1,5 +1,6 @@ <===> unitless/to_unitless/input.scss -a {b: comparable(1, 2)} +@use "sass:math"; +a {b: math.compatible(1, 2)} <===> unitless/to_unitless/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unitless/to_unit/input.scss -a {b: comparable(1, 2px)} +@use "sass:math"; +a {b: math.compatible(1, 2px)} <===> unitless/to_unit/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> unit/to_same/input.scss -a {b: comparable(1px, 2px)} +@use "sass:math"; +a {b: math.compatible(1px, 2px)} <===> unit/to_same/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> unit/to_compatible/input.scss -a {b: comparable(1px, 2in)} +@use "sass:math"; +a {b: math.compatible(1px, 2in)} <===> unit/to_compatible/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> unit/to_different/input.scss -a {b: comparable(1px, 2em)} +@use "sass:math"; +a {b: math.compatible(1px, 2em)} <===> unit/to_different/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> unit/to_inverse/input.scss -a {b: comparable(1px, 1/1px)} +@use "sass:math"; +a {b: math.compatible(1px, 1/1px)} <===> unit/to_inverse/output.css a { @@ -64,77 +70,96 @@ Recommendation: math.div(1, 1px) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: comparable(1px, 1/1px)} - | ^^^^^ +2 | a {b: math.compatible(1px, 1/1px)} + | ^^^^^ ' - input.scss 1:23 root stylesheet + input.scss 2:28 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: comparable($number1: 1, $number2: 2)} +@use "sass:math"; +a {b: math.compatible($number1: 1, $number2: 2)} <===> named/output.css a { b: true; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:math"; +a {b: math.comparable(1px, 1in)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: math.comparable(1px, 1in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/arg_1/input.scss -a {b: comparable(c, 1)} +@use "sass:math"; +a {b: math.compatible(c, 1)} <===> error/type/arg_1/error Error: $number1: c is not a number. , -1 | a {b: comparable(c, 1)} - | ^^^^^^^^^^^^^^^^ +2 | a {b: math.compatible(c, 1)} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/arg_2/input.scss -a {b: comparable(1, c)} +@use "sass:math"; +a {b: math.compatible(1, c)} <===> error/type/arg_2/error Error: $number2: c is not a number. , -1 | a {b: comparable(1, c)} - | ^^^^^^^^^^^^^^^^ +2 | a {b: math.compatible(1, c)} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: comparable(1)} +@use "sass:math"; +a {b: math.compatible(1)} <===> error/too_few_args/error Error: Missing argument $number2. ,--> input.scss -1 | a {b: comparable(1)} - | ^^^^^^^^^^^^^ invocation +2 | a {b: math.compatible(1)} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function compatible($number1, $number2) { | ============================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: comparable(1, 2, 3)} +@use "sass:math"; +a {b: math.compatible(1, 2, 3)} <===> error/too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: comparable(1, 2, 3)} - | ^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: math.compatible(1, 2, 3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function compatible($number1, $number2) { | ============================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/div.hrx b/spec/core_functions/math/div.hrx index 347b22db96..f0751fecbd 100644 --- a/spec/core_functions/math/div.hrx +++ b/spec/core_functions/math/div.hrx @@ -105,11 +105,12 @@ a { <===> ================================================================================ <===> non_numeric/numerator/input.scss +@use "sass:meta"; @use "sass:math"; a { $result: math.div(b, 3); value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> non_numeric/numerator/output.css @@ -123,19 +124,20 @@ WARNING: math.div() will only support number arguments in a future release. Use list.slash() instead for a slash separator. , -3 | $result: math.div(b, 3); +4 | $result: math.div(b, 3); | ^^^^^^^^^^^^^^ ' - input.scss 3:12 root stylesheet + input.scss 4:12 root stylesheet <===> ================================================================================ <===> non_numeric/denominator/input.scss +@use "sass:meta"; @use "sass:math"; a { $result: math.div(6, b); value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> non_numeric/denominator/output.css @@ -149,10 +151,10 @@ WARNING: math.div() will only support number arguments in a future release. Use list.slash() instead for a slash separator. , -3 | $result: math.div(6, b); +4 | $result: math.div(6, b); | ^^^^^^^^^^^^^^ ' - input.scss 3:12 root stylesheet + input.scss 4:12 root stylesheet <===> ================================================================================ diff --git a/spec/core_functions/math/floor.hrx b/spec/core_functions/math/floor.hrx index d0daa1c36e..53765789af 100644 --- a/spec/core_functions/math/floor.hrx +++ b/spec/core_functions/math/floor.hrx @@ -1,5 +1,6 @@ <===> integer/input.scss -a {b: floor(1)} +@use "sass:math"; +a {b: math.floor(1)} <===> integer/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> high/input.scss -a {b: floor(2.999999999999999)} +@use "sass:math"; +a {b: math.floor(2.999999999999999)} <===> high/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> low/input.scss -a {b: floor(6.1)} +@use "sass:math"; +a {b: math.floor(6.1)} <===> low/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> negative/input.scss -a {b: floor(-7.2)} +@use "sass:math"; +a {b: math.floor(-7.2)} <===> negative/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> preserves_units/input.scss -a {b: floor(7px / 4em) * 1em} +@use "sass:math"; +a {b: math.floor(7px / 4em) * 1em} <===> preserves_units/output.css a { @@ -54,15 +59,16 @@ Recommendation: math.div(7px, 4em) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: floor(7px / 4em) * 1em} - | ^^^^^^^^^ +2 | a {b: math.floor(7px / 4em) * 1em} + | ^^^^^^^^^ ' - input.scss 1:13 root stylesheet + input.scss 2:18 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: floor($number: 1.6)} +@use "sass:math"; +a {b: math.floor($number: 1.6)} <===> named/output.css a { @@ -72,47 +78,50 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: floor(c)} +@use "sass:math"; +a {b: math.floor(c)} <===> error/type/error Error: $number: c is not a number. , -1 | a {b: floor(c)} - | ^^^^^^^^ +2 | a {b: math.floor(c)} + | ^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: floor()} +@use "sass:math"; +a {b: math.floor()} <===> error/too_few_args/error Error: Missing argument $number. ,--> input.scss -1 | a {b: floor()} - | ^^^^^^^ invocation +2 | a {b: math.floor()} + | ^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function floor($number) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: floor(1, 2)} +@use "sass:math"; +a {b: math.floor(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: floor(1, 2)} - | ^^^^^^^^^^^ invocation +2 | a {b: math.floor(1, 2)} + | ^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function floor($number) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/percentage.hrx b/spec/core_functions/math/percentage.hrx index 4e0dea43fc..84ccace772 100644 --- a/spec/core_functions/math/percentage.hrx +++ b/spec/core_functions/math/percentage.hrx @@ -1,5 +1,6 @@ <===> zero/input.scss -a {b: percentage(0)} +@use "sass:math"; +a {b: math.percentage(0)} <===> zero/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> small/input.scss -a {b: percentage(0.246)} +@use "sass:math"; +a {b: math.percentage(0.246)} <===> small/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> large/input.scss -a {b: percentage(123.456)} +@use "sass:math"; +a {b: math.percentage(123.456)} <===> large/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> integer/input.scss -a {b: percentage(42)} +@use "sass:math"; +a {b: math.percentage(42)} <===> integer/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> negative/input.scss -a {b: percentage(-0.4)} +@use "sass:math"; +a {b: math.percentage(-0.4)} <===> negative/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: percentage($number: 1)} +@use "sass:math"; +a {b: math.percentage($number: 1)} <===> named/output.css a { @@ -59,59 +65,63 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: percentage(c)} +@use "sass:math"; +a {b: math.percentage(c)} <===> error/type/error Error: $number: c is not a number. , -1 | a {b: percentage(c)} - | ^^^^^^^^^^^^^ +2 | a {b: math.percentage(c)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/unit/input.scss -a {b: percentage(1%)} +@use "sass:math"; +a {b: math.percentage(1%)} <===> error/unit/error Error: $number: Expected 1% to have no units. , -1 | a {b: percentage(1%)} - | ^^^^^^^^^^^^^^ +2 | a {b: math.percentage(1%)} + | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: percentage()} +@use "sass:math"; +a {b: math.percentage()} <===> error/too_few_args/error Error: Missing argument $number. ,--> input.scss -1 | a {b: percentage()} - | ^^^^^^^^^^^^ invocation +2 | a {b: math.percentage()} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function percentage($number) { | =================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: percentage(1, 2)} +@use "sass:math"; +a {b: math.percentage(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: percentage(1, 2)} - | ^^^^^^^^^^^^^^^^ invocation +2 | a {b: math.percentage(1, 2)} + | ^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function percentage($number) { | =================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/random.hrx b/spec/core_functions/math/random.hrx index cd75e3202d..a805ba2523 100644 --- a/spec/core_functions/math/random.hrx +++ b/spec/core_functions/math/random.hrx @@ -13,26 +13,29 @@ <===> ================================================================================ <===> null/input.scss -@import "../util"; +@use "sass:meta"; +@use "../util"; @function check($value) {@return $value >= 0 and $value < 1} -@include check-values(null, get-function(check)); +@include util.check-values(null, meta.get-function(check)); <===> null/output.css <===> ================================================================================ <===> one/input.scss -@import "../util"; +@use "sass:meta"; +@use "../util"; @function check($value) {@return $value == 1} -@include check-values(1, get-function(check)); +@include util.check-values(1, meta.get-function(check)); <===> one/output.css <===> ================================================================================ <===> within_precision/input.scss +@use "sass:math"; // This is within the precision limit to be considered identical to 1. -a {b: random(1.0000000000001)} +a {b: math.random(1.0000000000001)} <===> within_precision/output.css a { @@ -42,25 +45,29 @@ a { <===> ================================================================================ <===> two/input.scss -@import "../util"; +@use "sass:meta"; +@use "../util"; @function check($value) {@return $value == 1 or $value == 2} -@include check-values(2, get-function(check)); +@include util.check-values(2, meta.get-function(check)); <===> two/output.css <===> ================================================================================ <===> one_hundred/input.scss -@import "../util"; -@function check($value) {@return $value == round($value) and $value > 0 and $value <= 100} -@include check-values(100, get-function(check)); +@use "sass:math"; +@use "sass:meta"; +@use "../util"; +@function check($value) {@return $value == math.round($value) and $value > 0 and $value <= 100} +@include util.check-values(100, meta.get-function(check)); <===> one_hundred/output.css <===> ================================================================================ <===> no_arg/input.scss -$value: random(); +@use "sass:math"; +$value: math.random(); a {b: $value >= 0 and $value < 1} <===> no_arg/output.css @@ -71,7 +78,8 @@ a { <===> ================================================================================ <===> ignores_units/input.scss -a {b: random(1px)} +@use "sass:math"; +a {b: math.random(1px)} <===> ignores_units/output.css a { @@ -88,15 +96,16 @@ To preserve current behavior: math.random(math.div($limit, 1px)) More info: https://sass-lang.com/d/function-units , -1 | a {b: random(1px)} - | ^^^^^^^^^^^ +2 | a {b: math.random(1px)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> named/input.scss -$value: random($limit: 10); +@use "sass:math"; +$value: math.random($limit: 10); a {b: $value > 0 and $value <= 10} <===> named/output.css @@ -107,51 +116,55 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: random(c)} +@use "sass:math"; +a {b: math.random(c)} <===> error/type/error Error: $limit: c is not a number. , -1 | a {b: random(c)} - | ^^^^^^^^^ +2 | a {b: math.random(c)} + | ^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/decimal/input.scss -a {b: random(1.5)} +@use "sass:math"; +a {b: math.random(1.5)} <===> error/decimal/error Error: $limit: 1.5 is not an int. , -1 | a {b: random(1.5)} - | ^^^^^^^^^^^ +2 | a {b: math.random(1.5)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/zero/input.scss -a {b: random(0)} +@use "sass:math"; +a {b: math.random(0)} <===> error/zero/error Error: $limit: Must be greater than 0, was 0. , -1 | a {b: random(0)} - | ^^^^^^^^^ +2 | a {b: math.random(0)} + | ^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/negative/input.scss -a {b: random(-1)} +@use "sass:math"; +a {b: math.random(-1)} <===> error/negative/error Error: $limit: Must be greater than 0, was -1. , -1 | a {b: random(-1)} - | ^^^^^^^^^^ +2 | a {b: math.random(-1)} + | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/unit.hrx b/spec/core_functions/math/unit.hrx index c607752f3b..9264adf961 100644 --- a/spec/core_functions/math/unit.hrx +++ b/spec/core_functions/math/unit.hrx @@ -5,7 +5,8 @@ totally consistent output across different implementations. <===> ================================================================================ <===> none/input.scss -a {b: unit(1)} +@use "sass:math"; +a {b: math.unit(1)} <===> none/output.css a { @@ -15,7 +16,8 @@ a { <===> ================================================================================ <===> one_numerator/input.scss -a {b: unit(1px)} +@use "sass:math"; +a {b: math.unit(1px)} <===> one_numerator/output.css a { @@ -25,7 +27,8 @@ a { <===> ================================================================================ <===> multiple_numerators/input.scss -a {b: unit(1px * 1em * 1rad)} +@use "sass:math"; +a {b: math.unit(1px * 1em * 1rad)} <===> multiple_numerators/output.css a { @@ -35,7 +38,8 @@ a { <===> ================================================================================ <===> one_denominator/input.scss -a {b: unit(1/1px)} +@use "sass:math"; +a {b: math.unit(1/1px)} <===> one_denominator/output.css a { @@ -50,15 +54,16 @@ Recommendation: math.div(1, 1px) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unit(1/1px)} - | ^^^^^ +2 | a {b: math.unit(1/1px)} + | ^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> multiple_denominators/input.scss -a {b: unit(1 / 1px / 3em / 4rad)} +@use "sass:math"; +a {b: math.unit(1 / 1px / 3em / 4rad)} <===> multiple_denominators/output.css a { @@ -73,15 +78,16 @@ Recommendation: math.div(math.div(math.div(1, 1px), 3em), 4rad) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unit(1 / 1px / 3em / 4rad)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: math.unit(1 / 1px / 3em / 4rad)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> numerator_and_denominator/single/input.scss -a {b: unit(1px / 1em)} +@use "sass:math"; +a {b: math.unit(1px / 1em)} <===> numerator_and_denominator/single/output.css a { @@ -96,15 +102,16 @@ Recommendation: math.div(1px, 1em) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unit(1px / 1em)} - | ^^^^^^^^^ +2 | a {b: math.unit(1px / 1em)} + | ^^^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> numerator_and_denominator/multiple/input.scss -a {b: unit(1px * 1em / 1rad / 1s)} +@use "sass:math"; +a {b: math.unit(1px * 1em / 1rad / 1s)} <===> numerator_and_denominator/multiple/output.css a { @@ -119,10 +126,10 @@ Recommendation: math.div(1px * 1em, 1rad) or calc(1px * 1em / 1rad) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unit(1px * 1em / 1rad / 1s)} - | ^^^^^^^^^^^^^^^^ +2 | a {b: math.unit(1px * 1em / 1rad / 1s)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. @@ -131,15 +138,16 @@ Recommendation: math.div(math.div(1px * 1em, 1rad), 1s) or calc(1px * 1em / 1rad More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unit(1px * 1em / 1rad / 1s)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: math.unit(1px * 1em / 1rad / 1s)} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: unit($number: 1)} +@use "sass:math"; +a {b: math.unit($number: 1)} <===> named/output.css a { @@ -149,46 +157,49 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: unit(c)} +@use "sass:math"; +a {b: math.unit(c)} <===> error/type/error Error: $number: c is not a number. , -1 | a {b: unit(c)} - | ^^^^^^^ +2 | a {b: math.unit(c)} + | ^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: unit()} +@use "sass:math"; +a {b: math.unit()} <===> error/too_few_args/error Error: Missing argument $number. ,--> input.scss -1 | a {b: unit()} - | ^^^^^^ invocation +2 | a {b: math.unit()} + | ^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function unit($number) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: unit(1, 2)} +@use "sass:math"; +a {b: math.unit(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: unit(1, 2)} - | ^^^^^^^^^^ invocation +2 | a {b: math.unit(1, 2)} + | ^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function unit($number) { | ============= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/math/unitless.hrx b/spec/core_functions/math/unitless.hrx index f41e83b8f7..083a5b29dd 100644 --- a/spec/core_functions/math/unitless.hrx +++ b/spec/core_functions/math/unitless.hrx @@ -1,5 +1,6 @@ <===> unitless/input.scss -a {b: unitless(1)} +@use "sass:math"; +a {b: math.is-unitless(1)} <===> unitless/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> numerator/input.scss -a {b: unitless(1px)} +@use "sass:math"; +a {b: math.is-unitless(1px)} <===> numerator/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> denominator/input.scss -a {b: unitless(1/1px)} +@use "sass:math"; +a {b: math.is-unitless(1/1px)} <===> denominator/output.css a { @@ -34,15 +37,16 @@ Recommendation: math.div(1, 1px) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unitless(1/1px)} - | ^^^^^ +2 | a {b: math.is-unitless(1/1px)} + | ^^^^^ ' - input.scss 1:16 root stylesheet + input.scss 2:24 root stylesheet <===> ================================================================================ <===> numerator_and_denominator/input.scss -a {b: unitless(1px/1em)} +@use "sass:math"; +a {b: math.is-unitless(1px/1em)} <===> numerator_and_denominator/output.css a { @@ -57,64 +61,82 @@ Recommendation: math.div(1px, 1em) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: unitless(1px/1em)} - | ^^^^^^^ +2 | a {b: math.is-unitless(1px/1em)} + | ^^^^^^^ ' - input.scss 1:16 root stylesheet + input.scss 2:24 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: unitless($number: 100)} +@use "sass:math"; +a {b: math.is-unitless($number: 100)} <===> named/output.css a { b: true; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:math"; +a {b: math.unitless(1)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: math.unitless(1)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss -a {b: unitless(c)} +@use "sass:math"; +a {b: math.is-unitless(c)} <===> error/type/error Error: $number: c is not a number. , -1 | a {b: unitless(c)} - | ^^^^^^^^^^^ +2 | a {b: math.is-unitless(c)} + | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: unitless()} +@use "sass:math"; +a {b: math.is-unitless()} <===> error/too_few_args/error Error: Missing argument $number. ,--> input.scss -1 | a {b: unitless()} - | ^^^^^^^^^^ invocation +2 | a {b: math.is-unitless()} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function is-unitless($number) { | ==================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: unitless(1, 2)} +@use "sass:math"; +a {b: math.is-unitless(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: unitless(1, 2)} - | ^^^^^^^^^^^^^^ invocation +2 | a {b: math.is-unitless(1, 2)} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:math 1 | @function is-unitless($number) { | ==================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/meta/call.hrx b/spec/core_functions/meta/call.hrx index 4809f3e523..68619631b5 100644 --- a/spec/core_functions/meta/call.hrx +++ b/spec/core_functions/meta/call.hrx @@ -1,6 +1,7 @@ <===> args/none/input.scss +@use "sass:meta"; @function a() {@return b} -c {d: call(get-function("a"))} +c {d: meta.call(meta.get-function("a"))} <===> args/none/output.css c { @@ -10,7 +11,8 @@ c { <===> ================================================================================ <===> args/positional/input.scss -a {b: call(get-function("rgb"), 1, 2, 3)} +@use "sass:meta"; +a {b: meta.call(meta.get-function("rgb"), 1, 2, 3)} <===> args/positional/output.css a { @@ -20,7 +22,8 @@ a { <===> ================================================================================ <===> args/named/input.scss -a {b: call(get-function("rgb"), $blue: 1, $green: 2, $red: 3)} +@use "sass:meta"; +a {b: meta.call(meta.get-function("rgb"), $blue: 1, $green: 2, $red: 3)} <===> args/named/output.css a { @@ -30,8 +33,9 @@ a { <===> ================================================================================ <===> args/splat/positional/input.scss +@use "sass:meta"; $args: 1, 2, 3; -a {b: call(get-function("rgb"), $args...)} +a {b: meta.call(meta.get-function("rgb"), $args...)} <===> args/splat/positional/output.css a { @@ -41,8 +45,9 @@ a { <===> ================================================================================ <===> args/splat/named/input.scss +@use "sass:meta"; $args: ("green": 1, "blue": 2, "red": 3); -a {b: call(get-function("rgb"), $args...)} +a {b: meta.call(meta.get-function("rgb"), $args...)} <===> args/splat/named/output.css a { @@ -52,9 +57,10 @@ a { <===> ================================================================================ <===> args/splat/combined/input.scss +@use "sass:meta"; $positional: 1 2; $named: ("blue": 3); -a {b: call(get-function("rgb"), $positional..., $named...)} +a {b: meta.call(meta.get-function("rgb"), $positional..., $named...)} <===> args/splat/combined/output.css a { @@ -64,8 +70,9 @@ a { <===> ================================================================================ <===> string/local/input.scss +@use "sass:meta"; @function a($arg) {@return $arg + 1} -a {b: call("a", 1)} +a {b: meta.call("a", 1)} <===> string/local/output.css a { @@ -78,15 +85,16 @@ DEPRECATION WARNING: Passing a string to call() is deprecated and will be illega Recommendation: call(get-function("a")) , -2 | a {b: call("a", 1)} - | ^^^^^^^^^^^^ +3 | a {b: meta.call("a", 1)} + | ^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet <===> ================================================================================ <===> string/built_in/input.scss -a {b: call("rgb", 1, 2, 3)} +@use "sass:meta"; +a {b: meta.call("rgb", 1, 2, 3)} <===> string/built_in/output.css a { @@ -99,15 +107,16 @@ DEPRECATION WARNING: Passing a string to call() is deprecated and will be illega Recommendation: call(get-function("rgb")) , -1 | a {b: call("rgb", 1, 2, 3)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.call("rgb", 1, 2, 3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> named/input.scss -a {b: call($function: get-function("rgb"), $red: 1, $green: 2, $blue: 3)} +@use "sass:meta"; +a {b: meta.call($function: meta.get-function("rgb"), $red: 1, $green: 2, $blue: 3)} <===> named/output.css a { @@ -117,58 +126,62 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: call(1)} +@use "sass:meta"; +a {b: meta.call(1)} <===> error/type/error Error: $function: 1 is not a function reference. , -1 | a {b: call(1)} - | ^^^^^^^ +2 | a {b: meta.call(1)} + | ^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: call()} +@use "sass:meta"; +a {b: meta.call()} <===> error/too_few_args/error Error: Missing argument $function. ,--> input.scss -1 | a {b: call()} - | ^^^^^^ invocation +2 | a {b: meta.call()} + | ^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function call($function, $args...) { | ========================= declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/invalid_args/input.scss -a {b: call(get-function("rgb"), 1)} +@use "sass:meta"; +a {b: meta.call(meta.get-function("rgb"), 1)} <===> error/invalid_args/error Error: Missing element $green. , -1 | a {b: call(get-function("rgb"), 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.call(meta.get-function("rgb"), 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/if_args/input.scss +@use "sass:meta"; // The if() function has a special behavior to avoid evaluating the // non-returned argument but that behavior does not propagate to call() // itself when using call() to call if(). -a {b: call(get-function("if"), true, "", $undefined)} +a {b: meta.call(meta.get-function("if"), true, "", $undefined)} <===> error/if_args/error Error: Undefined variable. , -4 | a {b: call(get-function("if"), true, "", $undefined)} - | ^^^^^^^^^^ +5 | a {b: meta.call(meta.get-function("if"), true, "", $undefined)} + | ^^^^^^^^^^ ' - input.scss 4:42 root stylesheet + input.scss 5:52 root stylesheet diff --git a/spec/core_functions/meta/content_exists.hrx b/spec/core_functions/meta/content_exists.hrx index 8bec7536d3..dfaaeeb9fa 100644 --- a/spec/core_functions/meta/content_exists.hrx +++ b/spec/core_functions/meta/content_exists.hrx @@ -3,8 +3,9 @@ - libsass <===> false/top_level/input.scss +@use "sass:meta"; @mixin a { - b {c: content-exists()} + b {c: meta.content-exists()} } @include a; @@ -16,12 +17,13 @@ b { <===> ================================================================================ <===> false/through_content/input.scss +@use "sass:meta"; @mixin call-content { @content; } @mixin print-content-exists { - a {b: content-exists()} + a {b: meta.content-exists()} } @include call-content { @@ -36,8 +38,9 @@ a { <===> ================================================================================ <===> true/empty/input.scss +@use "sass:meta"; @mixin a { - b {c: content-exists()} + b {c: meta.content-exists()} @content; } @include a {} @@ -54,8 +57,9 @@ b { - libsass <===> true/non_empty/input.scss +@use "sass:meta"; @mixin a { - b {c: content-exists()} + b {c: meta.content-exists()} @content; } @include a { @@ -80,9 +84,10 @@ d { <===> ================================================================================ <===> controls/true/input.scss +@use "sass:meta"; // Regression test for sass/libsass#2842 @mixin test-content-exists() { - @if content-exists() { + @if meta.content-exists() { @content; } @else { @@ -104,9 +109,10 @@ a { <===> ================================================================================ <===> controls/false/input.scss +@use "sass:meta"; // Regression test for sass/libsass#2842 @mixin test-content-exists() { - @if content-exists() { + @if meta.content-exists() { @content; } @else { @@ -126,63 +132,67 @@ a { <===> ================================================================================ <===> error/too_many_args/input.scss +@use "sass:meta"; @mixin a { - b {c: content-exists(1)} + b {c: meta.content-exists(1)} } @include a; <===> error/too_many_args/error Error: Only 0 arguments allowed, but 1 was passed. ,--> input.scss -2 | b {c: content-exists(1)} - | ^^^^^^^^^^^^^^^^^ invocation +3 | b {c: meta.content-exists(1)} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function content-exists() { | ================ declaration ' - input.scss 2:9 a() - input.scss 4:1 root stylesheet + input.scss 3:9 a() + input.scss 5:1 root stylesheet <===> ================================================================================ <===> error/outside_mixin/input.scss -a {b: content-exists()} +@use "sass:meta"; +a {b: meta.content-exists()} <===> error/outside_mixin/error Error: content-exists() may only be called within a mixin. , -1 | a {b: content-exists()} - | ^^^^^^^^^^^^^^^^ +2 | a {b: meta.content-exists()} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/in_content/input.scss +@use "sass:meta"; @mixin call-content { @content; } @include call-content { - a {b: content-exists()} + a {b: meta.content-exists()} } <===> error/in_content/error Error: content-exists() may only be called within a mixin. , -6 | a {b: content-exists()} - | ^^^^^^^^^^^^^^^^ +7 | a {b: meta.content-exists()} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 6:9 @content - input.scss 2:3 call-content() - input.scss 5:1 root stylesheet + input.scss 7:9 @content + input.scss 3:3 call-content() + input.scss 6:1 root stylesheet <===> ================================================================================ <===> error/in_function_called_by_mixin/input.scss +@use "sass:meta"; @function call-content-exists() { - @return content-exists(); + @return meta.content-exists(); } @mixin call-function { @@ -194,9 +204,9 @@ Error: content-exists() may only be called within a mixin. <===> error/in_function_called_by_mixin/error Error: content-exists() may only be called within a mixin. , -2 | @return content-exists(); - | ^^^^^^^^^^^^^^^^ +3 | @return meta.content-exists(); + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:11 call-content-exists() - input.scss 6:9 call-function() - input.scss 9:1 root stylesheet + input.scss 3:11 call-content-exists() + input.scss 7:9 call-function() + input.scss 10:1 root stylesheet diff --git a/spec/core_functions/meta/feature_exists.hrx b/spec/core_functions/meta/feature_exists.hrx index 92eaadab60..58a9748a66 100644 --- a/spec/core_functions/meta/feature_exists.hrx +++ b/spec/core_functions/meta/feature_exists.hrx @@ -5,7 +5,8 @@ actually fully supports that feature. <===> ================================================================================ <===> global_variable_shadowing/input.scss -a {b: feature-exists(global-variable-shadowing)} +@use "sass:meta"; +a {b: meta.feature-exists(global-variable-shadowing)} <===> global_variable_shadowing/output.css a { @@ -15,7 +16,8 @@ a { <===> ================================================================================ <===> extend_selector_pseudoclass/input.scss -a {b: feature-exists(extend-selector-pseudoclass)} +@use "sass:meta"; +a {b: meta.feature-exists(extend-selector-pseudoclass)} <===> extend_selector_pseudoclass/output.css a { @@ -25,7 +27,8 @@ a { <===> ================================================================================ <===> units_level_3/input.scss -a {b: feature-exists(units-level-3)} +@use "sass:meta"; +a {b: meta.feature-exists(units-level-3)} <===> units_level_3/output.css a { @@ -35,7 +38,8 @@ a { <===> ================================================================================ <===> at_error/input.scss -a {b: feature-exists(at-error)} +@use "sass:meta"; +a {b: meta.feature-exists(at-error)} <===> at_error/output.css a { @@ -45,7 +49,8 @@ a { <===> ================================================================================ <===> custom_property/input.scss -a {b: feature-exists(custom-property)} +@use "sass:meta"; +a {b: meta.feature-exists(custom-property)} <===> custom_property/output.css a { @@ -55,7 +60,8 @@ a { <===> ================================================================================ <===> unknown/input.scss -a {b: feature-exists(unknown)} +@use "sass:meta"; +a {b: meta.feature-exists(unknown)} <===> unknown/output.css a { @@ -65,7 +71,8 @@ a { <===> ================================================================================ <===> dash_sensitive/input.scss -a {b: feature-exists(at_error)} +@use "sass:meta"; +a {b: meta.feature-exists(at_error)} <===> dash_sensitive/output.css a { @@ -75,7 +82,8 @@ a { <===> ================================================================================ <===> quote_insensitive/input.scss -a {b: feature-exists("at-error")} +@use "sass:meta"; +a {b: meta.feature-exists("at-error")} <===> quote_insensitive/output.css a { @@ -85,7 +93,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: feature-exists($feature: at-error)} +@use "sass:meta"; +a {b: meta.feature-exists($feature: at-error)} <===> named/output.css a { @@ -95,46 +104,49 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: feature-exists(1)} +@use "sass:meta"; +a {b: meta.feature-exists(1)} <===> error/type/error Error: $feature: 1 is not a string. , -1 | a {b: feature-exists(1)} - | ^^^^^^^^^^^^^^^^^ +2 | a {b: meta.feature-exists(1)} + | ^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: feature-exists()} +@use "sass:meta"; +a {b: meta.feature-exists()} <===> error/too_few_args/error Error: Missing argument $feature. ,--> input.scss -1 | a {b: feature-exists()} - | ^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.feature-exists()} + | ^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function feature-exists($feature) { | ======================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: feature-exists(at-error, custom-property)} +@use "sass:meta"; +a {b: meta.feature-exists(at-error, custom-property)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: feature-exists(at-error, custom-property)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.feature-exists(at-error, custom-property)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function feature-exists($feature) { | ======================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/meta/function_exists.hrx b/spec/core_functions/meta/function_exists.hrx index d2ead1c714..d589849faf 100644 --- a/spec/core_functions/meta/function_exists.hrx +++ b/spec/core_functions/meta/function_exists.hrx @@ -1,7 +1,8 @@ <===> same_module/global/input.scss +@use "sass:meta"; @function global-function() {@return null} -a {b: function-exists(global-function)} +a {b: meta.function-exists(global-function)} <===> same_module/global/output.css a { @@ -11,9 +12,10 @@ a { <===> ================================================================================ <===> same_module/local/input.scss +@use "sass:meta"; a { @function local-function() {@return null} - b: function-exists(local-function); + b: meta.function-exists(local-function); } <===> same_module/local/output.css @@ -24,8 +26,9 @@ a { <===> ================================================================================ <===> same_module/through_import/input.scss +@use "sass:meta"; @import "other"; -a {b: function-exists(global-function)} +a {b: meta.function-exists(global-function)} <===> same_module/through_import/other.scss @function global-function() {@return null} @@ -38,9 +41,10 @@ a { <===> ================================================================================ <===> same_module/dash_insensitive/dash_to_underscore/input.scss +@use "sass:meta"; @function a_b() {@return null} -c {d: function-exists(a-b)} +c {d: meta.function-exists(a-b)} <===> same_module/dash_insensitive/dash_to_underscore/output.css c { @@ -50,9 +54,10 @@ c { <===> ================================================================================ <===> same_module/dash_insensitive/underscore_to_dash/input.scss +@use "sass:meta"; @function a-b() {@return null} -c {d: function-exists(a_b)} +c {d: meta.function-exists(a_b)} <===> same_module/dash_insensitive/underscore_to_dash/output.css c { @@ -62,8 +67,9 @@ c { <===> ================================================================================ <===> same_module/non_existent/input.scss +@use "sass:meta"; a { - b: function-exists(non-existent); + b: meta.function-exists(non-existent); } <===> same_module/non_existent/output.css @@ -74,8 +80,9 @@ a { <===> ================================================================================ <===> different_module/undefined/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: function-exists("c", "color")} +a {b: meta.function-exists("c", "color")} <===> different_module/undefined/output.css a { @@ -85,8 +92,9 @@ a { <===> ================================================================================ <===> different_module/defined/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: function-exists("red", "color")} +a {b: meta.function-exists("red", "color")} <===> different_module/defined/output.css a { @@ -96,8 +104,9 @@ a { <===> ================================================================================ <===> different_module/chosen_prefix/input.scss +@use "sass:meta"; @use "sass:color" as a; -b {c: function-exists("red", "a")} +b {c: meta.function-exists("red", "a")} <===> different_module/chosen_prefix/output.css b { @@ -107,8 +116,9 @@ b { <===> ================================================================================ <===> different_module/through_use/input.scss +@use "sass:meta"; @use "other" as *; -a {b: function-exists(global-function)} +a {b: meta.function-exists(global-function)} <===> different_module/through_use/other.scss @function global-function() {@return null} @@ -121,8 +131,9 @@ a { <===> ================================================================================ <===> different_module/through_forward/bare/input.scss +@use "sass:meta"; @use "midstream" as *; -a {b: function-exists(c)} +a {b: meta.function-exists(c)} <===> different_module/through_forward/bare/_midstream.scss @forward "upstream"; @@ -138,10 +149,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/as/input.scss +@use "sass:meta"; @use "midstream" as *; a { - with-prefix: function-exists(b-c); - without-prefix: function-exists(c); + with-prefix: meta.function-exists(b-c); + without-prefix: meta.function-exists(c); } <===> different_module/through_forward/as/_midstream.scss @@ -159,10 +171,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/show/input.scss +@use "sass:meta"; @use "midstream" as *; a { - shown: function-exists(b); - not-shown: function-exists(c); + shown: meta.function-exists(b); + not-shown: meta.function-exists(c); } <===> different_module/through_forward/show/_midstream.scss @@ -181,10 +194,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/hide/input.scss +@use "sass:meta"; @use "midstream" as *; a { - hidden: function-exists(b); - not-hidden: function-exists(c); + hidden: meta.function-exists(b); + not-hidden: meta.function-exists(c); } <===> different_module/through_forward/hide/_midstream.scss @@ -203,9 +217,10 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: function-exists($name: "red", $module: "color")} +a {b: meta.function-exists($name: "red", $module: "color")} <===> named/output.css a { @@ -215,70 +230,75 @@ a { <===> ================================================================================ <===> error/argument/type/name/input.scss -a {b: function-exists(12px)} +@use "sass:meta"; +a {b: meta.function-exists(12px)} <===> error/argument/type/name/error Error: $name: 12px is not a string. , -1 | a {b: function-exists(12px)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.function-exists(12px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/type/module/input.scss -a {b: function-exists("red", 1)} +@use "sass:meta"; +a {b: meta.function-exists("red", 1)} <===> error/argument/type/module/error Error: $module: 1 is not a string. , -1 | a {b: function-exists("red", 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.function-exists("red", 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_few/input.scss -a {b: function-exists()} +@use "sass:meta"; +a {b: meta.function-exists()} <===> error/argument/too_few/error Error: Missing argument $name. ,--> input.scss -1 | a {b: function-exists()} - | ^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.function-exists()} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function function-exists($name, $module: null) { | ===================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_many/input.scss -a {b: function-exists(c, d, e)} +@use "sass:meta"; +a {b: meta.function-exists(c, d, e)} <===> error/argument/too_many/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: function-exists(c, d, e)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.function-exists(c, d, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function function-exists($name, $module: null) { | ===================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/conflict/input.scss +@use "sass:meta"; @use "other1" as *; @use "other2" as *; -a {b: function-exists(member)} +a {b: meta.function-exists(member)} <===> error/conflict/other1.scss @function member() {@return from other1} @@ -289,52 +309,55 @@ a {b: function-exists(member)} <===> error/conflict/error Error: This function is available from multiple global modules. , -1 | @use "other1" as *; +2 | @use "other1" as *; | ================== includes function -2 | @use "other2" as *; +3 | @use "other2" as *; | ================== includes function ... | -4 | a {b: function-exists(member)} - | ^^^^^^^^^^^^^^^^^^^^^^^ function use +5 | a {b: meta.function-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function use ' - input.scss 4:7 root stylesheet + input.scss 5:7 root stylesheet <===> ================================================================================ <===> error/module/non_existent/input.scss -a {b: function-exists("c", "d")} +@use "sass:meta"; +a {b: meta.function-exists("c", "d")} <===> error/module/non_existent/error Error: There is no module with the namespace "d". , -1 | a {b: function-exists("c", "d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.function-exists("c", "d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/built_in_but_not_loaded/input.scss -a {b: function-exists("red", "color")} +@use "sass:meta"; +a {b: meta.function-exists("red", "color")} <===> error/module/built_in_but_not_loaded/error Error: There is no module with the namespace "color". , -1 | a {b: function-exists("red", "color")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.function-exists("red", "color")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/dash_sensitive/input.scss +@use "sass:meta"; @use "sass:color" as a-b; -c {d: function-exists("c", $module: "a_b")} +c {d: meta.function-exists("c", $module: "a_b")} <===> error/module/dash_sensitive/error Error: There is no module with the namespace "a_b". , -2 | c {d: function-exists("c", $module: "a_b")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | c {d: meta.function-exists("c", $module: "a_b")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet diff --git a/spec/core_functions/meta/get_function/different_module.hrx b/spec/core_functions/meta/get_function/different_module.hrx index 20858857ba..ff31f2ac25 100644 --- a/spec/core_functions/meta/get_function/different_module.hrx +++ b/spec/core_functions/meta/get_function/different_module.hrx @@ -1,6 +1,7 @@ <===> defined/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: call(get-function("red", $module: "color"), #abcdef)} +a {b: meta.call(meta.get-function("red", $module: "color"), #abcdef)} <===> defined/output.css a { @@ -10,8 +11,9 @@ a { <===> ================================================================================ <===> chosen_prefix/input.scss +@use "sass:meta"; @use "sass:color" as a; -b {c: call(get-function("red", $module: "a"), #abcdef)} +b {c: meta.call(meta.get-function("red", $module: "a"), #abcdef)} <===> chosen_prefix/output.css b { @@ -21,8 +23,9 @@ b { <===> ================================================================================ <===> through_use/input.scss +@use "sass:meta"; @use "other" as *; -a {b: call(get-function(add-two), 10)} +a {b: meta.call(meta.get-function(add-two), 10)} <===> through_use/other.scss @function add-two($v) {@return $v + 2} @@ -35,8 +38,9 @@ a { <===> ================================================================================ <===> through_forward/bare/input.scss +@use "sass:meta"; @use "midstream" as *; -a {b: call(get-function(c))} +a {b: meta.call(meta.get-function(c))} <===> through_forward/bare/_midstream.scss @forward "upstream"; @@ -52,9 +56,10 @@ a { <===> ================================================================================ <===> through_forward/as/input.scss +@use "sass:meta"; @use "midstream" as *; a { - b: call(get-function(c-d)); + b: meta.call(meta.get-function(c-d)); } <===> through_forward/as/_midstream.scss @@ -71,9 +76,10 @@ a { <===> ================================================================================ <===> through_forward/show/input.scss +@use "sass:meta"; @use "midstream" as *; a { - b: call(get-function(c)); + b: meta.call(meta.get-function(c)); } <===> through_forward/show/_midstream.scss @@ -90,9 +96,10 @@ a { <===> ================================================================================ <===> through_forward/hide/input.scss +@use "sass:meta"; @use "midstream" as *; a { - b: call(get-function(d)); + b: meta.call(meta.get-function(d)); } <===> through_forward/hide/_midstream.scss @@ -113,8 +120,9 @@ a { - libsass <===> named/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: call(get-function($name: "red", $module: "color"), #abcdef)} +a {b: meta.call(meta.get-function($name: "red", $module: "color"), #abcdef)} <===> named/output.css a { diff --git a/spec/core_functions/meta/get_function/equality.hrx b/spec/core_functions/meta/get_function/equality.hrx index fd442488d8..55bc48918b 100644 --- a/spec/core_functions/meta/get_function/equality.hrx +++ b/spec/core_functions/meta/get_function/equality.hrx @@ -1,5 +1,6 @@ <===> same_value/input.scss -$lighten-fn: get-function(lighten); +@use "sass:meta"; +$lighten-fn: meta.get-function(lighten); a {b: $lighten-fn == $lighten-fn} <===> same_value/output.css @@ -10,7 +11,8 @@ a { <===> ================================================================================ <===> built_in/same/input.scss -a {b: get-function(lighten) == get-function(lighten)} +@use "sass:meta"; +a {b: meta.get-function(lighten) == meta.get-function(lighten)} <===> built_in/same/output.css a { @@ -20,7 +22,8 @@ a { <===> ================================================================================ <===> built_in/different/input.scss -a {b: get-function(lighten) == get-function(darken)} +@use "sass:meta"; +a {b: meta.get-function(lighten) == meta.get-function(darken)} <===> built_in/different/output.css a { @@ -30,8 +33,9 @@ a { <===> ================================================================================ <===> user_defined/same/input.scss +@use "sass:meta"; @function user-defined() {@return null} -a {b: get-function(user-defined) == get-function(user-defined)} +a {b: meta.get-function(user-defined) == meta.get-function(user-defined)} <===> user_defined/same/output.css a { @@ -41,9 +45,10 @@ a { <===> ================================================================================ <===> user_defined/different/input.scss +@use "sass:meta"; @function user-defined-1() {@return null} @function user-defined-2() {@return null} -a {b: get-function(user-defined-1) == get-function(user-defined-2)} +a {b: meta.get-function(user-defined-1) == meta.get-function(user-defined-2)} <===> user_defined/different/output.css a { @@ -53,11 +58,12 @@ a { <===> ================================================================================ <===> user_defined/redefined/input.scss +@use "sass:meta"; @function user-defined() {@return null} -$first-reference: get-function(user-defined); +$first-reference: meta.get-function(user-defined); @function user-defined() {@return null} -$second-reference: get-function(user-defined); +$second-reference: meta.get-function(user-defined); a {b: $first-reference == $second-reference} <===> user_defined/redefined/output.css diff --git a/spec/core_functions/meta/get_function/error.hrx b/spec/core_functions/meta/get_function/error.hrx index fc1d3bedc9..8080e65de7 100644 --- a/spec/core_functions/meta/get_function/error.hrx +++ b/spec/core_functions/meta/get_function/error.hrx @@ -1,44 +1,47 @@ <===> argument/type/name/input.scss -a {b: get-function(2px)} +@use "sass:meta"; +a {b: meta.get-function(2px)} <===> argument/type/name/error Error: $name: 2px is not a string. , -1 | a {b: get-function(2px)} - | ^^^^^^^^^^^^^^^^^ +2 | a {b: meta.get-function(2px)} + | ^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> argument/type/module/input.scss -a {b: get-function(c, $module: 1)} +@use "sass:meta"; +a {b: meta.get-function(c, $module: 1)} <===> argument/type/module/error Error: $module: 1 is not a string. , -1 | a {b: get-function(c, $module: 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.get-function(c, $module: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> argument/function_ref/input.scss +@use "sass:meta"; @function foo() { @return null; } -$foo-ref: get-function(foo); -a {b: get-function($foo-ref)} +$foo-ref: meta.get-function(foo); +a {b: meta.get-function($foo-ref)} <===> argument/function_ref/error Error: $name: get-function("foo") is not a string. , -6 | a {b: get-function($foo-ref)} - | ^^^^^^^^^^^^^^^^^^^^^^ +7 | a {b: meta.get-function($foo-ref)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 6:7 root stylesheet + input.scss 7:7 root stylesheet <===> ================================================================================ diff --git a/spec/core_functions/meta/get_mixin/different_module.hrx b/spec/core_functions/meta/get_mixin/different_module.hrx index a963879124..fab7cf8de2 100644 --- a/spec/core_functions/meta/get_mixin/different_module.hrx +++ b/spec/core_functions/meta/get_mixin/different_module.hrx @@ -4,7 +4,8 @@ a {@include meta.apply(meta.get-mixin("a", $module: "other"), #abcdef)} <===> defined/_other.scss -@mixin a($color) {b: red($color)} +@use "sass:color"; +@mixin a($color) {b: color.red($color)} <===> defined/output.css a { @@ -19,7 +20,8 @@ a { b {@include meta.apply(meta.get-mixin("a", $module: "a"), #abcdef)} <===> chosen_prefix/_other.scss -@mixin a($color) {c: red($color)} +@use "sass:color"; +@mixin a($color) {c: color.red($color)} <===> chosen_prefix/output.css b { @@ -121,7 +123,8 @@ a { a {@include meta.apply(meta.get-mixin($name: "a", $module: "other"), #abcdef)} <===> named/_other.scss -@mixin a($color) {b: red($color)} +@use "sass:color"; +@mixin a($color) {b: color.red($color)} <===> named/output.css a { diff --git a/spec/core_functions/meta/global_variable_exists.hrx b/spec/core_functions/meta/global_variable_exists.hrx index 96fa79baf9..151d06821e 100644 --- a/spec/core_functions/meta/global_variable_exists.hrx +++ b/spec/core_functions/meta/global_variable_exists.hrx @@ -1,7 +1,8 @@ <===> same_module/global/input.scss +@use "sass:meta"; $global-variable: null; -a {b: global-variable-exists(global-variable)} +a {b: meta.global-variable-exists(global-variable)} <===> same_module/global/output.css a { @@ -11,9 +12,10 @@ a { <===> ================================================================================ <===> same_module/local/input.scss +@use "sass:meta"; a { $local-variable: null; - b: global-variable-exists(local-variable); + b: meta.global-variable-exists(local-variable); } <===> same_module/local/output.css @@ -24,8 +26,9 @@ a { <===> ================================================================================ <===> same_module/through_import/input.scss +@use "sass:meta"; @import "other"; -a {b: global-variable-exists(global-variable)} +a {b: meta.global-variable-exists(global-variable)} <===> same_module/through_import/other.scss $global-variable: null; @@ -38,8 +41,9 @@ a { <===> ================================================================================ <===> same_module/non_existent/input.scss +@use "sass:meta"; a { - b: global-variable-exists(non-existent); + b: meta.global-variable-exists(non-existent); } <===> same_module/non_existent/output.css @@ -50,9 +54,10 @@ a { <===> ================================================================================ <===> dash_insensitive/dash_to_underscore/input.scss +@use "sass:meta"; $a_b: null; -c {d: global-variable-exists(a-b)} +c {d: meta.global-variable-exists(a-b)} <===> dash_insensitive/dash_to_underscore/output.css c { @@ -62,9 +67,10 @@ c { <===> ================================================================================ <===> dash_insensitive/underscore_to_dash/input.scss +@use "sass:meta"; $a-b: null; -c {d: global-variable-exists(a_b)} +c {d: meta.global-variable-exists(a_b)} <===> dash_insensitive/underscore_to_dash/output.css c { @@ -74,8 +80,9 @@ c { <===> ================================================================================ <===> different_module/undefined/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: global-variable-exists("c", "color")} +a {b: meta.global-variable-exists("c", "color")} <===> different_module/undefined/output.css a { @@ -85,8 +92,9 @@ a { <===> ================================================================================ <===> different_module/defined/input.scss +@use "sass:meta"; @use "other"; -a {b: global-variable-exists("c", "other")} +a {b: meta.global-variable-exists("c", "other")} <===> different_module/defined/_other.scss $c: null; @@ -99,8 +107,9 @@ a { <===> ================================================================================ <===> different_module/chosen_prefix/input.scss +@use "sass:meta"; @use "other" as a; -b {c: global-variable-exists("d", "a")} +b {c: meta.global-variable-exists("d", "a")} <===> different_module/chosen_prefix/_other.scss $d: null; @@ -113,8 +122,9 @@ b { <===> ================================================================================ <===> different_module/through_use/input.scss +@use "sass:meta"; @use "other" as *; -a {b: global-variable-exists(global-variable)} +a {b: meta.global-variable-exists(global-variable)} <===> different_module/through_use/other.scss $global-variable: null; @@ -127,8 +137,9 @@ a { <===> ================================================================================ <===> different_module/through_forward/bare/input.scss +@use "sass:meta"; @use "midstream" as *; -a {b: variable-exists(c)} +a {b: meta.variable-exists(c)} <===> different_module/through_forward/bare/_midstream.scss @forward "upstream"; @@ -144,10 +155,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/as/input.scss +@use "sass:meta"; @use "midstream" as *; a { - with-prefix: global-variable-exists(b-c); - without-prefix: global-variable-exists(c); + with-prefix: meta.global-variable-exists(b-c); + without-prefix: meta.global-variable-exists(c); } <===> different_module/through_forward/as/_midstream.scss @@ -165,10 +177,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/show/input.scss +@use "sass:meta"; @use "midstream" as *; a { - shown: global-variable-exists(b); - not-shown: global-variable-exists(c); + shown: meta.global-variable-exists(b); + not-shown: meta.global-variable-exists(c); } <===> different_module/through_forward/show/_midstream.scss @@ -187,10 +200,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/hide/input.scss +@use "sass:meta"; @use "midstream" as *; a { - hidden: global-variable-exists(b); - not-hidden: global-variable-exists(c); + hidden: meta.global-variable-exists(b); + not-hidden: meta.global-variable-exists(c); } <===> different_module/through_forward/hide/_midstream.scss @@ -209,8 +223,9 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @use "other"; -a {b: global-variable-exists($name: "c", $module: "other")} +a {b: meta.global-variable-exists($name: "c", $module: "other")} <===> named/_other.scss $c: null; @@ -223,70 +238,75 @@ a { <===> ================================================================================ <===> error/argument/type/name/input.scss -a {b: global-variable-exists(12px)} +@use "sass:meta"; +a {b: meta.global-variable-exists(12px)} <===> error/argument/type/name/error Error: $name: 12px is not a string. , -1 | a {b: global-variable-exists(12px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.global-variable-exists(12px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/type/module/input.scss -a {b: global-variable-exists("c", 1)} +@use "sass:meta"; +a {b: meta.global-variable-exists("c", 1)} <===> error/argument/type/module/error Error: $module: 1 is not a string. , -1 | a {b: global-variable-exists("c", 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.global-variable-exists("c", 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_few/input.scss -a {b: global-variable-exists()} +@use "sass:meta"; +a {b: meta.global-variable-exists()} <===> error/argument/too_few/error Error: Missing argument $name. ,--> input.scss -1 | a {b: global-variable-exists()} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.global-variable-exists()} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function global-variable-exists($name, $module: null) { | ============================================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_many/input.scss -a {b: global-variable-exists(c, d, e)} +@use "sass:meta"; +a {b: meta.global-variable-exists(c, d, e)} <===> error/argument/too_many/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: global-variable-exists(c, d, e)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.global-variable-exists(c, d, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function global-variable-exists($name, $module: null) { | ============================================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/conflict/input.scss +@use "sass:meta"; @use "other1" as *; @use "other2" as *; -a {b: global-variable-exists(member)} +a {b: meta.global-variable-exists(member)} <===> error/conflict/other1.scss $member: from other1; @@ -297,52 +317,55 @@ $member: from other2; <===> error/conflict/error Error: This variable is available from multiple global modules. , -1 | @use "other1" as *; +2 | @use "other1" as *; | ================== includes variable -2 | @use "other2" as *; +3 | @use "other2" as *; | ================== includes variable ... | -4 | a {b: global-variable-exists(member)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variable use +5 | a {b: meta.global-variable-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variable use ' - input.scss 4:7 root stylesheet + input.scss 5:7 root stylesheet <===> ================================================================================ <===> error/module/non_existent/input.scss -a {b: global-variable-exists("c", "d")} +@use "sass:meta"; +a {b: meta.global-variable-exists("c", "d")} <===> error/module/non_existent/error Error: There is no module with the namespace "d". , -1 | a {b: global-variable-exists("c", "d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.global-variable-exists("c", "d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/built_in_but_not_loaded/input.scss -a {b: global-variable-exists("c", "color")} +@use "sass:meta"; +a {b: meta.global-variable-exists("c", "color")} <===> error/module/built_in_but_not_loaded/error Error: There is no module with the namespace "color". , -1 | a {b: global-variable-exists("c", "color")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.global-variable-exists("c", "color")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/dash_sensitive/input.scss +@use "sass:meta"; @use "sass:color" as a-b; -c {d: global-variable-exists("c", $module: "a_b")} +c {d: meta.global-variable-exists("c", $module: "a_b")} <===> error/module/dash_sensitive/error Error: There is no module with the namespace "a_b". , -2 | c {d: global-variable-exists("c", $module: "a_b")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | c {d: meta.global-variable-exists("c", $module: "a_b")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet diff --git a/spec/core_functions/meta/inspect/boolean.hrx b/spec/core_functions/meta/inspect/boolean.hrx index 3e13934f61..5df5e71873 100644 --- a/spec/core_functions/meta/inspect/boolean.hrx +++ b/spec/core_functions/meta/inspect/boolean.hrx @@ -1,8 +1,9 @@ <===> true/input.scss -$result: inspect(true); +@use "sass:meta"; +$result: meta.inspect(true); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> true/output.css @@ -14,10 +15,11 @@ a { <===> ================================================================================ <===> false/input.scss -$result: inspect(false); +@use "sass:meta"; +$result: meta.inspect(false); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> false/output.css diff --git a/spec/core_functions/meta/inspect/color.hrx b/spec/core_functions/meta/inspect/color.hrx index 6d75330a42..99b98f0f1d 100644 --- a/spec/core_functions/meta/inspect/color.hrx +++ b/spec/core_functions/meta/inspect/color.hrx @@ -5,10 +5,11 @@ function, inspect() should return them in the same format the user wrote them. <===> ================================================================================ <===> literal/short_hex/input.scss -$result: inspect(#00f); +@use "sass:meta"; +$result: meta.inspect(#00f); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> literal/short_hex/output.css @@ -20,10 +21,11 @@ a { <===> ================================================================================ <===> literal/long_hex/input.scss -$result: inspect(#0000ff); +@use "sass:meta"; +$result: meta.inspect(#0000ff); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> literal/long_hex/output.css @@ -35,10 +37,11 @@ a { <===> ================================================================================ <===> literal/named/input.scss -$result: inspect(blue); +@use "sass:meta"; +$result: meta.inspect(blue); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> literal/named/output.css @@ -50,10 +53,11 @@ a { <===> ================================================================================ <===> literal/transparent/input.scss -$result: inspect(transparent); +@use "sass:meta"; +$result: meta.inspect(transparent); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> literal/transparent/output.css @@ -81,10 +85,11 @@ the hex code. <===> ================================================================================ <===> generated/alpha/input.scss -$result: inspect(rgba(1, 2, 3, 0.4)); +@use "sass:meta"; +$result: meta.inspect(rgba(1, 2, 3, 0.4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> generated/alpha/output.css @@ -96,11 +101,12 @@ a { <===> ================================================================================ <===> generated/transparent/input.scss -@import "../utils"; -$result: inspect(generated-color(transparent)); +@use "sass:meta"; +@use "../utils"; +$result: meta.inspect(utils.generated-color(transparent)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> generated/transparent/output.css @@ -112,11 +118,12 @@ a { <===> ================================================================================ <===> generated/named/input.scss -@import "../utils"; -$result: inspect(generated-color(#00f)); +@use "sass:meta"; +@use "../utils"; +$result: meta.inspect(utils.generated-color(#00f)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> generated/named/output.css @@ -128,11 +135,12 @@ a { <===> ================================================================================ <===> generated/short_hex/input.scss -@import "../utils"; -$result: inspect(generated-color(#abc)); +@use "sass:meta"; +@use "../utils"; +$result: meta.inspect(utils.generated-color(#abc)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> generated/short_hex/output.css @@ -144,11 +152,12 @@ a { <===> ================================================================================ <===> generated/long_hex/input.scss -@import "../utils"; -$result: inspect(generated-color(#abcdef)); +@use "sass:meta"; +@use "../utils"; +$result: meta.inspect(utils.generated-color(#abcdef)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> generated/long_hex/output.css diff --git a/spec/core_functions/meta/inspect/error.hrx b/spec/core_functions/meta/inspect/error.hrx index 322e3006ad..8182c50141 100644 --- a/spec/core_functions/meta/inspect/error.hrx +++ b/spec/core_functions/meta/inspect/error.hrx @@ -1,31 +1,33 @@ <===> too_few_args/input.scss -a {a: inspect()} +@use "sass:meta"; +a {a: meta.inspect()} <===> too_few_args/error Error: Missing argument $value. ,--> input.scss -1 | a {a: inspect()} - | ^^^^^^^^^ invocation +2 | a {a: meta.inspect()} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function inspect($value) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many_args/input.scss -a {a: inspect(1, 2)} +@use "sass:meta"; +a {a: meta.inspect(1, 2)} <===> too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {a: inspect(1, 2)} - | ^^^^^^^^^^^^^ invocation +2 | a {a: meta.inspect(1, 2)} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function inspect($value) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/meta/inspect/function.hrx b/spec/core_functions/meta/inspect/function.hrx index e1cd70635c..e7d576cd48 100644 --- a/spec/core_functions/meta/inspect/function.hrx +++ b/spec/core_functions/meta/inspect/function.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect(get-function("get-function")); +@use "sass:meta"; +$result: meta.inspect(meta.get-function("get-function", $module: "meta")); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/inspect.hrx b/spec/core_functions/meta/inspect/inspect.hrx index d9a444f98e..3ac81fcef2 100644 --- a/spec/core_functions/meta/inspect/inspect.hrx +++ b/spec/core_functions/meta/inspect/inspect.hrx @@ -1,5 +1,6 @@ <===> empty/bracketed/input.scss -a {b: inspect([])} +@use "sass:meta"; +a {b: meta.inspect([])} <===> empty/bracketed/output.css a { diff --git a/spec/core_functions/meta/inspect/list/bracketed.hrx b/spec/core_functions/meta/inspect/list/bracketed.hrx index 1b65d313eb..c5396797cc 100644 --- a/spec/core_functions/meta/inspect/list/bracketed.hrx +++ b/spec/core_functions/meta/inspect/list/bracketed.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect([1, 2, 3]); +@use "sass:meta"; +$result: meta.inspect([1, 2, 3]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/list/comma.hrx b/spec/core_functions/meta/inspect/list/comma.hrx index e39f5b8b84..6e3ad92c7e 100644 --- a/spec/core_functions/meta/inspect/list/comma.hrx +++ b/spec/core_functions/meta/inspect/list/comma.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect((1, 2, 3)); +@use "sass:meta"; +$result: meta.inspect((1, 2, 3)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/list/empty.hrx b/spec/core_functions/meta/inspect/list/empty.hrx index 2ec4092659..d140dd20ff 100644 --- a/spec/core_functions/meta/inspect/list/empty.hrx +++ b/spec/core_functions/meta/inspect/list/empty.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect(()); +@use "sass:meta"; +$result: meta.inspect(()); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/list/nested.hrx b/spec/core_functions/meta/inspect/list/nested.hrx index 05b53440c9..e627448603 100644 --- a/spec/core_functions/meta/inspect/list/nested.hrx +++ b/spec/core_functions/meta/inspect/list/nested.hrx @@ -1,8 +1,9 @@ <===> empty/in_space/bracketed/input.scss -$result: inspect([() ()]); +@use "sass:meta"; +$result: meta.inspect([() ()]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_space/bracketed/output.css @@ -14,10 +15,11 @@ a { <===> ================================================================================ <===> empty/in_space/unbracketed/input.scss -$result: inspect(() ()); +@use "sass:meta"; +$result: meta.inspect(() ()); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_space/unbracketed/output.css @@ -29,10 +31,11 @@ a { <===> ================================================================================ <===> empty/in_comma/bracketed/input.scss -$result: inspect([(), ()]); +@use "sass:meta"; +$result: meta.inspect([(), ()]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_comma/bracketed/output.css @@ -44,10 +47,11 @@ a { <===> ================================================================================ <===> empty/in_comma/unbracketed/input.scss -$result: inspect(((), ())); +@use "sass:meta"; +$result: meta.inspect(((), ())); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_comma/unbracketed/output.css @@ -59,10 +63,12 @@ a { <===> ================================================================================ <===> empty/in_slash/bracketed/input.scss -$result: inspect(join([(), ()], (), $separator: slash)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.join([(), ()], (), $separator: slash)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_slash/bracketed/output.css @@ -74,11 +80,12 @@ a { <===> ================================================================================ <===> empty/in_slash/unbracketed/input.scss +@use "sass:meta"; @use "sass:list"; -$result: inspect(list.slash((), ())); +$result: meta.inspect(list.slash((), ())); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> empty/in_slash/unbracketed/output.css @@ -90,7 +97,8 @@ a { <===> ================================================================================ <===> empty_bracketed/bracketed/input.scss -a {b: inspect([[] []])} +@use "sass:meta"; +a {b: meta.inspect([[] []])} <===> empty_bracketed/bracketed/output.css a { @@ -100,7 +108,8 @@ a { <===> ================================================================================ <===> empty_bracketed/unbracketed/input.scss -a {b: inspect(([] []))} +@use "sass:meta"; +a {b: meta.inspect(([] []))} <===> empty_bracketed/unbracketed/output.css a { @@ -110,10 +119,11 @@ a { <===> ================================================================================ <===> space/in_space/bracketed/input.scss -$result: inspect([(1 2) (3 4)]); +@use "sass:meta"; +$result: meta.inspect([(1 2) (3 4)]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_space/bracketed/output.css @@ -125,10 +135,11 @@ a { <===> ================================================================================ <===> space/in_space/unbracketed/input.scss -$result: inspect((1 2) (3 4)); +@use "sass:meta"; +$result: meta.inspect((1 2) (3 4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_space/unbracketed/output.css @@ -140,10 +151,11 @@ a { <===> ================================================================================ <===> space/in_comma/bracketed/input.scss -$result: inspect([1 2, 3 4]); +@use "sass:meta"; +$result: meta.inspect([1 2, 3 4]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_comma/bracketed/output.css @@ -155,10 +167,11 @@ a { <===> ================================================================================ <===> space/in_comma/unbracketed/input.scss -$result: inspect((1 2, 3 4)); +@use "sass:meta"; +$result: meta.inspect((1 2, 3 4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_comma/unbracketed/output.css @@ -170,10 +183,12 @@ a { <===> ================================================================================ <===> space/in_slash/bracketed/input.scss -$result: inspect(join([1 2, 3 4], (), $separator: slash)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.join([1 2, 3 4], (), $separator: slash)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_slash/bracketed/output.css @@ -185,11 +200,12 @@ a { <===> ================================================================================ <===> space/in_slash/unbracketed/input.scss +@use "sass:meta"; @use "sass:list"; -$result: inspect(list.slash(1 2, 3 4)); +$result: meta.inspect(list.slash(1 2, 3 4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/in_slash/unbracketed/output.css @@ -201,10 +217,11 @@ a { <===> ================================================================================ <===> comma/in_space/bracketed/input.scss -$result: inspect([(1, 2) (3, 4)]); +@use "sass:meta"; +$result: meta.inspect([(1, 2) (3, 4)]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_space/bracketed/output.css @@ -216,10 +233,11 @@ a { <===> ================================================================================ <===> comma/in_space/unbracketed/input.scss -$result: inspect((1, 2) (3, 4)); +@use "sass:meta"; +$result: meta.inspect((1, 2) (3, 4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_space/unbracketed/output.css @@ -231,10 +249,11 @@ a { <===> ================================================================================ <===> comma/in_comma/bracketed/input.scss -$result: inspect([(1, 2), (3, 4)]); +@use "sass:meta"; +$result: meta.inspect([(1, 2), (3, 4)]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_comma/bracketed/output.css @@ -246,10 +265,11 @@ a { <===> ================================================================================ <===> comma/in_comma/unbracketed/input.scss -$result: inspect(((1, 2), (3, 4))); +@use "sass:meta"; +$result: meta.inspect(((1, 2), (3, 4))); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_comma/unbracketed/output.css @@ -261,10 +281,12 @@ a { <===> ================================================================================ <===> comma/in_slash/bracketed/input.scss -$result: inspect(join([(1, 2), (3, 4)], (), $separator: slash)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.join([(1, 2), (3, 4)], (), $separator: slash)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_slash/bracketed/output.css @@ -276,11 +298,12 @@ a { <===> ================================================================================ <===> comma/in_slash/unbracketed/input.scss +@use "sass:meta"; @use "sass:list"; -$result: inspect(list.slash((1, 2), (3, 4))); +$result: meta.inspect(list.slash((1, 2), (3, 4))); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/in_slash/unbracketed/output.css @@ -292,10 +315,11 @@ a { <===> ================================================================================ <===> bracketed/in_space/bracketed/input.scss -$result: inspect([[1, 2] [3, 4]]); +@use "sass:meta"; +$result: meta.inspect([[1, 2] [3, 4]]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_space/bracketed/output.css @@ -307,10 +331,11 @@ a { <===> ================================================================================ <===> bracketed/in_space/unbracketed/input.scss -$result: inspect([1, 2] [3, 4]); +@use "sass:meta"; +$result: meta.inspect([1, 2] [3, 4]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_space/unbracketed/output.css @@ -322,10 +347,11 @@ a { <===> ================================================================================ <===> bracketed/in_comma/bracketed/input.scss -$result: inspect([[1, 2], [3, 4]]); +@use "sass:meta"; +$result: meta.inspect([[1, 2], [3, 4]]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_comma/bracketed/output.css @@ -337,10 +363,11 @@ a { <===> ================================================================================ <===> bracketed/in_comma/unbracketed/input.scss -$result: inspect(((1, 2), (3, 4))); +@use "sass:meta"; +$result: meta.inspect(((1, 2), (3, 4))); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_comma/unbracketed/output.css @@ -352,10 +379,12 @@ a { <===> ================================================================================ <===> bracketed/in_slash/bracketed/input.scss -$result: inspect(join([[1, 2], [3, 4]], (), $separator: slash)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.join([[1, 2], [3, 4]], (), $separator: slash)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_slash/bracketed/output.css @@ -367,11 +396,12 @@ a { <===> ================================================================================ <===> bracketed/in_slash/unbracketed/input.scss +@use "sass:meta"; @use "sass:list"; -$result: inspect(list.slash([1, 2], [3, 4])); +$result: meta.inspect(list.slash([1, 2], [3, 4])); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/in_slash/unbracketed/output.css diff --git a/spec/core_functions/meta/inspect/list/single.hrx b/spec/core_functions/meta/inspect/list/single.hrx index 6bbbac692a..3e7f0c3aea 100644 --- a/spec/core_functions/meta/inspect/list/single.hrx +++ b/spec/core_functions/meta/inspect/list/single.hrx @@ -1,8 +1,10 @@ <===> space/input.scss -$result: inspect(append((), 1, space)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.append((), 1, space)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> space/output.css @@ -14,10 +16,11 @@ a { <===> ================================================================================ <===> comma/input.scss -$result: inspect((1,)); +@use "sass:meta"; +$result: meta.inspect((1,)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> comma/output.css @@ -29,10 +32,12 @@ a { <===> ================================================================================ <===> slash/input.scss -$result: inspect(append((), 1, slash)); +@use "sass:list"; +@use "sass:meta"; +$result: meta.inspect(list.append((), 1, slash)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> slash/output.css @@ -44,10 +49,11 @@ a { <===> ================================================================================ <===> bracketed/undecided/input.scss -$result: inspect([1]); +@use "sass:meta"; +$result: meta.inspect([1]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/undecided/output.css @@ -59,10 +65,11 @@ a { <===> ================================================================================ <===> bracketed/comma/input.scss -$result: inspect([1,]); +@use "sass:meta"; +$result: meta.inspect([1,]); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> bracketed/comma/output.css diff --git a/spec/core_functions/meta/inspect/list/space.hrx b/spec/core_functions/meta/inspect/list/space.hrx index 9e45f0924a..8fe9b021f3 100644 --- a/spec/core_functions/meta/inspect/list/space.hrx +++ b/spec/core_functions/meta/inspect/list/space.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect(1 2 3); +@use "sass:meta"; +$result: meta.inspect(1 2 3); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/map.hrx b/spec/core_functions/meta/inspect/map.hrx index 855f662376..d86c1c69f0 100644 --- a/spec/core_functions/meta/inspect/map.hrx +++ b/spec/core_functions/meta/inspect/map.hrx @@ -1,8 +1,9 @@ <===> number/input.scss -$result: inspect((1: 2, 3: 4)); +@use "sass:meta"; +$result: meta.inspect((1: 2, 3: 4)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> number/output.css @@ -14,10 +15,11 @@ a { <===> ================================================================================ <===> list/key/space/input.scss -$result: inspect((1 2: 3, 4 5: 6)); +@use "sass:meta"; +$result: meta.inspect((1 2: 3, 4 5: 6)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> list/key/space/output.css @@ -29,10 +31,11 @@ a { <===> ================================================================================ <===> list/key/comma/input.scss -$result: inspect(((1, 2): 3, (4, 5): 6)); +@use "sass:meta"; +$result: meta.inspect(((1, 2): 3, (4, 5): 6)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> list/key/comma/output.css @@ -44,10 +47,11 @@ a { <===> ================================================================================ <===> list/value/space/input.scss -$result: inspect((1: 2 3, 4: 5 6)); +@use "sass:meta"; +$result: meta.inspect((1: 2 3, 4: 5 6)); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> list/value/space/output.css @@ -59,10 +63,11 @@ a { <===> ================================================================================ <===> list/value/comma/input.scss -$result: inspect((1: (2, 3), 4: (5, 6))); +@use "sass:meta"; +$result: meta.inspect((1: (2, 3), 4: (5, 6))); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> list/value/comma/output.css diff --git a/spec/core_functions/meta/inspect/mixin.hrx b/spec/core_functions/meta/inspect/mixin.hrx index 8268807778..aed5ee2afa 100644 --- a/spec/core_functions/meta/inspect/mixin.hrx +++ b/spec/core_functions/meta/inspect/mixin.hrx @@ -1,7 +1,7 @@ <===> user_defined/input.scss @use "sass:meta"; @mixin a() {} -a {b: inspect(meta.get-mixin(a))}; +a {b: meta.inspect(meta.get-mixin(a))}; <===> user_defined/output.css a { @@ -12,7 +12,7 @@ a { ================================================================================ <===> builtin/input.scss @use "sass:meta"; -a {b: inspect(meta.get-mixin(load-css, meta))}; +a {b: meta.inspect(meta.get-mixin(load-css, meta))}; <===> builtin/output.css a { diff --git a/spec/core_functions/meta/inspect/null.hrx b/spec/core_functions/meta/inspect/null.hrx index 808ee14265..61ef08d386 100644 --- a/spec/core_functions/meta/inspect/null.hrx +++ b/spec/core_functions/meta/inspect/null.hrx @@ -1,8 +1,9 @@ <===> input.scss -$result: inspect(null); +@use "sass:meta"; +$result: meta.inspect(null); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> output.css diff --git a/spec/core_functions/meta/inspect/number.hrx b/spec/core_functions/meta/inspect/number.hrx index bba3803009..c577424866 100644 --- a/spec/core_functions/meta/inspect/number.hrx +++ b/spec/core_functions/meta/inspect/number.hrx @@ -1,8 +1,9 @@ <===> unitless/input.scss -$result: inspect(123.456); +@use "sass:meta"; +$result: meta.inspect(123.456); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> unitless/output.css @@ -14,12 +15,13 @@ a { <===> ================================================================================ <===> unit/input.scss +@use "sass:meta"; // We explicitly don't test the inspect format for complex units. Their format // isn't guaranteed by the spec, since they can't be written literally in Sass. -$result: inspect(50px); +$result: meta.inspect(50px); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> unit/output.css diff --git a/spec/core_functions/meta/inspect/string.hrx b/spec/core_functions/meta/inspect/string.hrx index edc0d05266..4b8bb6633f 100644 --- a/spec/core_functions/meta/inspect/string.hrx +++ b/spec/core_functions/meta/inspect/string.hrx @@ -1,8 +1,9 @@ <===> unquoted/input.scss -$result: inspect(foo); +@use "sass:meta"; +$result: meta.inspect(foo); a { value: $result; - type: type-of($result); + type: meta.type-of($result); } <===> unquoted/output.css @@ -14,16 +15,18 @@ a { <===> ================================================================================ <===> quoted/input.scss -$result: inspect("foo"); +@use "sass:meta"; +@use "sass:string"; +$result: meta.inspect("foo"); a { value: $result; - type: type-of($result); + type: meta.type-of($result); // inspect() should always return an unquoted string, so when it's passed a // quoted string its return value should contain quote characters. We check // the length to verify that the quotes are included, since there's no // built-in way to check whether a string is quoted. - length: str-length($result); + length: string.length($result); } <===> quoted/output.css diff --git a/spec/core_functions/meta/keywords.hrx b/spec/core_functions/meta/keywords.hrx index 09af6af0e1..7610abfc07 100644 --- a/spec/core_functions/meta/keywords.hrx +++ b/spec/core_functions/meta/keywords.hrx @@ -7,8 +7,9 @@ <===> ================================================================================ <===> empty/no_args/input.scss -@import "../../utils"; -a {b: inspect(args-to-keywords())} +@use "sass:meta"; +@use "../../utils"; +a {b: meta.inspect(utils.args-to-keywords())} <===> empty/no_args/output.css a { @@ -18,8 +19,9 @@ a { <===> ================================================================================ <===> empty/positional/input.scss -@import "../../utils"; -a {b: inspect(args-to-keywords(1, 2, 3))} +@use "sass:meta"; +@use "../../utils"; +a {b: meta.inspect(utils.args-to-keywords(1, 2, 3))} <===> empty/positional/output.css a { @@ -29,8 +31,9 @@ a { <===> ================================================================================ <===> one_arg/input.scss -@import "../utils"; -a {b: inspect(args-to-keywords($c: d))} +@use "sass:meta"; +@use "../utils"; +a {b: meta.inspect(utils.args-to-keywords($c: d))} <===> one_arg/output.css a { @@ -40,8 +43,9 @@ a { <===> ================================================================================ <===> multi_arg/input.scss -@import "../utils"; -a {b: inspect(args-to-keywords($c: d, $e: f, $g: h))} +@use "sass:meta"; +@use "../utils"; +a {b: meta.inspect(utils.args-to-keywords($c: d, $e: f, $g: h))} <===> multi_arg/output.css a { @@ -51,13 +55,14 @@ a { <===> ================================================================================ <===> forwarded/function/input.scss -@import "../../utils"; +@use "sass:meta"; +@use "../../utils"; @function args-to-keywords-forward($args...) { - @return args-to-keywords($args...); + @return utils.args-to-keywords($args...); } -a {b: inspect(args-to-keywords-forward($c: d))} +a {b: meta.inspect(args-to-keywords-forward($c: d))} <===> forwarded/function/output.css a { @@ -67,13 +72,14 @@ a { <===> ================================================================================ <===> forwarded/call/input.scss -@import "../../utils"; +@use "sass:meta"; +@use "../../utils"; @function args-to-keywords-forward($args...) { - @return call(get-function("args-to-keywords"), $args...); + @return meta.call(meta.get-function("args-to-keywords", $module: "utils"), $args...); } -a {b: inspect(args-to-keywords-forward($c: d))} +a {b: meta.inspect(args-to-keywords-forward($c: d))} <===> forwarded/call/output.css a { @@ -83,10 +89,11 @@ a { <===> ================================================================================ <===> forwarded/mixin/input.scss -@import "../../utils"; +@use "sass:meta"; +@use "../../utils"; @mixin args-to-keywords-forward($args...) { - a {b: inspect(args-to-keywords($args...))} + a {b: meta.inspect(utils.args-to-keywords($args...))} } @include args-to-keywords-forward($c: d); @@ -99,14 +106,15 @@ a { <===> ================================================================================ <===> forwarded/content/input.scss -@import "../../utils"; +@use "sass:meta"; +@use "../../utils"; @mixin args-to-keywords-forward($args...) { @content($args...); } @include args-to-keywords-forward($c: d) using ($args...) { - a {b: inspect(args-to-keywords($args...))} + a {b: meta.inspect(utils.args-to-keywords($args...))} } <===> forwarded/content/output.css @@ -117,8 +125,9 @@ a { <===> ================================================================================ <===> dash_insensitive/input.scss -@import "../utils"; -a {b: inspect(args-to-keywords($c-d: e, $f_g: h))} +@use "sass:meta"; +@use "../utils"; +a {b: meta.inspect(utils.args-to-keywords($c-d: e, $f_g: h))} <===> dash_insensitive/output.css a { @@ -128,11 +137,12 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @function args-to-keywords($args...) { - @return keywords($args: $args); + @return meta.keywords($args: $args); } -a {b: inspect(args-to-keywords($c: d))} +a {b: meta.inspect(args-to-keywords($c: d))} <===> named/output.css a { @@ -142,59 +152,63 @@ a { <===> ================================================================================ <===> error/type/non_arg_list/input.scss -a {b: keywords(1 2 3)} +@use "sass:meta"; +a {b: meta.keywords(1 2 3)} <===> error/type/non_arg_list/error Error: $args: 1 2 3 is not an argument list. , -1 | a {b: keywords(1 2 3)} - | ^^^^^^^^^^^^^^^ +2 | a {b: meta.keywords(1 2 3)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/non_list/input.scss -a {b: keywords(1)} +@use "sass:meta"; +a {b: meta.keywords(1)} <===> error/type/non_list/error Error: $args: 1 is not an argument list. , -1 | a {b: keywords(1)} - | ^^^^^^^^^^^ +2 | a {b: meta.keywords(1)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: keywords()} +@use "sass:meta"; +a {b: meta.keywords()} <===> error/too_few_args/error Error: Missing argument $args. ,--> input.scss -1 | a {b: keywords()} - | ^^^^^^^^^^ invocation +2 | a {b: meta.keywords()} + | ^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function keywords($args) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: keywords(1, 2)} +@use "sass:meta"; +a {b: meta.keywords(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: keywords(1, 2)} - | ^^^^^^^^^^^^^^ invocation +2 | a {b: meta.keywords(1, 2)} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function keywords($args) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/meta/mixin_exists.hrx b/spec/core_functions/meta/mixin_exists.hrx index 8db9b2f83b..6b0b310ed5 100644 --- a/spec/core_functions/meta/mixin_exists.hrx +++ b/spec/core_functions/meta/mixin_exists.hrx @@ -1,7 +1,8 @@ <===> same_module/global/input.scss +@use "sass:meta"; @mixin global-mixin() {} -a {b: mixin-exists(global-mixin)} +a {b: meta.mixin-exists(global-mixin)} <===> same_module/global/output.css a { @@ -11,9 +12,10 @@ a { <===> ================================================================================ <===> same_module/local/input.scss +@use "sass:meta"; a { @mixin local-mixin() {} - b: mixin-exists(local-mixin); + b: meta.mixin-exists(local-mixin); } <===> same_module/local/output.css @@ -24,8 +26,9 @@ a { <===> ================================================================================ <===> same_module/through_import/input.scss +@use "sass:meta"; @import "other"; -a {b: mixin-exists(global-mixin)} +a {b: meta.mixin-exists(global-mixin)} <===> same_module/through_import/other.scss @mixin global-mixin() {} @@ -38,8 +41,9 @@ a { <===> ================================================================================ <===> same_module/non_existent/input.scss +@use "sass:meta"; a { - b: mixin-exists(non-existent); + b: meta.mixin-exists(non-existent); } <===> same_module/non_existent/output.css @@ -50,8 +54,9 @@ a { <===> ================================================================================ <===> different_module/undefined/input.scss +@use "sass:meta"; @use "sass:color"; -a {b: mixin-exists("c", "color")} +a {b: meta.mixin-exists("c", "color")} <===> different_module/undefined/output.css a { @@ -61,8 +66,9 @@ a { <===> ================================================================================ <===> different_module/defined/input.scss +@use "sass:meta"; @use "other"; -a {b: mixin-exists("c", "other")} +a {b: meta.mixin-exists("c", "other")} <===> different_module/defined/_other.scss @mixin c() {} @@ -75,8 +81,9 @@ a { <===> ================================================================================ <===> different_module/chosen_prefix/input.scss +@use "sass:meta"; @use "other" as a; -b {c: mixin-exists("d", "a")} +b {c: meta.mixin-exists("d", "a")} <===> different_module/chosen_prefix/_other.scss @mixin d() {} @@ -89,8 +96,9 @@ b { <===> ================================================================================ <===> different_module/through_use/input.scss +@use "sass:meta"; @use "other" as *; -a {b: mixin-exists(global-mixin)} +a {b: meta.mixin-exists(global-mixin)} <===> different_module/through_use/other.scss @mixin global-mixin() {} @@ -103,8 +111,9 @@ a { <===> ================================================================================ <===> different_module/through_forward/bare/input.scss +@use "sass:meta"; @use "midstream" as *; -a {b: mixin-exists(c)} +a {b: meta.mixin-exists(c)} <===> different_module/through_forward/bare/_midstream.scss @forward "upstream"; @@ -120,10 +129,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/as/input.scss +@use "sass:meta"; @use "midstream" as *; a { - with-prefix: mixin-exists(b-c); - without-prefix: mixin-exists(c); + with-prefix: meta.mixin-exists(b-c); + without-prefix: meta.mixin-exists(c); } <===> different_module/through_forward/as/_midstream.scss @@ -141,10 +151,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/show/input.scss +@use "sass:meta"; @use "midstream" as *; a { - shown: mixin-exists(b); - not-shown: mixin-exists(c); + shown: meta.mixin-exists(b); + not-shown: meta.mixin-exists(c); } <===> different_module/through_forward/show/_midstream.scss @@ -163,10 +174,11 @@ a { <===> ================================================================================ <===> different_module/through_forward/hide/input.scss +@use "sass:meta"; @use "midstream" as *; a { - hidden: mixin-exists(b); - not-hidden: mixin-exists(c); + hidden: meta.mixin-exists(b); + not-hidden: meta.mixin-exists(c); } <===> different_module/through_forward/hide/_midstream.scss @@ -185,8 +197,9 @@ a { <===> ================================================================================ <===> named/input.scss +@use "sass:meta"; @use "other"; -a {b: mixin-exists($name: "c", $module: "other")} +a {b: meta.mixin-exists($name: "c", $module: "other")} <===> named/_other.scss @mixin c() {} @@ -199,70 +212,75 @@ a { <===> ================================================================================ <===> error/argument/type/name/input.scss -a {b: mixin-exists(12px)} +@use "sass:meta"; +a {b: meta.mixin-exists(12px)} <===> error/argument/type/name/error Error: $name: 12px is not a string. , -1 | a {b: mixin-exists(12px)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.mixin-exists(12px)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/type/module/input.scss -a {b: mixin-exists(c, 1)} +@use "sass:meta"; +a {b: meta.mixin-exists(c, 1)} <===> error/argument/type/module/error Error: $module: 1 is not a string. , -1 | a {b: mixin-exists(c, 1)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.mixin-exists(c, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_few/input.scss -a {b: mixin-exists()} +@use "sass:meta"; +a {b: meta.mixin-exists()} <===> error/argument/too_few/error Error: Missing argument $name. ,--> input.scss -1 | a {b: mixin-exists()} - | ^^^^^^^^^^^^^^ invocation +2 | a {b: meta.mixin-exists()} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function mixin-exists($name, $module: null) { | ================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_many/input.scss -a {b: mixin-exists(c, d, e)} +@use "sass:meta"; +a {b: meta.mixin-exists(c, d, e)} <===> error/argument/too_many/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: mixin-exists(c, d, e)} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.mixin-exists(c, d, e)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function mixin-exists($name, $module: null) { | ================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/conflict/input.scss +@use "sass:meta"; @use "other1" as *; @use "other2" as *; -a {b: mixin-exists(member)} +a {b: meta.mixin-exists(member)} <===> error/conflict/other1.scss @mixin member() {} @@ -273,52 +291,55 @@ a {b: mixin-exists(member)} <===> error/conflict/error Error: This mixin is available from multiple global modules. , -1 | @use "other1" as *; +2 | @use "other1" as *; | ================== includes mixin -2 | @use "other2" as *; +3 | @use "other2" as *; | ================== includes mixin ... | -4 | a {b: mixin-exists(member)} - | ^^^^^^^^^^^^^^^^^^^^ mixin use +5 | a {b: meta.mixin-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ mixin use ' - input.scss 4:7 root stylesheet + input.scss 5:7 root stylesheet <===> ================================================================================ <===> error/module/non_existent/input.scss -a {b: mixin-exists("c", "d")} +@use "sass:meta"; +a {b: meta.mixin-exists("c", "d")} <===> error/module/non_existent/error Error: There is no module with the namespace "d". , -1 | a {b: mixin-exists("c", "d")} - | ^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.mixin-exists("c", "d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/built_in_but_not_loaded/input.scss -a {b: mixin-exists("c", "color")} +@use "sass:meta"; +a {b: meta.mixin-exists("c", "color")} <===> error/module/built_in_but_not_loaded/error Error: There is no module with the namespace "color". , -1 | a {b: mixin-exists("c", "color")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.mixin-exists("c", "color")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/module/dash_sensitive/input.scss +@use "sass:meta"; @use "sass:color" as a-b; -c {d: mixin-exists("c", $module: "a_b")} +c {d: meta.mixin-exists("c", $module: "a_b")} <===> error/module/dash_sensitive/error Error: There is no module with the namespace "a_b". , -2 | c {d: mixin-exists("c", $module: "a_b")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | c {d: meta.mixin-exists("c", $module: "a_b")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet diff --git a/spec/core_functions/meta/type_of.hrx b/spec/core_functions/meta/type_of.hrx index f0a7fbe215..fa2f781aa1 100644 --- a/spec/core_functions/meta/type_of.hrx +++ b/spec/core_functions/meta/type_of.hrx @@ -1,5 +1,6 @@ <===> boolean/true/input.scss -a {b: type-of(true)} +@use "sass:meta"; +a {b: meta.type-of(true)} <===> boolean/true/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> boolean/false/input.scss -a {b: type-of(false)} +@use "sass:meta"; +a {b: meta.type-of(false)} <===> boolean/false/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> color/input.scss -a {b: type-of(red)} +@use "sass:meta"; +a {b: meta.type-of(red)} <===> color/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> list/empty/input.scss -a {b: type-of(())} +@use "sass:meta"; +a {b: meta.type-of(())} <===> list/empty/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> list/non_empty/input.scss -a {b: type-of(1 2 3)} +@use "sass:meta"; +a {b: meta.type-of(1 2 3)} <===> list/non_empty/output.css a { @@ -49,7 +54,9 @@ a { <===> ================================================================================ <===> map/empty/input.scss -a {b: type-of(map-remove((c: d), c))} +@use "sass:map"; +@use "sass:meta"; +a {b: meta.type-of(map.remove((c: d), c))} <===> map/empty/output.css a { @@ -59,7 +66,8 @@ a { <===> ================================================================================ <===> map/non_empty/input.scss -a {b: type-of((c: d))} +@use "sass:meta"; +a {b: meta.type-of((c: d))} <===> map/non_empty/output.css a { @@ -69,7 +77,8 @@ a { <===> ================================================================================ <===> null/input.scss -a {b: type-of(null)} +@use "sass:meta"; +a {b: meta.type-of(null)} <===> null/output.css a { @@ -79,7 +88,8 @@ a { <===> ================================================================================ <===> number/unitless/input.scss -a {b: type-of(1)} +@use "sass:meta"; +a {b: meta.type-of(1)} <===> number/unitless/output.css a { @@ -89,7 +99,8 @@ a { <===> ================================================================================ <===> number/unit/input.scss -a {b: type-of(1.5px * 3.4em)} +@use "sass:meta"; +a {b: meta.type-of(1.5px * 3.4em)} <===> number/unit/output.css a { @@ -99,7 +110,8 @@ a { <===> ================================================================================ <===> function/input.scss -a {b: type-of(get-function("type-of"))} +@use "sass:meta"; +a {b: meta.type-of(meta.get-function("type-of", $module: "meta"))} <===> function/output.css a { @@ -109,7 +121,8 @@ a { <===> ================================================================================ <===> string/quoted/input.scss -a {b: type-of("c")} +@use "sass:meta"; +a {b: meta.type-of("c")} <===> string/quoted/output.css a { @@ -119,7 +132,8 @@ a { <===> ================================================================================ <===> string/unquoted/input.scss -a {b: type-of(c)} +@use "sass:meta"; +a {b: meta.type-of(c)} <===> string/unquoted/output.css a { @@ -129,8 +143,9 @@ a { <===> ================================================================================ <===> arglist/input.scss +@use "sass:meta"; @function type-of-arglist($args...) { - @return type-of($args); + @return meta.type-of($args); } a {b: type-of-arglist()} @@ -143,7 +158,8 @@ a { <===> ================================================================================ <===> calculation/simplified/input.scss -a {b: type-of(calc(1px))} +@use "sass:meta"; +a {b: meta.type-of(calc(1px))} <===> calculation/simplified/output.css a { @@ -153,7 +169,8 @@ a { <===> ================================================================================ <===> calculation/preserved/calc/input.scss -a {b: type-of(calc(var(--c)))} +@use "sass:meta"; +a {b: meta.type-of(calc(var(--c)))} <===> calculation/preserved/calc/output.css a { @@ -163,7 +180,8 @@ a { <===> ================================================================================ <===> calculation/preserved/clamp/input.scss -a {b: type-of(clamp(1%, 1px, 2px))} +@use "sass:meta"; +a {b: meta.type-of(clamp(1%, 1px, 2px))} <===> calculation/preserved/clamp/output.css a { @@ -175,7 +193,7 @@ a { <===> mixin/user_defined/input.scss @use "sass:meta"; @mixin a() {} -a {b: type-of(meta.get-mixin(a))} +a {b: meta.type-of(meta.get-mixin(a))} <===> mixin/user_defined/output.css a { @@ -186,7 +204,7 @@ a { ================================================================================ <===> mixin/builtin/input.scss @use "sass:meta"; -a {b: type-of(meta.get-mixin(load-css, meta))} +a {b: meta.type-of(meta.get-mixin(load-css, meta))} <===> mixin/builtin/output.css a { @@ -196,7 +214,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: type-of($value: c)} +@use "sass:meta"; +a {b: meta.type-of($value: c)} <===> named/output.css a { @@ -206,33 +225,35 @@ a { <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: type-of()} +@use "sass:meta"; +a {b: meta.type-of()} <===> error/too_few_args/error Error: Missing argument $value. ,--> input.scss -1 | a {b: type-of()} - | ^^^^^^^^^ invocation +2 | a {b: meta.type-of()} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function type-of($value) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: type-of(1, 2)} +@use "sass:meta"; +a {b: meta.type-of(1, 2)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: type-of(1, 2)} - | ^^^^^^^^^^^^^ invocation +2 | a {b: meta.type-of(1, 2)} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function type-of($value) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/meta/variable_exists.hrx b/spec/core_functions/meta/variable_exists.hrx index e414854449..0b2372acd2 100644 --- a/spec/core_functions/meta/variable_exists.hrx +++ b/spec/core_functions/meta/variable_exists.hrx @@ -1,7 +1,8 @@ <===> global/input.scss +@use "sass:meta"; $global-variable: null; -a {b: variable-exists(global-variable)} +a {b: meta.variable-exists(global-variable)} <===> global/output.css a { @@ -11,9 +12,10 @@ a { <===> ================================================================================ <===> local/input.scss +@use "sass:meta"; a { $local-variable: null; - b: variable-exists(local-variable); + b: meta.variable-exists(local-variable); } <===> local/output.css @@ -24,9 +26,10 @@ a { <===> ================================================================================ <===> dash_insensitive/dash_to_underscore/input.scss +@use "sass:meta"; $a_b: null; -c {d: variable-exists(a-b)} +c {d: meta.variable-exists(a-b)} <===> dash_insensitive/dash_to_underscore/output.css c { @@ -36,9 +39,10 @@ c { <===> ================================================================================ <===> dash_insensitive/underscore_to_dash/input.scss +@use "sass:meta"; $a-b: null; -c {d: variable-exists(a_b)} +c {d: meta.variable-exists(a_b)} <===> dash_insensitive/underscore_to_dash/output.css c { @@ -48,8 +52,9 @@ c { <===> ================================================================================ <===> through_import/input.scss +@use "sass:meta"; @import "other"; -a {b: variable-exists(global-variable)} +a {b: meta.variable-exists(global-variable)} <===> through_import/other.scss $global-variable: null; @@ -62,8 +67,9 @@ a { <===> ================================================================================ <===> through_use/input.scss +@use "sass:meta"; @use "other" as *; -a {b: variable-exists(global-variable)} +a {b: meta.variable-exists(global-variable)} <===> through_use/other.scss $global-variable: null; @@ -76,10 +82,11 @@ a { <===> ================================================================================ <===> through_forward/as/input.scss +@use "sass:meta"; @use "midstream" as *; a { - with-prefix: variable-exists(b-c); - without-prefix: variable-exists(c); + with-prefix: meta.variable-exists(b-c); + without-prefix: meta.variable-exists(c); } <===> through_forward/as/_midstream.scss @@ -97,10 +104,11 @@ a { <===> ================================================================================ <===> through_forward/show/input.scss +@use "sass:meta"; @use "midstream" as *; a { - shown: variable-exists(b); - not-shown: variable-exists(c); + shown: meta.variable-exists(b); + not-shown: meta.variable-exists(c); } <===> through_forward/show/_midstream.scss @@ -119,10 +127,11 @@ a { <===> ================================================================================ <===> through_forward/hide/input.scss +@use "sass:meta"; @use "midstream" as *; a { - hidden: variable-exists(b); - not-hidden: variable-exists(c); + hidden: meta.variable-exists(b); + not-hidden: meta.variable-exists(c); } <===> through_forward/hide/_midstream.scss @@ -141,8 +150,9 @@ a { <===> ================================================================================ <===> non_existent/input.scss +@use "sass:meta"; a { - b: variable-exists(non-existent); + b: meta.variable-exists(non-existent); } <===> non_existent/output.css @@ -153,7 +163,8 @@ a { <===> ================================================================================ <===> keyword/input.scss -a {b: variable-exists($name: foo)} +@use "sass:meta"; +a {b: meta.variable-exists($name: foo)} <===> keyword/output.css a { @@ -163,57 +174,61 @@ a { <===> ================================================================================ <===> error/argument/type/input.scss -a {b: variable-exists(12px)} +@use "sass:meta"; +a {b: meta.variable-exists(12px)} <===> error/argument/type/error Error: $name: 12px is not a string. , -1 | a {b: variable-exists(12px)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: meta.variable-exists(12px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_few/input.scss -a {b: variable-exists()} +@use "sass:meta"; +a {b: meta.variable-exists()} <===> error/argument/too_few/error Error: Missing argument $name. ,--> input.scss -1 | a {b: variable-exists()} - | ^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.variable-exists()} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function variable-exists($name) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/argument/too_many/input.scss -a {b: variable-exists(foo, bar)} +@use "sass:meta"; +a {b: meta.variable-exists(foo, bar)} <===> error/argument/too_many/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: variable-exists(foo, bar)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: meta.variable-exists(foo, bar)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:meta 1 | @function variable-exists($name) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> conflict/input.scss +@use "sass:meta"; @use "other1" as *; @use "other2" as *; -a {b: variable-exists(member)} +a {b: meta.variable-exists(member)} <===> conflict/other1.scss $member: from other1; @@ -224,12 +239,12 @@ $member: from other2; <===> conflict/error Error: This variable is available from multiple global modules. , -1 | @use "other1" as *; +2 | @use "other1" as *; | ================== includes variable -2 | @use "other2" as *; +3 | @use "other2" as *; | ================== includes variable ... | -4 | a {b: variable-exists(member)} - | ^^^^^^^^^^^^^^^^^^^^^^^ variable use +5 | a {b: meta.variable-exists(member)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variable use ' - input.scss 4:7 root stylesheet + input.scss 5:7 root stylesheet diff --git a/spec/core_functions/modules/README.md b/spec/core_functions/modules/README.md deleted file mode 100644 index f9829f75e8..0000000000 --- a/spec/core_functions/modules/README.md +++ /dev/null @@ -1,8 +0,0 @@ -This directory tests that core functions are accessible from the `sass:` modules -as defined in [the module system proposal][]. For the time being, it just tests -that each individual function is accessible with the correct name, and that -removed or renamed functions are not accessible. Once all implementations -support the module system, we should migrate all the function tests to use -module functions and just have simple tests for the global versions instead. - -[the module system proposal]: https://github.com/sass/sass/blob/master/accepted/module-system.md#built-in-modules-1 diff --git a/spec/core_functions/modules/color.hrx b/spec/core_functions/modules/color.hrx deleted file mode 100644 index 85aafb72cc..0000000000 --- a/spec/core_functions/modules/color.hrx +++ /dev/null @@ -1,471 +0,0 @@ -<===> red/input.scss -@use "sass:color"; -a {b: color.red(#abcdef)} - -<===> red/output.css -a { - b: 171; -} - -<===> -================================================================================ -<===> green/input.scss -@use "sass:color"; -a {b: color.green(#abcdef)} - -<===> green/output.css -a { - b: 205; -} - -<===> -================================================================================ -<===> blue/input.scss -@use "sass:color"; -a {b: color.blue(#abcdef)} - -<===> blue/output.css -a { - b: 239; -} - -<===> -================================================================================ -<===> hue/input.scss -@use "sass:color"; -a {b: color.hue(#abcdef)} - -<===> hue/output.css -a { - b: 210deg; -} - -<===> -================================================================================ -<===> saturation/input.scss -@use "sass:color"; -a {b: color.saturation(#abcdef)} - -<===> saturation/output.css -a { - b: 68%; -} - -<===> -================================================================================ -<===> lightness/input.scss -@use "sass:color"; -a {b: color.lightness(#abcdef)} - -<===> lightness/output.css -a { - b: 80.3921568627%; -} - -<===> -================================================================================ -<===> mix/input.scss -@use "sass:color"; -a {b: color.mix(#abcdef, #daddee)} - -<===> mix/output.css -a { - b: #c3d5ef; -} - -<===> -================================================================================ -<===> complement/input.scss -@use "sass:color"; -a {b: color.complement(#abcdef)} - -<===> complement/output.css -a { - b: #efcdab; -} - -<===> -================================================================================ -<===> invert/input.scss -@use "sass:color"; -a {b: color.invert(#abcdef)} - -<===> invert/output.css -a { - b: #543210; -} - -<===> -================================================================================ -<===> alpha/input.scss -@use "sass:color"; -a {b: color.alpha(#abcdef)} - -<===> alpha/output.css -a { - b: 1; -} - -<===> -================================================================================ -<===> adjust/input.scss -@use "sass:color"; -a {b: color.adjust(#abcdef, $red: 10)} - -<===> adjust/output.css -a { - b: #b5cdef; -} - -<===> -================================================================================ -<===> scale/input.scss -@use "sass:color"; -a {b: color.scale(#abcdef, $red: 10%)} - -<===> scale/output.css -a { - b: #b3cdef; -} - -<===> -================================================================================ -<===> change/input.scss -@use "sass:color"; -a {b: color.change(#abcdef, $red: 10)} - -<===> change/output.css -a { - b: #0acdef; -} - -<===> -================================================================================ -<===> ie_hex_str/input.scss -@use "sass:color"; -a {b: color.ie-hex-str(#abcdef)} - -<===> ie_hex_str/output.css -a { - b: #FFABCDEF; -} - -<===> -================================================================================ -<===> css_overloads/README.md -CSS overloads are still supported for module functions to ease the transition, -but they should produce deprecation warnings. - -<===> -================================================================================ -<===> css_overloads/grayscale/input.scss -@use "sass:color"; -a {b: color.grayscale(1)} - -<===> css_overloads/grayscale/output.css -a { - b: grayscale(1); -} - -<===> css_overloads/grayscale/warning -DEPRECATION WARNING: Passing a number (1) to color.grayscale() is deprecated. - -Recommendation: grayscale(1) - - , -2 | a {b: color.grayscale(1)} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> css_overloads/invert/input.scss -@use "sass:color"; -a {b: color.invert(1)} - -<===> css_overloads/invert/output.css -a { - b: invert(1); -} - -<===> css_overloads/invert/warning -DEPRECATION WARNING: Passing a number (1) to color.invert() is deprecated. - -Recommendation: invert(1) - - , -2 | a {b: color.invert(1)} - | ^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> css_overloads/alpha/one_arg/input.scss -@use "sass:color"; -a {b: color.alpha(c=d)} - -<===> css_overloads/alpha/one_arg/output.css -a { - b: alpha(c=d); -} - -<===> css_overloads/alpha/one_arg/warning -DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. - -Recommendation: alpha(c=d) - - , -2 | a {b: color.alpha(c=d)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> css_overloads/alpha/multi_arg/input.scss -@use "sass:color"; -a {b: color.alpha(c=d, e=f, g=h)} - -<===> css_overloads/alpha/multi_arg/output.css -a { - b: alpha(c=d, e=f, g=h); -} - -<===> css_overloads/alpha/multi_arg/warning -DEPRECATION WARNING: Using color.alpha() for a Microsoft filter is deprecated. - -Recommendation: alpha(c=d, e=f, g=h) - - , -2 | a {b: color.alpha(c=d, e=f, g=h)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> css_overloads/opacity/input.scss -@use "sass:color"; -a {b: color.opacity(1)} - -<===> css_overloads/opacity/output.css -a { - b: opacity(1); -} - -<===> css_overloads/opacity/warning -DEPRECATION WARNING: Passing a number (1 to color.opacity() is deprecated. - -Recommendation: opacity(1) - - , -2 | a {b: color.opacity(1)} - | ^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/adjust_color/input.scss -@use "sass:color"; -a {b: color.adjust-color(#abcdef, $red: 10)} - -<===> error/adjust_color/error -Error: Undefined function. - , -2 | a {b: color.adjust-color(#abcdef, $red: 10)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/scale_color/input.scss -@use "sass:color"; -a {b: color.scale-color(#abcdef, $red: 10%)} - -<===> error/scale_color/error -Error: Undefined function. - , -2 | a {b: color.scale-color(#abcdef, $red: 10%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/change_color/input.scss -@use "sass:color"; -a {b: color.change-color(#abcdef, $red: 10)} - -<===> error/change_color/error -Error: Undefined function. - , -2 | a {b: color.change-color(#abcdef, $red: 10)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/adjust_hue/input.scss -@use "sass:color"; -a {b: color.adjust-hue(#abcdef, 10)} - -<===> error/adjust_hue/error -Error: The function adjust-hue() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $hue: 10) - -More info: https://sass-lang.com/documentation/functions/color#adjust-hue - , -2 | a {b: color.adjust-hue(#abcdef, 10)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/lighten/input.scss -@use "sass:color"; -a {b: color.lighten(#abcdef, 10%)} - -<===> error/lighten/error -Error: The function lighten() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $lightness: 10%) - -More info: https://sass-lang.com/documentation/functions/color#lighten - , -2 | a {b: color.lighten(#abcdef, 10%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/darken/input.scss -@use "sass:color"; -a {b: color.darken(#abcdef, 10%)} - -<===> error/darken/error -Error: The function darken() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $lightness: -10%) - -More info: https://sass-lang.com/documentation/functions/color#darken - , -2 | a {b: color.darken(#abcdef, 10%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/saturate/input.scss -@use "sass:color"; -a {b: color.saturate(#abcdef, 10%)} - -<===> error/saturate/error -Error: The function saturate() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $saturation: 10%) - -More info: https://sass-lang.com/documentation/functions/color#saturate - , -2 | a {b: color.saturate(#abcdef, 10%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/desaturate/input.scss -@use "sass:color"; -a {b: color.desaturate(#abcdef, 10%)} - -<===> error/desaturate/error -Error: The function desaturate() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $saturation: -10%) - -More info: https://sass-lang.com/documentation/functions/color#desaturate - , -2 | a {b: color.desaturate(#abcdef, 10%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/opacify/input.scss -@use "sass:color"; -a {b: color.opacify(#abcdef, 0.5)} - -<===> error/opacify/error -Error: The function opacify() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $alpha: 0.5) - -More info: https://sass-lang.com/documentation/functions/color#opacify - , -2 | a {b: color.opacify(#abcdef, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/fade_in/input.scss -@use "sass:color"; -a {b: color.fade-in(#abcdef, 0.5)} - -<===> error/fade_in/error -Error: The function fade-in() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $alpha: 0.5) - -More info: https://sass-lang.com/documentation/functions/color#fade-in - , -2 | a {b: color.fade-in(#abcdef, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/transparentize/input.scss -@use "sass:color"; -a {b: color.transparentize(#abcdef, 0.5)} - -<===> error/transparentize/error -Error: The function transparentize() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $alpha: -0.5) - -More info: https://sass-lang.com/documentation/functions/color#transparentize - , -2 | a {b: color.transparentize(#abcdef, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/fade_out/input.scss -@use "sass:color"; -a {b: color.fade-out(#abcdef, 0.5)} - -<===> error/fade_out/error -Error: The function fade-out() isn't in the sass:color module. - -Recommendation: color.adjust(#abcdef, $alpha: -0.5) - -More info: https://sass-lang.com/documentation/functions/color#fade-out - , -2 | a {b: color.fade-out(#abcdef, 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/map.hrx b/spec/core_functions/modules/map.hrx deleted file mode 100644 index 6ec806c224..0000000000 --- a/spec/core_functions/modules/map.hrx +++ /dev/null @@ -1,151 +0,0 @@ -<===> get/input.scss -@use "sass:map"; -a {b: map.get((c: d), c)} - -<===> get/output.css -a { - b: d; -} - -<===> -================================================================================ -<===> merge/input.scss -@use "sass:map"; -@use "sass:meta"; -a {b: meta.inspect(map.merge((c: d), (e: f)))} - -<===> merge/output.css -a { - b: (c: d, e: f); -} - -<===> -================================================================================ -<===> remove/input.scss -@use "sass:map"; -@use "sass:meta"; -a {b: meta.inspect(map.remove((c: d), c))} - -<===> remove/output.css -a { - b: (); -} - -<===> -================================================================================ -<===> keys/input.scss -@use "sass:map"; -a {b: map.keys((c: d))} - -<===> keys/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> values/input.scss -@use "sass:map"; -a {b: map.values((c: d))} - -<===> values/output.css -a { - b: d; -} - -<===> -================================================================================ -<===> has_key/input.scss -@use "sass:map"; -a {b: map.has-key((c: d), c)} - -<===> has_key/output.css -a { - b: true; -} - -<===> -================================================================================ -<===> error/map_get/input.scss -@use "sass:map"; -a {b: map.map-get((c: d), c)} - -<===> error/map_get/error -Error: Undefined function. - , -2 | a {b: map.map-get((c: d), c)} - | ^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/map_merge/input.scss -@use "sass:map"; -@use "sass:meta"; -a {b: meta.map-inspect(map.merge((c: d), (e: f)))} - -<===> error/map_merge/error -Error: Undefined function. - , -3 | a {b: meta.map-inspect(map.merge((c: d), (e: f)))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> error/map_remove/input.scss -@use "sass:map"; -@use "sass:meta"; -a {b: meta.map-inspect(map.remove((c: d), c))} - -<===> error/map_remove/error -Error: Undefined function. - , -3 | a {b: meta.map-inspect(map.remove((c: d), c))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> error/map_keys/input.scss -@use "sass:map"; -a {b: map.map-keys((c: d))} - -<===> error/map_keys/error -Error: Undefined function. - , -2 | a {b: map.map-keys((c: d))} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/map_values/input.scss -@use "sass:map"; -a {b: map.map-values((c: d), c)} - -<===> error/map_values/error -Error: Undefined function. - , -2 | a {b: map.map-values((c: d), c)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/map_has_key/input.scss -@use "sass:map"; -a {b: map.map-has-key((c: d), c)} - -<===> error/map_has_key/error -Error: Undefined function. - , -2 | a {b: map.map-has-key((c: d), c)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/selector.hrx b/spec/core_functions/modules/selector.hrx deleted file mode 100644 index 171a61734b..0000000000 --- a/spec/core_functions/modules/selector.hrx +++ /dev/null @@ -1,169 +0,0 @@ -<===> nest/input.scss -@use "sass:selector"; -a {b: selector.nest(c, d)} - -<===> nest/output.css -a { - b: c d; -} - -<===> -================================================================================ -<===> append/input.scss -@use "sass:selector"; -a {b: selector.append(c, d)} - -<===> append/output.css -a { - b: cd; -} - -<===> -================================================================================ -<===> replace/input.scss -@use "sass:selector"; -a {b: selector.replace(c, c, d)} - -<===> replace/output.css -a { - b: d; -} - -<===> -================================================================================ -<===> extend/input.scss -@use "sass:selector"; -a {b: selector.extend(c, c, d)} - -<===> extend/output.css -a { - b: c, d; -} - -<===> -================================================================================ -<===> unify/input.scss -@use "sass:selector"; -a {b: selector.unify(".c", ".d")} - -<===> unify/output.css -a { - b: .c.d; -} - -<===> -================================================================================ -<===> is_superselector/input.scss -@use "sass:selector"; -a {b: selector.is-superselector(c, d)} - -<===> is_superselector/output.css -a { - b: false; -} - -<===> -================================================================================ -<===> simple_selectors/input.scss -@use "sass:selector"; -a {b: selector.simple-selectors(".c.d")} - -<===> simple_selectors/output.css -a { - b: .c, .d; -} - -<===> -================================================================================ -<===> parse/input.scss -@use "sass:selector"; -a {b: selector.parse(".c, .d")} - -<===> parse/output.css -a { - b: .c, .d; -} - -<===> -================================================================================ -<===> error/selector_nest/input.scss -@use "sass:selector"; -a {b: selector.selector-nest(c, d)} - -<===> error/selector_nest/error -Error: Undefined function. - , -2 | a {b: selector.selector-nest(c, d)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/selector_append/input.scss -@use "sass:selector"; -a {b: selector.selector-append(c, d)} - -<===> error/selector_append/error -Error: Undefined function. - , -2 | a {b: selector.selector-append(c, d)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/selector_replace/input.scss -@use "sass:selector"; -a {b: selector.selector-replace(c, c, d)} - -<===> error/selector_replace/error -Error: Undefined function. - , -2 | a {b: selector.selector-replace(c, c, d)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/selector_extend/input.scss -@use "sass:selector"; -a {b: selector.selector-extend(c, c, d)} - -<===> error/selector_extend/error -Error: Undefined function. - , -2 | a {b: selector.selector-extend(c, c, d)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/selector_unify/input.scss -@use "sass:selector"; -a {b: selector.selector-unify(".c", ".d")} - -<===> error/selector_unify/error -Error: Undefined function. - , -2 | a {b: selector.selector-unify(".c", ".d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/selector_parse/input.scss -@use "sass:selector"; -a {b: selector.selector-parse(".c.d")} - -<===> error/selector_parse/error -Error: Undefined function. - , -2 | a {b: selector.selector-parse(".c.d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/modules/string.hrx b/spec/core_functions/modules/string.hrx deleted file mode 100644 index af23c01b6b..0000000000 --- a/spec/core_functions/modules/string.hrx +++ /dev/null @@ -1,142 +0,0 @@ -<===> unquote/input.scss -@use "sass:string"; -a {b: string.unquote("c")} - -<===> unquote/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> quote/input.scss -@use "sass:string"; -a {b: string.quote(c)} - -<===> quote/output.css -a { - b: "c"; -} - -<===> -================================================================================ -<===> length/input.scss -@use "sass:string"; -a {b: string.length("c")} - -<===> length/output.css -a { - b: 1; -} - -<===> -================================================================================ -<===> insert/input.scss -@use "sass:string"; -a {b: string.insert("c", "d", 1)} - -<===> insert/output.css -a { - b: "dc"; -} - -<===> -================================================================================ -<===> index/input.scss -@use "sass:string"; -a {b: string.index("c", "c")} - -<===> index/output.css -a { - b: 1; -} - -<===> -================================================================================ -<===> slice/input.scss -@use "sass:string"; -a {b: string.slice("c", 1, 1)} - -<===> slice/output.css -a { - b: "c"; -} - -<===> -================================================================================ -<===> to_upper_case/input.scss -@use "sass:string"; -a {b: string.to-upper-case("c")} - -<===> to_upper_case/output.css -a { - b: "C"; -} - -<===> -================================================================================ -<===> unique_id/input.scss -@use "sass:meta"; -@use "sass:string"; -a {b: meta.type-of(string.unique-id())} - -<===> unique_id/output.css -a { - b: string; -} - -<===> -================================================================================ -<===> error/str_length/input.scss -@use "sass:string"; -a {b: string.str-length("c")} - -<===> error/str_length/error -Error: Undefined function. - , -2 | a {b: string.str-length("c")} - | ^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/str_insert/input.scss -@use "sass:string"; -a {b: string.str-insert("c", 1, "d")} - -<===> error/str_insert/error -Error: Undefined function. - , -2 | a {b: string.str-insert("c", 1, "d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/str_index/input.scss -@use "sass:string"; -a {b: string.str-index("c", "c")} - -<===> error/str_index/error -Error: Undefined function. - , -2 | a {b: string.str-index("c", "c")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet - -<===> -================================================================================ -<===> error/str_slice/input.scss -@use "sass:string"; -a {b: string.str-slice("c", 1, 1)} - -<===> error/str_slice/error -Error: Undefined function. - , -2 | a {b: string.str-slice("c", 1, 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/append.hrx b/spec/core_functions/selector/append.hrx index 855866b4db..f92b5280ff 100644 --- a/spec/core_functions/selector/append.hrx +++ b/spec/core_functions/selector/append.hrx @@ -1,5 +1,6 @@ <===> classes/single/input.scss -a {b: selector-append(".c", ".d")} +@use "sass:selector"; +a {b: selector.append(".c", ".d")} <===> classes/single/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> classes/double/input.scss -a {b: selector-append(".c, .d", ".e, .f")} +@use "sass:selector"; +a {b: selector.append(".c, .d", ".e, .f")} <===> classes/double/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> suffix/single/input.scss -a {b: selector-append(".c", "d")} +@use "sass:selector"; +a {b: selector.append(".c", "d")} <===> suffix/single/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> suffix/multiple/input.scss -a {b: selector-append(".c, .d", "e, f")} +@use "sass:selector"; +a {b: selector.append(".c, .d", "e, f")} <===> suffix/multiple/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> suffix/descendant/input.scss -a {b: selector-append("c d", "e f")} +@use "sass:selector"; +a {b: selector.append("c d", "e f")} <===> suffix/descendant/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> one_arg/input.scss -a {b: selector-append(".c.d")} +@use "sass:selector"; +a {b: selector.append(".c.d")} <===> one_arg/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> many_args/input.scss -a {b: selector-append(".c", ".d", ".e")} +@use "sass:selector"; +a {b: selector.append(".c", ".d", ".e")} <===> many_args/output.css a { @@ -77,7 +84,8 @@ spec just verifies one example for each parameter. <===> ================================================================================ <===> format/input/initial/input.scss -a {b: selector-append((c, d e), f)} +@use "sass:selector"; +a {b: selector.append((c, d e), f)} <===> format/input/initial/output.css a { @@ -87,7 +95,8 @@ a { <===> ================================================================================ <===> format/input/later/input.scss -a {b: selector-append(c, (d, e f))} +@use "sass:selector"; +a {b: selector.append(c, (d, e f))} <===> format/input/later/output.css a { @@ -97,7 +106,8 @@ a { <===> ================================================================================ <===> format/output/input.scss -$result: selector-append("c d, e f", "g"); +@use "sass:selector"; +$result: selector.append("c d, e f", "g"); a { result: $result; structure: $result == ("c" "dg", "e" "fg"); @@ -112,7 +122,8 @@ a { <===> ================================================================================ <===> combinator/initial_leading/input.scss -a {b: selector-append("> c", "d")} +@use "sass:selector"; +a {b: selector.append("> c", "d")} <===> combinator/initial_leading/output.css a { @@ -122,7 +133,8 @@ a { <===> ================================================================================ <===> combinator/final_trailing/input.scss -a {b: selector-append("c", "d ~")} +@use "sass:selector"; +a {b: selector.append("c", "d ~")} <===> combinator/final_trailing/output.css a { @@ -132,7 +144,8 @@ a { <===> ================================================================================ <===> combinator/multiple/middle/input.scss -a {b: selector-append("c > > d", "e")} +@use "sass:selector"; +a {b: selector.append("c > > d", "e")} <===> combinator/multiple/middle/output.css a { @@ -142,7 +155,8 @@ a { <===> ================================================================================ <===> combinator/multiple/initial_leading/input.scss -a {b: selector-append("~ ~ c", "d")} +@use "sass:selector"; +a {b: selector.append("~ ~ c", "d")} <===> combinator/multiple/initial_leading/output.css a { @@ -152,43 +166,61 @@ a { <===> ================================================================================ <===> combinator/multiple/final_trailing/input.scss -a {b: selector-append("c", "d + >")} +@use "sass:selector"; +a {b: selector.append("c", "d + >")} <===> combinator/multiple/final_trailing/output.css a { b: cd + >; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-append(c, d)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-append(c, d)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/universal/input.scss -a {b: selector-append(".c", "*")} +@use "sass:selector"; +a {b: selector.append(".c", "*")} <===> error/universal/error Error: Can't append * to .c. , -1 | a {b: selector-append(".c", "*")} +2 | a {b: selector.append(".c", "*")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/combinator/leading/input.scss -a {b: selector-append(".c", "> .d")} +@use "sass:selector"; +a {b: selector.append(".c", "> .d")} <===> error/combinator/leading/error Error: Can't append > .d to .c. , -1 | a {b: selector-append(".c", "> .d")} +2 | a {b: selector.append(".c", "> .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/combinator/trailing/input.scss -a {b: selector-append(".c ~", ".d")} +@use "sass:selector"; +a {b: selector.append(".c ~", ".d")} <===> error/combinator/trailing/error Error: Selector ".c ~" can't be used as a parent in a compound selector. @@ -197,7 +229,7 @@ Error: Selector ".c ~" can't be used as a parent in a compound selector. | ^^^^ outer selector ' ,--> input.scss -1 | a {b: selector-append(".c ~", ".d")} +2 | a {b: selector.append(".c ~", ".d")} | ============================= parent selector ' - 1:1 root stylesheet @@ -205,33 +237,36 @@ Error: Selector ".c ~" can't be used as a parent in a compound selector. <===> ================================================================================ <===> error/combinator/only/input.scss -a {b: selector-append(".c", ">", ".d")} +@use "sass:selector"; +a {b: selector.append(".c", ">", ".d")} <===> error/combinator/only/error Error: Can't append > to .c. , -1 | a {b: selector-append(".c", ">", ".d")} +2 | a {b: selector.append(".c", ">", ".d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/namespace/input.scss -a {b: selector-append("c", "|d")} +@use "sass:selector"; +a {b: selector.append("c", "|d")} <===> error/namespace/error Error: Can't append |d to c. , -1 | a {b: selector-append("c", "|d")} +2 | a {b: selector.append("c", "|d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/parent/input.scss -a {b: selector-append(".c", "&")} +@use "sass:selector"; +a {b: selector.append(".c", "&")} <===> error/parent/error Error: Parent selectors aren't allowed here. @@ -241,15 +276,16 @@ Error: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-append(".c", "&")} +2 | a {b: selector.append(".c", "&")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/invalid/input.scss -a {b: selector-append("[c", "d")} +@use "sass:selector"; +a {b: selector.append("[c", "d")} <===> error/invalid/error Error: expected more input. @@ -259,34 +295,36 @@ Error: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-append("[c", "d")} +2 | a {b: selector.append("[c", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/input.scss -a {b: selector-append("c", 1)} +@use "sass:selector"; +a {b: selector.append("c", 1)} <===> error/type/error Error: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-append("c", 1)} +2 | a {b: selector.append("c", 1)} | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: selector-append()} +@use "sass:selector"; +a {b: selector.append()} <===> error/too_few_args/error Error: $selectors: At least one selector must be passed. , -1 | a {b: selector-append()} +2 | a {b: selector.append()} | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/extend/error.hrx b/spec/core_functions/selector/extend/error.hrx index e84a5e0756..6d1835a851 100644 --- a/spec/core_functions/selector/extend/error.hrx +++ b/spec/core_functions/selector/extend/error.hrx @@ -172,6 +172,20 @@ a list of strings, or a list of lists of strings. ' input.scss 1:7 root stylesheet +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-extend(c, c, d)} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-extend(c, c, d)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> too_many_args/input.scss diff --git a/spec/core_functions/selector/is_superselector/complex/adjacent_sibling.hrx b/spec/core_functions/selector/is_superselector/complex/adjacent_sibling.hrx index d9fcc67618..f64ef2b863 100644 --- a/spec/core_functions/selector/is_superselector/complex/adjacent_sibling.hrx +++ b/spec/core_functions/selector/is_superselector/complex/adjacent_sibling.hrx @@ -1,5 +1,6 @@ <===> single/in_sub/input.scss -a {b: is-superselector("c", "d + c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d + c")} <===> single/in_sub/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> single/in_super/input.scss -a {b: is-superselector("c + d", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c + d", "d")} <===> single/in_super/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> single/in_both/equal/input.scss -a {b: is-superselector("c + d", "c + d")} +@use "sass:selector"; +a {b: selector.is-superselector("c + d", "c + d")} <===> single/in_both/equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> single/in_both/subset/input.scss -a {b: is-superselector("c + d", "c.e + d.f")} +@use "sass:selector"; +a {b: selector.is-superselector("c + d", "c.e + d.f")} <===> single/in_both/subset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> single/in_both/superset/input.scss -a {b: is-superselector("c.e + d.f", "c + d")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e + d.f", "c + d")} <===> single/in_both/superset/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> multiple/in_sub/input.scss -a {b: is-superselector("c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d + e + c")} <===> multiple/in_sub/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> multiple/first/input.scss -a {b: is-superselector("d + c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("d + c", "d + e + c")} <===> multiple/first/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> multiple/second/input.scss -a {b: is-superselector("e + c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("e + c", "d + e + c")} <===> multiple/second/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> multiple/neither/input.scss -a {b: is-superselector("f + c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("f + c", "d + e + c")} <===> multiple/neither/output.css a { @@ -94,7 +103,8 @@ Regression tests for sass/dart-sass#1843. <===> ================================================================================ <===> multiple/extra_middle/descendant/input.scss -a {b: is-superselector("a + b + c", "a + x b + c")} +@use "sass:selector"; +a {b: selector.is-superselector("a + b + c", "a + x b + c")} <===> multiple/extra_middle/descendant/output.css a { @@ -104,7 +114,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/child/input.scss -a {b: is-superselector("a + b + c", "a + x > b + c")} +@use "sass:selector"; +a {b: selector.is-superselector("a + b + c", "a + x > b + c")} <===> multiple/extra_middle/child/output.css a { @@ -114,7 +125,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/following_sibling/input.scss -a {b: is-superselector("a + b + c", "a + x ~ b + c")} +@use "sass:selector"; +a {b: selector.is-superselector("a + b + c", "a + x ~ b + c")} <===> multiple/extra_middle/following_sibling/output.css a { @@ -124,7 +136,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/next_sibling/input.scss -a {b: is-superselector("a + b + c", "a + x + b + c")} +@use "sass:selector"; +a {b: selector.is-superselector("a + b + c", "a + x + b + c")} <===> multiple/extra_middle/next_sibling/output.css a { diff --git a/spec/core_functions/selector/is_superselector/complex/bogus.hrx b/spec/core_functions/selector/is_superselector/complex/bogus.hrx index 261567d1f4..fbbfc0e11c 100644 --- a/spec/core_functions/selector/is_superselector/complex/bogus.hrx +++ b/spec/core_functions/selector/is_superselector/complex/bogus.hrx @@ -1,5 +1,6 @@ <===> super/input.scss -a {b: is-superselector("> c", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("> c", "c")} <===> super/output.css a { @@ -13,15 +14,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: is-superselector("> c", "c")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("> c", "c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> sub/input.scss -a {b: is-superselector("c", "d + ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d + ~ c")} <===> sub/output.css a { @@ -35,7 +37,7 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: is-superselector("c", "d + ~ c")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("c", "d + ~ c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/is_superselector/complex/child.hrx b/spec/core_functions/selector/is_superselector/complex/child.hrx index a7ca099729..2b7b44c8f3 100644 --- a/spec/core_functions/selector/is_superselector/complex/child.hrx +++ b/spec/core_functions/selector/is_superselector/complex/child.hrx @@ -1,5 +1,6 @@ <===> single/in_sub/input.scss -a {b: is-superselector("c", "d > c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d > c")} <===> single/in_sub/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> single/in_super/input.scss -a {b: is-superselector("c > d", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c > d", "d")} <===> single/in_super/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> single/in_both/equal/input.scss -a {b: is-superselector("c > d", "c > d")} +@use "sass:selector"; +a {b: selector.is-superselector("c > d", "c > d")} <===> single/in_both/equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> single/in_both/subset/input.scss -a {b: is-superselector("c > d", "c.e > d.f")} +@use "sass:selector"; +a {b: selector.is-superselector("c > d", "c.e > d.f")} <===> single/in_both/subset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> single/in_both/superset/input.scss -a {b: is-superselector("c.e > d.f", "c > d")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e > d.f", "c > d")} <===> single/in_both/superset/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> multiple/in_sub/input.scss -a {b: is-superselector("c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d > e > c")} <===> multiple/in_sub/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> multiple/first/input.scss -a {b: is-superselector("d > c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("d > c", "d > e > c")} <===> multiple/first/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> multiple/second/input.scss -a {b: is-superselector("e > c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("e > c", "d > e > c")} <===> multiple/second/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> multiple/neither/input.scss -a {b: is-superselector("f > c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("f > c", "d > e > c")} <===> multiple/neither/output.css a { @@ -94,7 +103,8 @@ Regression tests for sass/dart-sass#1843. <===> ================================================================================ <===> multiple/extra_middle/descendant/input.scss -a {b: is-superselector("a > b > c", "a > x b > c")} +@use "sass:selector"; +a {b: selector.is-superselector("a > b > c", "a > x b > c")} <===> multiple/extra_middle/descendant/output.css a { @@ -104,7 +114,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/child/input.scss -a {b: is-superselector("a > b > c", "a > x > b > c")} +@use "sass:selector"; +a {b: selector.is-superselector("a > b > c", "a > x > b > c")} <===> multiple/extra_middle/child/output.css a { @@ -114,7 +125,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/following_sibling/input.scss -a {b: is-superselector("a > b > c", "a > x ~ b > c")} +@use "sass:selector"; +a {b: selector.is-superselector("a > b > c", "a > x ~ b > c")} <===> multiple/extra_middle/following_sibling/output.css a { @@ -124,7 +136,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/next_sibling/input.scss -a {b: is-superselector("a > b > c", "a > x + b > c")} +@use "sass:selector"; +a {b: selector.is-superselector("a > b > c", "a > x + b > c")} <===> multiple/extra_middle/next_sibling/output.css a { diff --git a/spec/core_functions/selector/is_superselector/complex/descendant.hrx b/spec/core_functions/selector/is_superselector/complex/descendant.hrx index e03035b7b2..9aa2389f13 100644 --- a/spec/core_functions/selector/is_superselector/complex/descendant.hrx +++ b/spec/core_functions/selector/is_superselector/complex/descendant.hrx @@ -1,5 +1,6 @@ <===> single/in_sub/input.scss -a {b: is-superselector("c", "d c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d c")} <===> single/in_sub/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> single/in_super/input.scss -a {b: is-superselector("c d", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c d", "d")} <===> single/in_super/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> single/in_both/equal/input.scss -a {b: is-superselector("c d", "c d")} +@use "sass:selector"; +a {b: selector.is-superselector("c d", "c d")} <===> single/in_both/equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> single/in_both/subset/input.scss -a {b: is-superselector("c d", "c.e d.f")} +@use "sass:selector"; +a {b: selector.is-superselector("c d", "c.e d.f")} <===> single/in_both/subset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> single/in_both/superset/input.scss -a {b: is-superselector("c.e d.f", "c d")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e d.f", "c d")} <===> single/in_both/superset/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> multiple/in_sub/input.scss -a {b: is-superselector("c", "d e c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d e c")} <===> multiple/in_sub/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> multiple/match_first/input.scss -a {b: is-superselector("d c", "d e c")} +@use "sass:selector"; +a {b: selector.is-superselector("d c", "d e c")} <===> multiple/match_first/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> multiple/match_second/input.scss -a {b: is-superselector("e c", "d e c")} +@use "sass:selector"; +a {b: selector.is-superselector("e c", "d e c")} <===> multiple/match_second/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> multiple/match_neither/input.scss -a {b: is-superselector("f c", "d e c")} +@use "sass:selector"; +a {b: selector.is-superselector("f c", "d e c")} <===> multiple/match_neither/output.css a { @@ -94,7 +103,8 @@ Regression tests for sass/dart-sass#1843. <===> ================================================================================ <===> multiple/extra_middle/descendant/input.scss -a {b: is-superselector("a b c", "a x b c")} +@use "sass:selector"; +a {b: selector.is-superselector("a b c", "a x b c")} <===> multiple/extra_middle/descendant/output.css a { @@ -104,7 +114,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/child/input.scss -a {b: is-superselector("a b c", "a x > b c")} +@use "sass:selector"; +a {b: selector.is-superselector("a b c", "a x > b c")} <===> multiple/extra_middle/child/output.css a { @@ -114,7 +125,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/following_sibling/input.scss -a {b: is-superselector("a b c", "a x ~ b c")} +@use "sass:selector"; +a {b: selector.is-superselector("a b c", "a x ~ b c")} <===> multiple/extra_middle/following_sibling/output.css a { @@ -124,7 +136,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/next_sibling/input.scss -a {b: is-superselector("a b c", "a x + b c")} +@use "sass:selector"; +a {b: selector.is-superselector("a b c", "a x + b c")} <===> multiple/extra_middle/next_sibling/output.css a { @@ -134,7 +147,8 @@ a { <===> ================================================================================ <===> and_child/super/input.scss -a {b: is-superselector("d c", "d > c")} +@use "sass:selector"; +a {b: selector.is-superselector("d c", "d > c")} <===> and_child/super/output.css a { @@ -144,7 +158,8 @@ a { <===> ================================================================================ <===> and_child/sub/input.scss -a {b: is-superselector("d > c", "d c")} +@use "sass:selector"; +a {b: selector.is-superselector("d > c", "d c")} <===> and_child/sub/output.css a { @@ -154,7 +169,8 @@ a { <===> ================================================================================ <===> and_child/multiple/first/input.scss -a {b: is-superselector("d c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("d c", "d > e > c")} <===> and_child/multiple/first/output.css a { @@ -164,7 +180,8 @@ a { <===> ================================================================================ <===> and_child/multiple/second/input.scss -a {b: is-superselector("e c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("e c", "d > e > c")} <===> and_child/multiple/second/output.css a { @@ -174,7 +191,8 @@ a { <===> ================================================================================ <===> and_child/multiple/neither/input.scss -a {b: is-superselector("f c", "d > e > c")} +@use "sass:selector"; +a {b: selector.is-superselector("f c", "d > e > c")} <===> and_child/multiple/neither/output.css a { diff --git a/spec/core_functions/selector/is_superselector/complex/sibling.hrx b/spec/core_functions/selector/is_superselector/complex/sibling.hrx index 3c1afbc030..2c4b3cd7b7 100644 --- a/spec/core_functions/selector/is_superselector/complex/sibling.hrx +++ b/spec/core_functions/selector/is_superselector/complex/sibling.hrx @@ -1,5 +1,6 @@ <===> single/in_sub/input.scss -a {b: is-superselector("c", "d ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d ~ c")} <===> single/in_sub/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> single/in_super/input.scss -a {b: is-superselector("c ~ d", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c ~ d", "d")} <===> single/in_super/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> single/in_both/equal/input.scss -a {b: is-superselector("c ~ d", "c ~ d")} +@use "sass:selector"; +a {b: selector.is-superselector("c ~ d", "c ~ d")} <===> single/in_both/equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> single/in_both/subset/input.scss -a {b: is-superselector("c ~ d", "c.e ~ d.f")} +@use "sass:selector"; +a {b: selector.is-superselector("c ~ d", "c.e ~ d.f")} <===> single/in_both/subset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> single/in_both/superset/input.scss -a {b: is-superselector("c.e ~ d.f", "c ~ d")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e ~ d.f", "c ~ d")} <===> single/in_both/superset/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> multiple/in_sub/input.scss -a {b: is-superselector("c", "d ~ e ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d ~ e ~ c")} <===> multiple/in_sub/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> multiple/first/input.scss -a {b: is-superselector("d ~ c", "d ~ e ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("d ~ c", "d ~ e ~ c")} <===> multiple/first/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> multiple/second/input.scss -a {b: is-superselector("e ~ c", "d ~ e ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("e ~ c", "d ~ e ~ c")} <===> multiple/second/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> multiple/neither/input.scss -a {b: is-superselector("f ~ c", "d ~ e ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("f ~ c", "d ~ e ~ c")} <===> multiple/neither/output.css a { @@ -94,7 +103,8 @@ Regression tests for sass/dart-sass#1843. <===> ================================================================================ <===> multiple/extra_middle/descendant/input.scss -a {b: is-superselector("a ~ b ~ c", "a ~ x b ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("a ~ b ~ c", "a ~ x b ~ c")} <===> multiple/extra_middle/descendant/output.css a { @@ -104,7 +114,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/child/input.scss -a {b: is-superselector("a ~ b ~ c", "a ~ x > b ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("a ~ b ~ c", "a ~ x > b ~ c")} <===> multiple/extra_middle/child/output.css a { @@ -114,7 +125,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/following_sibling/input.scss -a {b: is-superselector("a ~ b ~ c", "a ~ x ~ b ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("a ~ b ~ c", "a ~ x ~ b ~ c")} <===> multiple/extra_middle/following_sibling/output.css a { @@ -124,7 +136,8 @@ a { <===> ================================================================================ <===> multiple/extra_middle/next_sibling/input.scss -a {b: is-superselector("a ~ b ~ c", "a ~ x + b ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("a ~ b ~ c", "a ~ x + b ~ c")} <===> multiple/extra_middle/next_sibling/output.css a { @@ -134,7 +147,8 @@ a { <===> ================================================================================ <===> and_adjacent_sibling/super/input.scss -a {b: is-superselector("d ~ c", "d + c")} +@use "sass:selector"; +a {b: selector.is-superselector("d ~ c", "d + c")} <===> and_adjacent_sibling/super/output.css a { @@ -144,7 +158,8 @@ a { <===> ================================================================================ <===> and_adjacent_sibling/sub/input.scss -a {b: is-superselector("d + c", "d ~ c")} +@use "sass:selector"; +a {b: selector.is-superselector("d + c", "d ~ c")} <===> and_adjacent_sibling/sub/output.css a { @@ -154,7 +169,8 @@ a { <===> ================================================================================ <===> and_adjacent_sibling/multiple/first/input.scss -a {b: is-superselector("d ~ c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("d ~ c", "d + e + c")} <===> and_adjacent_sibling/multiple/first/output.css a { @@ -164,7 +180,8 @@ a { <===> ================================================================================ <===> and_adjacent_sibling/multiple/second/input.scss -a {b: is-superselector("e ~ c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("e ~ c", "d + e + c")} <===> and_adjacent_sibling/multiple/second/output.css a { @@ -174,7 +191,8 @@ a { <===> ================================================================================ <===> and_adjacent_sibling/multiple/neither/input.scss -a {b: is-superselector("f ~ c", "d + e + c")} +@use "sass:selector"; +a {b: selector.is-superselector("f ~ c", "d + e + c")} <===> and_adjacent_sibling/multiple/neither/output.css a { diff --git a/spec/core_functions/selector/is_superselector/compound.hrx b/spec/core_functions/selector/is_superselector/compound.hrx index 3a4c40b98e..68130daf04 100644 --- a/spec/core_functions/selector/is_superselector/compound.hrx +++ b/spec/core_functions/selector/is_superselector/compound.hrx @@ -11,7 +11,8 @@ of the other. <===> ================================================================================ <===> same_order/input.scss -a {b: is-superselector("c", "c.d")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c.d")} <===> same_order/output.css a { @@ -21,7 +22,8 @@ a { <===> ================================================================================ <===> different_order/input.scss -a {b: is-superselector("c.e", "c:d.e")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e", "c:d.e")} <===> different_order/output.css a { @@ -31,7 +33,8 @@ a { <===> ================================================================================ <===> superset/input.scss -a {b: is-superselector("c.d", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("c.d", "c")} <===> superset/output.css a { @@ -41,7 +44,8 @@ a { <===> ================================================================================ <===> pseudo_element/present/input.scss -a {b: is-superselector("::d", "c::d")} +@use "sass:selector"; +a {b: selector.is-superselector("::d", "c::d")} <===> pseudo_element/present/output.css a { @@ -51,7 +55,8 @@ a { <===> ================================================================================ <===> pseudo_element/absent/in_1/input.scss -a {b: is-superselector("c", "c::d")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c::d")} <===> pseudo_element/absent/in_1/output.css a { @@ -61,7 +66,8 @@ a { <===> ================================================================================ <===> pseudo_element/absent/in_2/input.scss -a {b: is-superselector("c::d", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("c::d", "c")} <===> pseudo_element/absent/in_2/output.css a { @@ -71,7 +77,8 @@ a { <===> ================================================================================ <===> pseudo_element/subset/before/input.scss -a {b: is-superselector(".c::d", ".c.e::d")} +@use "sass:selector"; +a {b: selector.is-superselector(".c::d", ".c.e::d")} <===> pseudo_element/subset/before/output.css a { @@ -81,7 +88,8 @@ a { <===> ================================================================================ <===> pseudo_element/subset/after/input.scss -a {b: is-superselector("::d:c", "::d:c:e")} +@use "sass:selector"; +a {b: selector.is-superselector("::d:c", "::d:c:e")} <===> pseudo_element/subset/after/output.css a { @@ -91,7 +99,8 @@ a { <===> ================================================================================ <===> pseudo_element/superset/before/input.scss -a {b: is-superselector(".c.e::d", ".c::d")} +@use "sass:selector"; +a {b: selector.is-superselector(".c.e::d", ".c::d")} <===> pseudo_element/superset/before/output.css a { @@ -101,7 +110,8 @@ a { <===> ================================================================================ <===> pseudo_element/superset/after/input.scss -a {b: is-superselector("::d:c:e", "::d:c")} +@use "sass:selector"; +a {b: selector.is-superselector("::d:c:e", "::d:c")} <===> pseudo_element/superset/after/output.css a { @@ -111,7 +121,8 @@ a { <===> ================================================================================ <===> pseudo_element/same_order/input.scss -a {b: is-superselector("::d:e", "::d:e")} +@use "sass:selector"; +a {b: selector.is-superselector("::d:e", "::d:e")} <===> pseudo_element/same_order/output.css a { @@ -121,7 +132,8 @@ a { <===> ================================================================================ <===> pseudo_element/different_order/input.scss -a {b: is-superselector(":e::d", "::d:e")} +@use "sass:selector"; +a {b: selector.is-superselector(":e::d", "::d:e")} <===> pseudo_element/different_order/output.css a { @@ -131,7 +143,8 @@ a { <===> ================================================================================ <===> pseudo_element/class_syntax/before/input.scss -a {b: is-superselector("c", "c:before")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c:before")} <===> pseudo_element/class_syntax/before/output.css a { @@ -141,7 +154,8 @@ a { <===> ================================================================================ <===> pseudo_element/class_syntax/after/input.scss -a {b: is-superselector("c", "c:after")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c:after")} <===> pseudo_element/class_syntax/after/output.css a { @@ -151,7 +165,8 @@ a { <===> ================================================================================ <===> pseudo_element/class_syntax/first_line/input.scss -a {b: is-superselector("c", "c:first-line")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c:first-line")} <===> pseudo_element/class_syntax/first_line/output.css a { @@ -161,7 +176,8 @@ a { <===> ================================================================================ <===> pseudo_element/class_syntax/first_letter/input.scss -a {b: is-superselector("c", "c:first-letter")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c:first-letter")} <===> pseudo_element/class_syntax/first_letter/output.css a { diff --git a/spec/core_functions/selector/is_superselector/error.hrx b/spec/core_functions/selector/is_superselector/error.hrx index 8879ff8158..1733b6f1a7 100644 --- a/spec/core_functions/selector/is_superselector/error.hrx +++ b/spec/core_functions/selector/is_superselector/error.hrx @@ -1,5 +1,6 @@ <===> super/parent/input.scss -a {b: is-superselector("&", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("&", "c")} <===> super/parent/error Error: $super: Parent selectors aren't allowed here. @@ -9,15 +10,16 @@ Error: $super: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: is-superselector("&", "c")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("&", "c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> super/invalid/input.scss -a {b: is-superselector("[c", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("[c", "d")} <===> super/invalid/error Error: $super: expected more input. @@ -27,29 +29,31 @@ Error: $super: expected more input. ' - 1:3 root stylesheet , -1 | a {b: is-superselector("[c", "d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("[c", "d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> super/type/input.scss -a {b: is-superselector(1, "c")} +@use "sass:selector"; +a {b: selector.is-superselector(1, "c")} <===> super/type/error Error: $super: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: is-superselector(1, "c")} - | ^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector(1, "c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> sub/parent/input.scss -a {b: is-superselector("c", "&")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "&")} <===> sub/parent/error Error: $sub: Parent selectors aren't allowed here. @@ -59,15 +63,16 @@ Error: $sub: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: is-superselector("c", "&")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("c", "&")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> sub/invalid/input.scss -a {b: is-superselector("c", "[d")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "[d")} <===> sub/invalid/error Error: $sub: expected more input. @@ -77,55 +82,58 @@ Error: $sub: expected more input. ' - 1:3 root stylesheet , -1 | a {b: is-superselector("c", "[d")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("c", "[d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> sub/type/input.scss -a {b: is-superselector("c", 1)} +@use "sass:selector"; +a {b: selector.is-superselector("c", 1)} <===> sub/type/error Error: $sub: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: is-superselector("c", 1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: selector.is-superselector("c", 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many_args/input.scss -a {b: is-superselector("c", "d", "e")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d", "e")} <===> too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: is-superselector("c", "d", "e")} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: selector.is-superselector("c", "d", "e")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function is-superselector($super, $sub) { | ============================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_few_args/input.scss -a {b: is-superselector("c")} +@use "sass:selector"; +a {b: selector.is-superselector("c")} <===> too_few_args/error Error: Missing argument $sub. ,--> input.scss -1 | a {b: is-superselector("c")} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: selector.is-superselector("c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function is-superselector($super, $sub) { | ============================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/is_superselector/input.hrx b/spec/core_functions/selector/is_superselector/input.hrx index 551fd96c81..85aebd9ef3 100644 --- a/spec/core_functions/selector/is_superselector/input.hrx +++ b/spec/core_functions/selector/is_superselector/input.hrx @@ -1,7 +1,8 @@ <===> input.scss +@use "sass:selector"; // The full set of possible input formats is tested with `selector-parse()`; // this spec just verifies one example for `is-superselector()`. -a {b: is-superselector((c, d e), (c, d e))} +a {b: selector.is-superselector((c, d e), (c, d e))} <===> output.css a { diff --git a/spec/core_functions/selector/is_superselector/list.hrx b/spec/core_functions/selector/is_superselector/list.hrx index 5617c485b4..407902c0e9 100644 --- a/spec/core_functions/selector/is_superselector/list.hrx +++ b/spec/core_functions/selector/is_superselector/list.hrx @@ -1,5 +1,6 @@ <===> two/in_sub/input.scss -a {b: is-superselector("c", "c, d")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c, d")} <===> two/in_sub/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> two/in_super/input.scss -a {b: is-superselector("c, d", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d", "c")} <===> two/in_super/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> two/in_both/equal/input.scss -a {b: is-superselector("c, d", "c, d")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d", "c, d")} <===> two/in_both/equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> two/in_both/subset/input.scss -a {b: is-superselector("c, d", "c.e, d.f")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d", "c.e, d.f")} <===> two/in_both/subset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> two/in_both/superset/input.scss -a {b: is-superselector("c.e, d.f", "c, d")} +@use "sass:selector"; +a {b: selector.is-superselector("c.e, d.f", "c, d")} <===> two/in_both/superset/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> two/both_satisfied_by_one_superselector/input.scss -a {b: is-superselector(".c", "d.c, e.c")} +@use "sass:selector"; +a {b: selector.is-superselector(".c", "d.c, e.c")} <===> two/both_satisfied_by_one_superselector/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> three/match_one/input.scss -a {b: is-superselector("c, d, e", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d, e", "d")} <===> three/match_one/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> three/match_two/input.scss -a {b: is-superselector("c, d, e", "e, c")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d, e", "e, c")} <===> three/match_two/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> three/match_three/input.scss -a {b: is-superselector("c, d, e", "d, c, e")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d, e", "d, c, e")} <===> three/match_three/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> three/miss_one/input.scss -a {b: is-superselector("c, d, e", "c, f")} +@use "sass:selector"; +a {b: selector.is-superselector("c, d, e", "c, f")} <===> three/miss_one/output.css a { diff --git a/spec/core_functions/selector/is_superselector/named.hrx b/spec/core_functions/selector/is_superselector/named.hrx index cf73d9b143..e4dcdbe23f 100644 --- a/spec/core_functions/selector/is_superselector/named.hrx +++ b/spec/core_functions/selector/is_superselector/named.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: is-superselector($super: "c", $sub: "c.d")} +@use "sass:selector"; +a {b: selector.is-superselector($super: "c", $sub: "c.d")} <===> output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/attribute.hrx b/spec/core_functions/selector/is_superselector/simple/attribute.hrx index 5cc38f3c50..8c91068d84 100644 --- a/spec/core_functions/selector/is_superselector/simple/attribute.hrx +++ b/spec/core_functions/selector/is_superselector/simple/attribute.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector("[c=d]", "[c=d]")} +@use "sass:selector"; +a {b: selector.is-superselector("[c=d]", "[c=d]")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unequal/name/input.scss -a {b: is-superselector("[c=d]", "[e=d]")} +@use "sass:selector"; +a {b: selector.is-superselector("[c=d]", "[e=d]")} <===> unequal/name/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> unequal/value/input.scss -a {b: is-superselector("[c=d]", "[c=e]")} +@use "sass:selector"; +a {b: selector.is-superselector("[c=d]", "[c=e]")} <===> unequal/value/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> unequal/operator/input.scss -a {b: is-superselector("[c=d]", "[c^=d]")} +@use "sass:selector"; +a {b: selector.is-superselector("[c=d]", "[c^=d]")} <===> unequal/operator/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/class.hrx b/spec/core_functions/selector/is_superselector/simple/class.hrx index 5273516641..319af3c275 100644 --- a/spec/core_functions/selector/is_superselector/simple/class.hrx +++ b/spec/core_functions/selector/is_superselector/simple/class.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector(".c", ".c")} +@use "sass:selector"; +a {b: selector.is-superselector(".c", ".c")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unequal/input.scss -a {b: is-superselector(".c", ".d")} +@use "sass:selector"; +a {b: selector.is-superselector(".c", ".d")} <===> unequal/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/id.hrx b/spec/core_functions/selector/is_superselector/simple/id.hrx index 6419de5c35..612f984e23 100644 --- a/spec/core_functions/selector/is_superselector/simple/id.hrx +++ b/spec/core_functions/selector/is_superselector/simple/id.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector("#c", "#c")} +@use "sass:selector"; +a {b: selector.is-superselector("#c", "#c")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unequal/input.scss -a {b: is-superselector("#c", "#d")} +@use "sass:selector"; +a {b: selector.is-superselector("#c", "#d")} <===> unequal/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/placeholder.hrx b/spec/core_functions/selector/is_superselector/simple/placeholder.hrx index e474abf5e5..438425bdfb 100644 --- a/spec/core_functions/selector/is_superselector/simple/placeholder.hrx +++ b/spec/core_functions/selector/is_superselector/simple/placeholder.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector("%c", "%c")} +@use "sass:selector"; +a {b: selector.is-superselector("%c", "%c")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unequal/input.scss -a {b: is-superselector("%c", "%d")} +@use "sass:selector"; +a {b: selector.is-superselector("%c", "%d")} <===> unequal/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/arg.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/arg.hrx index d8d6db7dce..e3f795025e 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/arg.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/arg.hrx @@ -1,5 +1,6 @@ <===> class/equal/input.scss -a {b: is-superselector(":c(@#$)", ":c(@#$)")} +@use "sass:selector"; +a {b: selector.is-superselector(":c(@#$)", ":c(@#$)")} <===> class/equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> class/unequal/name/input.scss -a {b: is-superselector(":c(@#$)", ":d(@#$)")} +@use "sass:selector"; +a {b: selector.is-superselector(":c(@#$)", ":d(@#$)")} <===> class/unequal/name/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> class/unequal/argument/input.scss -a {b: is-superselector(":c(@#$)", ":c(*&^)")} +@use "sass:selector"; +a {b: selector.is-superselector(":c(@#$)", ":c(*&^)")} <===> class/unequal/argument/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> class/unequal/has_argument/input.scss -a {b: is-superselector(":c(@#$)", ":c")} +@use "sass:selector"; +a {b: selector.is-superselector(":c(@#$)", ":c")} <===> class/unequal/has_argument/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> element/equal/input.scss -a {b: is-superselector("::c(@#$)", "::c(@#$)")} +@use "sass:selector"; +a {b: selector.is-superselector("::c(@#$)", "::c(@#$)")} <===> element/equal/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> element/unequal/name/input.scss -a {b: is-superselector("::c(@#$)", ":d(@#$)")} +@use "sass:selector"; +a {b: selector.is-superselector("::c(@#$)", ":d(@#$)")} <===> element/unequal/name/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> element/unequal/argument/input.scss -a {b: is-superselector("::c(@#$)", "::c(*&^)")} +@use "sass:selector"; +a {b: selector.is-superselector("::c(@#$)", "::c(*&^)")} <===> element/unequal/argument/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> element/unequal/has_argument/input.scss -a {b: is-superselector("::c(@#$)", "::c")} +@use "sass:selector"; +a {b: selector.is-superselector("::c(@#$)", "::c")} <===> element/unequal/has_argument/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/no_arg.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/no_arg.hrx index 1664d03144..900166ef19 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/no_arg.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/no_arg.hrx @@ -1,5 +1,6 @@ <===> class/equal/input.scss -a {b: is-superselector(":c", ":c")} +@use "sass:selector"; +a {b: selector.is-superselector(":c", ":c")} <===> class/equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> class/unequal/input.scss -a {b: is-superselector(":c", ":d")} +@use "sass:selector"; +a {b: selector.is-superselector(":c", ":d")} <===> class/unequal/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> class/and_element/input.scss -a {b: is-superselector(":c", "::c")} +@use "sass:selector"; +a {b: selector.is-superselector(":c", "::c")} <===> class/and_element/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> element/equal/input.scss -a {b: is-superselector("::c", "::c")} +@use "sass:selector"; +a {b: selector.is-superselector("::c", "::c")} <===> element/equal/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> element/unequal/input.scss -a {b: is-superselector("::c", "::d")} +@use "sass:selector"; +a {b: selector.is-superselector("::c", "::d")} <===> element/unequal/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> element/and_class/input.scss -a {b: is-superselector("::c", ":c")} +@use "sass:selector"; +a {b: selector.is-superselector("::c", ":c")} <===> element/and_class/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/any.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/any.hrx index d517736ce2..cf3b4f2a58 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/any.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/any.hrx @@ -6,7 +6,8 @@ but only a small range is tested here. <===> ================================================================================ <===> superset/input.scss -a {b: is-superselector(":any(c d, e f, g h)", "c d.i, e j f")} +@use "sass:selector"; +a {b: selector.is-superselector(":any(c d, e f, g h)", "c d.i, e j f")} <===> superset/output.css a { @@ -16,7 +17,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":any(c d.i, e j f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":any(c d.i, e j f)", "c d, e f, g h")} <===> subset/output.css a { @@ -26,7 +28,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-any(c d, e f, g h)", "c d.i, e j f")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-any(c d, e f, g h)", "c d.i, e j f")} <===> prefix/superset/output.css a { @@ -36,7 +39,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-any(c d.i, e j f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-any(c d.i, e j f)", "c d, e f, g h")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/current.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/current.hrx index a5b2394f49..968448ea10 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/current.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/current.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector(":current(c d, e f, g h)", ":current(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":current(c d, e f, g h)", ":current(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":current(c d.i, e j f)", ":current(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":current(c d.i, e j f)", ":current(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> equal/input.scss -a {b: is-superselector(":current(c d, e f)", ":current(c d, e f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":current(c d, e f)", ":current(c d, e f)")} <===> equal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":current(c d, e f)", "c d, e f")} +@use "sass:selector"; +a {b: selector.is-superselector(":current(c d, e f)", "c d, e f")} <===> bare_sub/output.css a { @@ -39,8 +43,9 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-current(c d, e f, g h)", ":-pfx-current(c d.i, e j f)"); } @@ -53,8 +58,9 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-current(c d.i, e j f)", ":-pfx-current(c d, e f, g h)"); } @@ -67,7 +73,8 @@ a { <===> ================================================================================ <===> prefix/equal/input.scss -a {b: is-superselector(":-pfx-current(c d, e f)", ":-pfx-current(c d, e f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-current(c d, e f)", ":-pfx-current(c d, e f)")} <===> prefix/equal/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/has.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/has.hrx index 3eaf1ca305..48bea5c6b7 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/has.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/has.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector(":has(c d, e f, g h)", ":has(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":has(c d, e f, g h)", ":has(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":has(c d.i, e j f)", ":has(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":has(c d.i, e j f)", ":has(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":has(c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":has(c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-has(c d, e f, g h)", ":-pfx-has(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-has(c d, e f, g h)", ":-pfx-has(c d.i, e j f)")} <===> prefix/superset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-has(c d.i, e j f)", ":-pfx-has(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-has(c d.i, e j f)", ":-pfx-has(c d, e f, g h)")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host.hrx index be0b056f8d..d4b045e5c8 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector(":host(c d, e f, g h)", ":host(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":host(c d, e f, g h)", ":host(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":host(c d.i, e j f)", ":host(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":host(c d.i, e j f)", ":host(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":host(c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":host(c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-host(c d, e f, g h)", ":-pfx-host(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-host(c d, e f, g h)", ":-pfx-host(c d.i, e j f)")} <===> prefix/superset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-host(c d.i, e j f)", ":-pfx-host(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-host(c d.i, e j f)", ":-pfx-host(c d, e f, g h)")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host_context.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host_context.hrx index 30543c8cb0..64e3566483 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host_context.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/host_context.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector(":host-context(c d, e f, g h)", ":host-context(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":host-context(c d, e f, g h)", ":host-context(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":host-context(c d.i, e j f)", ":host-context(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":host-context(c d.i, e j f)", ":host-context(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":host-context(c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":host-context(c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-host-context(c d, e f, g h)", ":-pfx-host-context(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-host-context(c d, e f, g h)", ":-pfx-host-context(c d.i, e j f)")} <===> prefix/superset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-host-context(c d.i, e j f)", ":-pfx-host-context(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-host-context(c d.i, e j f)", ":-pfx-host-context(c d, e f, g h)")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/is.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/is.hrx index 1cf6bc1f1f..30a83491ce 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/is.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/is.hrx @@ -14,7 +14,8 @@ Most changes here should also be reflected in `where.hrx` and `matches.hrx`. <===> ================================================================================ <===> simple/equal/input.scss -a {b: is-superselector(":is(c)", "c")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c)", "c")} <===> simple/equal/output.css a { @@ -24,7 +25,8 @@ a { <===> ================================================================================ <===> simple/unequal/input.scss -a {b: is-superselector(":is(c)", "d")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c)", "d")} <===> simple/unequal/output.css a { @@ -34,7 +36,8 @@ a { <===> ================================================================================ <===> compound/superset/input.scss -a {b: is-superselector(":is(c.e)", "c.d.e")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c.e)", "c.d.e")} <===> compound/superset/output.css a { @@ -44,7 +47,8 @@ a { <===> ================================================================================ <===> compound/subset/input.scss -a {b: is-superselector(":is(c.d.e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c.d.e)", "c e")} <===> compound/subset/output.css a { @@ -54,7 +58,8 @@ a { <===> ================================================================================ <===> complex/superset/input.scss -a {b: is-superselector(":is(c e)", "c d e")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c e)", "c d e")} <===> complex/superset/output.css a { @@ -64,7 +69,8 @@ a { <===> ================================================================================ <===> complex/subset/input.scss -a {b: is-superselector(":is(c d e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c d e)", "c e")} <===> complex/subset/output.css a { @@ -74,7 +80,8 @@ a { <===> ================================================================================ <===> list/superset/input.scss -a {b: is-superselector(":is(c d, e f, g h)", "c d, e f")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c d, e f, g h)", "c d, e f")} <===> list/superset/output.css a { @@ -84,7 +91,8 @@ a { <===> ================================================================================ <===> list/subset/input.scss -a {b: is-superselector(":is(c d, e f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c d, e f)", "c d, e f, g h")} <===> list/subset/output.css a { @@ -101,7 +109,8 @@ check on those two selectors in isolation. <===> ================================================================================ <===> both/superset/input.scss -a {b: is-superselector(":is(c d, e f, g h)", ":is(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c d, e f, g h)", ":is(c d.i, e j f)")} <===> both/superset/output.css a { @@ -111,7 +120,8 @@ a { <===> ================================================================================ <===> both/subset/input.scss -a {b: is-superselector(":is(c d.i, e j f)", ":is(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c d.i, e j f)", ":is(c d, e f, g h)")} <===> both/subset/output.css a { @@ -121,7 +131,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-is(c d, e f, g h)", "c d.i, e j f")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-is(c d, e f, g h)", "c d.i, e j f")} <===> prefix/superset/output.css a { @@ -131,7 +142,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-is(c d.i, e j f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-is(c d.i, e j f)", "c d, e f, g h")} <===> prefix/subset/output.css a { @@ -147,7 +159,8 @@ semantics, because in practice they match different browsers. <===> ================================================================================ <===> not_superselector_of/any/input.scss -a {b: is-superselector(":is(c, d)", ":any(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c, d)", ":any(c, d)")} <===> not_superselector_of/any/output.css a { @@ -157,7 +170,8 @@ a { <===> ================================================================================ <===> not_superselector_of/prefixed/input.scss -a {b: is-superselector(":is(c, d)", ":-pfx-is(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":is(c, d)", ":-pfx-is(c, d)")} <===> not_superselector_of/prefixed/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/matches.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/matches.hrx index 1ad1008631..83d8f7fd22 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/matches.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/matches.hrx @@ -14,7 +14,8 @@ Most changes here should also be reflected in `is.hrx` and `where.hrx`. <===> ================================================================================ <===> simple/equal/input.scss -a {b: is-superselector(":matches(c)", "c")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c)", "c")} <===> simple/equal/output.css a { @@ -24,7 +25,8 @@ a { <===> ================================================================================ <===> simple/unequal/input.scss -a {b: is-superselector(":matches(c)", "d")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c)", "d")} <===> simple/unequal/output.css a { @@ -34,7 +36,8 @@ a { <===> ================================================================================ <===> compound/superset/input.scss -a {b: is-superselector(":matches(c.e)", "c.d.e")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c.e)", "c.d.e")} <===> compound/superset/output.css a { @@ -44,7 +47,8 @@ a { <===> ================================================================================ <===> compound/subset/input.scss -a {b: is-superselector(":matches(c.d.e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c.d.e)", "c e")} <===> compound/subset/output.css a { @@ -54,7 +58,8 @@ a { <===> ================================================================================ <===> complex/superset/input.scss -a {b: is-superselector(":matches(c e)", "c d e")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c e)", "c d e")} <===> complex/superset/output.css a { @@ -64,7 +69,8 @@ a { <===> ================================================================================ <===> complex/subset/input.scss -a {b: is-superselector(":matches(c d e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c d e)", "c e")} <===> complex/subset/output.css a { @@ -74,7 +80,8 @@ a { <===> ================================================================================ <===> list/superset/input.scss -a {b: is-superselector(":matches(c d, e f, g h)", "c d, e f")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c d, e f, g h)", "c d, e f")} <===> list/superset/output.css a { @@ -84,7 +91,8 @@ a { <===> ================================================================================ <===> list/subset/input.scss -a {b: is-superselector(":matches(c d, e f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c d, e f)", "c d, e f, g h")} <===> list/subset/output.css a { @@ -101,7 +109,8 @@ check on those two selectors in isolation. <===> ================================================================================ <===> both/superset/input.scss -a {b: is-superselector(":matches(c d, e f, g h)", ":matches(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c d, e f, g h)", ":matches(c d.i, e j f)")} <===> both/superset/output.css a { @@ -111,7 +120,8 @@ a { <===> ================================================================================ <===> both/subset/input.scss -a {b: is-superselector(":matches(c d.i, e j f)", ":matches(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c d.i, e j f)", ":matches(c d, e f, g h)")} <===> both/subset/output.css a { @@ -121,7 +131,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-matches(c d, e f, g h)", "c d.i, e j f")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-matches(c d, e f, g h)", "c d.i, e j f")} <===> prefix/superset/output.css a { @@ -131,7 +142,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-matches(c d.i, e j f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-matches(c d.i, e j f)", "c d, e f, g h")} <===> prefix/subset/output.css a { @@ -147,7 +159,8 @@ semantics, because in practice they match different browsers. <===> ================================================================================ <===> not_superselector_of/any/input.scss -a {b: is-superselector(":matches(c, d)", ":any(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c, d)", ":any(c, d)")} <===> not_superselector_of/any/output.css a { @@ -157,7 +170,8 @@ a { <===> ================================================================================ <===> not_superselector_of/prefixed/input.scss -a {b: is-superselector(":matches(c, d)", ":-pfx-matches(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":matches(c, d)", ":-pfx-matches(c, d)")} <===> not_superselector_of/prefixed/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/not.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/not.hrx index 835a6f4917..2d35a37b13 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/not.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/not.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector(":not(c d, e f, g h)", ":not(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d, e f, g h)", ":not(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector(":not(c d.i, e j f)", ":not(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d.i, e j f)", ":not(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":not(c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> type/input.scss -a {b: is-superselector(":not(c.d)", "e")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c.d)", "e")} <===> type/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> id/input.scss -a {b: is-superselector(":not(#c.d)", "#e")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(#c.d)", "#e")} <===> id/output.css a { @@ -57,7 +62,8 @@ of elements matched by its selector gets, `:not(X, Y)` is equivalent to <===> ================================================================================ <===> equivalence/split_super/superset/input.scss -a {b: is-superselector(":not(c d):not(e f):not(g h)", ":not(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d):not(e f):not(g h)", ":not(c d.i, e j f)")} <===> equivalence/split_super/superset/output.css a { b: false; @@ -66,7 +72,8 @@ a { <===> ================================================================================ <===> equivalence/split_super/subset/input.scss -a {b: is-superselector(":not(c d.i):not(e j f)", ":not(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d.i):not(e j f)", ":not(c d, e f, g h)")} <===> equivalence/split_super/subset/output.css a { @@ -76,7 +83,8 @@ a { <===> ================================================================================ <===> equivalence/split_sub/superset/input.scss -a {b: is-superselector(":not(c d, e f, g h)", ":not(c d.i):not(e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d, e f, g h)", ":not(c d.i):not(e j f)")} <===> equivalence/split_sub/superset/output.css a { @@ -86,7 +94,8 @@ a { <===> ================================================================================ <===> equivalence/split_sub/subset/input.scss -a {b: is-superselector(":not(c d.i, e j f)", ":not(c d):not(e f):not(g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":not(c d.i, e j f)", ":not(c d):not(e f):not(g h)")} <===> equivalence/split_sub/subset/output.css a { @@ -96,7 +105,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-not(c d, e f, g h)", ":-pfx-not(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-not(c d, e f, g h)", ":-pfx-not(c d.i, e j f)")} <===> prefix/superset/output.css a { @@ -106,7 +116,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-not(c d.i, e j f)", ":-pfx-not(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-not(c d.i, e j f)", ":-pfx-not(c d, e f, g h)")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_child.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_child.hrx index aee5cd1b23..5bee9772b9 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_child.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_child.hrx @@ -1,6 +1,7 @@ <===> superset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":nth-child(n+1 of c d, e f, g h)", ":nth-child(n+1 of c d.i, e j f)"); } @@ -13,8 +14,9 @@ a { <===> ================================================================================ <===> subset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":nth-child(n+1 of c d.i, e j f)", ":nth-child(n+1 of c d, e f, g h)"); } @@ -27,7 +29,8 @@ a { <===> ================================================================================ <===> different_arg/input.scss -a {b: is-superselector(":nth-child(n+1 of c)", ":nth-child(n+2 of c)")} +@use "sass:selector"; +a {b: selector.is-superselector(":nth-child(n+1 of c)", ":nth-child(n+2 of c)")} <===> different_arg/output.css a { @@ -37,7 +40,8 @@ a { <===> ================================================================================ <===> bare_super/input.scss -a {b: is-superselector("c", ":nth-child(n+1 of c)")} +@use "sass:selector"; +a {b: selector.is-superselector("c", ":nth-child(n+1 of c)")} <===> bare_super/output.css a { @@ -47,7 +51,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":nth-child(n+1 of c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":nth-child(n+1 of c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -57,8 +62,9 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-nth-child(n+1 of c d, e f, g h)", ":-pfx-nth-child(n+1 of c d.i, e j f)"); } @@ -71,8 +77,9 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-nth-child(n+1 of c d.i, e j f)", ":-pfx-nth-child(n+1 of c d, e f, g h)"); } diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_last_child.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_last_child.hrx index 3077507346..e2395a8d4d 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_last_child.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/nth_last_child.hrx @@ -1,6 +1,7 @@ <===> superset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":nth-last-child(n+1 of c d, e f, g h)", ":nth-last-child(n+1 of c d.i, e j f)"); } @@ -13,8 +14,9 @@ a { <===> ================================================================================ <===> subset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":nth-last-child(n+1 of c d.i, e j f)", ":nth-last-child(n+1 of c d, e f, g h)"); } @@ -27,8 +29,9 @@ a { <===> ================================================================================ <===> different_arg/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":nth-last-child(n+1 of c)", ":nth-last-child(n+2 of c)"); } @@ -41,7 +44,8 @@ a { <===> ================================================================================ <===> bare_super/input.scss -a {b: is-superselector("c", ":nth-last-child(n+1 of c)")} +@use "sass:selector"; +a {b: selector.is-superselector("c", ":nth-last-child(n+1 of c)")} <===> bare_super/output.css a { @@ -51,7 +55,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector(":nth-last-child(n+1 of c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":nth-last-child(n+1 of c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -61,8 +66,9 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-nth-last-child(n+1 of c d, e f, g h)", ":-pfx-nth-last-child(n+1 of c d.i, e j f)"); } @@ -75,8 +81,9 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss +@use "sass:selector"; a { - b: is-superselector( + b: selector.is-superselector( ":-pfx-nth-last-child(n+1 of c d.i, e j f)", ":-pfx-nth-last-child(n+1 of c d, e f, g h)"); } diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/slotted.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/slotted.hrx index e67f49511a..0b34618381 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/slotted.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/slotted.hrx @@ -1,5 +1,6 @@ <===> superset/input.scss -a {b: is-superselector("::slotted(c d, e f, g h)", "::slotted(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector("::slotted(c d, e f, g h)", "::slotted(c d.i, e j f)")} <===> superset/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> subset/input.scss -a {b: is-superselector("::slotted(c d.i, e j f)", "::slotted(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector("::slotted(c d.i, e j f)", "::slotted(c d, e f, g h)")} <===> subset/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> bare_sub/input.scss -a {b: is-superselector("::slotted(c d, e f, g h)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector("::slotted(c d, e f, g h)", "c d, e f, g h")} <===> bare_sub/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector("::-pfx-slotted(c d, e f, g h)", "::-pfx-slotted(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector("::-pfx-slotted(c d, e f, g h)", "::-pfx-slotted(c d.i, e j f)")} <===> prefix/superset/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector("::-pfx-slotted(c d.i, e j f)", "::-pfx-slotted(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector("::-pfx-slotted(c d.i, e j f)", "::-pfx-slotted(c d, e f, g h)")} <===> prefix/subset/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/where.hrx b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/where.hrx index ad371ca333..ca447d281a 100644 --- a/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/where.hrx +++ b/spec/core_functions/selector/is_superselector/simple/pseudo/selector_arg/where.hrx @@ -14,7 +14,8 @@ Most changes here should also be reflected in `is.hrx` and `matches.hrx`. <===> ================================================================================ <===> simple/equal/input.scss -a {b: is-superselector(":where(c)", "c")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c)", "c")} <===> simple/equal/output.css a { @@ -24,7 +25,8 @@ a { <===> ================================================================================ <===> simple/unequal/input.scss -a {b: is-superselector(":where(c)", "d")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c)", "d")} <===> simple/unequal/output.css a { @@ -34,7 +36,8 @@ a { <===> ================================================================================ <===> compound/superset/input.scss -a {b: is-superselector(":where(c.e)", "c.d.e")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c.e)", "c.d.e")} <===> compound/superset/output.css a { @@ -44,7 +47,8 @@ a { <===> ================================================================================ <===> compound/subset/input.scss -a {b: is-superselector(":where(c.d.e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c.d.e)", "c e")} <===> compound/subset/output.css a { @@ -54,7 +58,8 @@ a { <===> ================================================================================ <===> complex/superset/input.scss -a {b: is-superselector(":where(c e)", "c d e")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c e)", "c d e")} <===> complex/superset/output.css a { @@ -64,7 +69,8 @@ a { <===> ================================================================================ <===> complex/subset/input.scss -a {b: is-superselector(":where(c d e)", "c e")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c d e)", "c e")} <===> complex/subset/output.css a { @@ -74,7 +80,8 @@ a { <===> ================================================================================ <===> list/superset/input.scss -a {b: is-superselector(":where(c d, e f, g h)", "c d, e f")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c d, e f, g h)", "c d, e f")} <===> list/superset/output.css a { @@ -84,7 +91,8 @@ a { <===> ================================================================================ <===> list/subset/input.scss -a {b: is-superselector(":where(c d, e f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c d, e f)", "c d, e f, g h")} <===> list/subset/output.css a { @@ -101,7 +109,8 @@ check on those two selectors in isolation. <===> ================================================================================ <===> both/superset/input.scss -a {b: is-superselector(":where(c d, e f, g h)", ":where(c d.i, e j f)")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c d, e f, g h)", ":where(c d.i, e j f)")} <===> both/superset/output.css a { @@ -111,7 +120,8 @@ a { <===> ================================================================================ <===> both/subset/input.scss -a {b: is-superselector(":where(c d.i, e j f)", ":where(c d, e f, g h)")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c d.i, e j f)", ":where(c d, e f, g h)")} <===> both/subset/output.css a { @@ -121,7 +131,8 @@ a { <===> ================================================================================ <===> prefix/superset/input.scss -a {b: is-superselector(":-pfx-is(c d, e f, g h)", "c d.i, e j f")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-is(c d, e f, g h)", "c d.i, e j f")} <===> prefix/superset/output.css a { @@ -131,7 +142,8 @@ a { <===> ================================================================================ <===> prefix/subset/input.scss -a {b: is-superselector(":-pfx-is(c d.i, e j f)", "c d, e f, g h")} +@use "sass:selector"; +a {b: selector.is-superselector(":-pfx-is(c d.i, e j f)", "c d, e f, g h")} <===> prefix/subset/output.css a { @@ -147,7 +159,8 @@ semantics, because in practice they match different browsers. <===> ================================================================================ <===> not_superselector_of/any/input.scss -a {b: is-superselector(":where(c, d)", ":any(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c, d)", ":any(c, d)")} <===> not_superselector_of/any/output.css a { @@ -157,7 +170,8 @@ a { <===> ================================================================================ <===> not_superselector_of/prefixed/input.scss -a {b: is-superselector(":where(c, d)", ":-pfx-where(c, d)")} +@use "sass:selector"; +a {b: selector.is-superselector(":where(c, d)", ":-pfx-where(c, d)")} <===> not_superselector_of/prefixed/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/type.hrx b/spec/core_functions/selector/is_superselector/simple/type.hrx index 195934b03d..1b26b239d3 100644 --- a/spec/core_functions/selector/is_superselector/simple/type.hrx +++ b/spec/core_functions/selector/is_superselector/simple/type.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector("c", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "c")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> unequal/input.scss -a {b: is-superselector("c", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "d")} <===> unequal/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> and_universal/input.scss -a {b: is-superselector("c", "*")} +@use "sass:selector"; +a {b: selector.is-superselector("c", "*")} <===> and_universal/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_explicit/equal/input.scss -a {b: is-superselector("c|d", "c|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|d", "c|d")} <===> namespace/explicit/and_explicit/equal/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_explicit/unequal/input.scss -a {b: is-superselector("c|d", "e|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|d", "e|d")} <===> namespace/explicit/and_explicit/unequal/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_implicit/input.scss -a {b: is-superselector("c|d", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|d", "d")} <===> namespace/explicit/and_implicit/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_empty/input.scss -a {b: is-superselector("c|d", "|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|d", "|d")} <===> namespace/explicit/and_empty/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_universal/input.scss -a {b: is-superselector("c|d", "*|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|d", "*|d")} <===> namespace/explicit/and_universal/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_explicit/input.scss -a {b: is-superselector("|c", "d|c")} +@use "sass:selector"; +a {b: selector.is-superselector("|c", "d|c")} <===> namespace/empty/and_explicit/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_implicit/input.scss -a {b: is-superselector("|c", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("|c", "c")} <===> namespace/empty/and_implicit/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_empty/input.scss -a {b: is-superselector("|c", "|c")} +@use "sass:selector"; +a {b: selector.is-superselector("|c", "|c")} <===> namespace/empty/and_empty/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_universal/input.scss -a {b: is-superselector("|c", "*|c")} +@use "sass:selector"; +a {b: selector.is-superselector("|c", "*|c")} <===> namespace/empty/and_universal/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_explicit/input.scss -a {b: is-superselector("*|c", "d|c")} +@use "sass:selector"; +a {b: selector.is-superselector("*|c", "d|c")} <===> namespace/universal/and_explicit/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_implicit/input.scss -a {b: is-superselector("*|c", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("*|c", "c")} <===> namespace/universal/and_implicit/output.css a { @@ -139,7 +153,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_empty/input.scss -a {b: is-superselector("*|c", "|c")} +@use "sass:selector"; +a {b: selector.is-superselector("*|c", "|c")} <===> namespace/universal/and_empty/output.css a { @@ -149,7 +164,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_universal/input.scss -a {b: is-superselector("*|c", "*|c")} +@use "sass:selector"; +a {b: selector.is-superselector("*|c", "*|c")} <===> namespace/universal/and_universal/output.css a { diff --git a/spec/core_functions/selector/is_superselector/simple/universal.hrx b/spec/core_functions/selector/is_superselector/simple/universal.hrx index 89625b4dcf..e237a51e15 100644 --- a/spec/core_functions/selector/is_superselector/simple/universal.hrx +++ b/spec/core_functions/selector/is_superselector/simple/universal.hrx @@ -1,5 +1,6 @@ <===> equal/input.scss -a {b: is-superselector("*", "*")} +@use "sass:selector"; +a {b: selector.is-superselector("*", "*")} <===> equal/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> and_type/input.scss -a {b: is-superselector("*", "c")} +@use "sass:selector"; +a {b: selector.is-superselector("*", "c")} <===> and_type/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> and_class/input.scss -a {b: is-superselector("*", ".c")} +@use "sass:selector"; +a {b: selector.is-superselector("*", ".c")} <===> and_class/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_type/explicit/equal/input.scss -a {b: is-superselector("c|*", "c|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "c|d")} <===> namespace/explicit/and_type/explicit/equal/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_type/explicit/unequal/input.scss -a {b: is-superselector("c|*", "e|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "e|d")} <===> namespace/explicit/and_type/explicit/unequal/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_type/implicit/input.scss -a {b: is-superselector("c|*", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "d")} <===> namespace/explicit/and_type/implicit/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_type/empty/input.scss -a {b: is-superselector("c|*", "|d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "|d")} <===> namespace/explicit/and_type/empty/output.css a { @@ -73,7 +80,8 @@ a { :todo: <===> namespace/explicit/and_universal/explicit/equal/input.scss -a {b: is-superselector("c|*", "c|*")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "c|*")} <===> namespace/explicit/and_universal/explicit/equal/output.css a { @@ -83,7 +91,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_universal/explicit/unequal/input.scss -a {b: is-superselector("c|*", "d|*")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "d|*")} <===> namespace/explicit/and_universal/explicit/unequal/output.css a { @@ -93,7 +102,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_universal/implicit/input.scss -a {b: is-superselector("c|*", "*")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "*")} <===> namespace/explicit/and_universal/implicit/output.css a { @@ -103,7 +113,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_universal/empty/input.scss -a {b: is-superselector("c|*", "|*")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "|*")} <===> namespace/explicit/and_universal/empty/output.css a { @@ -113,7 +124,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_universal/universal/input.scss -a {b: is-superselector("c|*", "*|*")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", "*|*")} <===> namespace/explicit/and_universal/universal/output.css a { @@ -123,7 +135,8 @@ a { <===> ================================================================================ <===> namespace/explicit/and_class/input.scss -a {b: is-superselector("c|*", ".d")} +@use "sass:selector"; +a {b: selector.is-superselector("c|*", ".d")} <===> namespace/explicit/and_class/output.css a { @@ -133,7 +146,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_type/explicit/input.scss -a {b: is-superselector("|*", "c|d")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "c|d")} <===> namespace/empty/and_type/explicit/output.css a { @@ -143,7 +157,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_type/implicit/input.scss -a {b: is-superselector("|*", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "d")} <===> namespace/empty/and_type/implicit/output.css a { @@ -153,7 +168,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_type/empty/input.scss -a {b: is-superselector("|*", "|d")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "|d")} <===> namespace/empty/and_type/empty/output.css a { @@ -163,7 +179,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_universal/explicit/input.scss -a {b: is-superselector("|*", "c|*")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "c|*")} <===> namespace/empty/and_universal/explicit/output.css a { @@ -173,7 +190,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_universal/implicit/input.scss -a {b: is-superselector("|*", "*")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "*")} <===> namespace/empty/and_universal/implicit/output.css a { @@ -183,7 +201,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_universal/empty/input.scss -a {b: is-superselector("|*", "|*")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "|*")} <===> namespace/empty/and_universal/empty/output.css a { @@ -193,7 +212,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_universal/universal/input.scss -a {b: is-superselector("|*", "*|*")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", "*|*")} <===> namespace/empty/and_universal/universal/output.css a { @@ -203,7 +223,8 @@ a { <===> ================================================================================ <===> namespace/empty/and_class/input.scss -a {b: is-superselector("|*", ".d")} +@use "sass:selector"; +a {b: selector.is-superselector("|*", ".d")} <===> namespace/empty/and_class/output.css a { @@ -213,7 +234,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_type/explicit/input.scss -a {b: is-superselector("*|*", "c|d")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "c|d")} <===> namespace/universal/and_type/explicit/output.css a { @@ -223,7 +245,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_type/implicit/input.scss -a {b: is-superselector("*|*", "d")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "d")} <===> namespace/universal/and_type/implicit/output.css a { @@ -233,7 +256,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_type/empty/input.scss -a {b: is-superselector("*|*", "|d")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "|d")} <===> namespace/universal/and_type/empty/output.css a { @@ -243,7 +267,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_universal/explicit/input.scss -a {b: is-superselector("*|*", "c|*")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "c|*")} <===> namespace/universal/and_universal/explicit/output.css a { @@ -253,7 +278,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_universal/implicit/input.scss -a {b: is-superselector("*|*", "*")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "*")} <===> namespace/universal/and_universal/implicit/output.css a { @@ -263,7 +289,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_universal/empty/input.scss -a {b: is-superselector("*|*", "|*")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "|*")} <===> namespace/universal/and_universal/empty/output.css a { @@ -273,7 +300,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_universal/universal/input.scss -a {b: is-superselector("*|*", "*|*")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", "*|*")} <===> namespace/universal/and_universal/universal/output.css a { @@ -283,7 +311,8 @@ a { <===> ================================================================================ <===> namespace/universal/and_class/input.scss -a {b: is-superselector("*|*", ".d")} +@use "sass:selector"; +a {b: selector.is-superselector("*|*", ".d")} <===> namespace/universal/and_class/output.css a { diff --git a/spec/core_functions/selector/nest/combinator.hrx b/spec/core_functions/selector/nest/combinator.hrx index 5fc67247fd..fd12e04ce6 100644 --- a/spec/core_functions/selector/nest/combinator.hrx +++ b/spec/core_functions/selector/nest/combinator.hrx @@ -1,5 +1,6 @@ <===> leading/initial/input.scss -a {b: selector-nest("> c", "d")} +@use "sass:selector"; +a {b: selector.nest("> c", "d")} <===> leading/initial/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> leading/final/input.scss -a {b: selector-nest("c", "+ d")} +@use "sass:selector"; +a {b: selector.nest("c", "+ d")} <===> leading/final/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> trailing/initial/input.scss -a {b: selector-nest("c ~", "d")} +@use "sass:selector"; +a {b: selector.nest("c ~", "d")} <===> trailing/initial/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> trailing/final/input.scss -a {b: selector-nest("c", "d >")} +@use "sass:selector"; +a {b: selector.nest("c", "d >")} <===> trailing/final/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> multiple/middle/input.scss -a {b: selector-nest("c > > d", "e")} +@use "sass:selector"; +a {b: selector.nest("c > > d", "e")} <===> multiple/middle/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> multiple/leading/initial/input.scss -a {b: selector-nest("~ ~ c", "d")} +@use "sass:selector"; +a {b: selector.nest("~ ~ c", "d")} <===> multiple/leading/initial/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> multiple/leading/final/input.scss -a {b: selector-nest("c", "+ > d")} +@use "sass:selector"; +a {b: selector.nest("c", "+ > d")} <===> multiple/leading/final/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> multiple/trailing/initial/input.scss -a {b: selector-nest("c > ~", "d")} +@use "sass:selector"; +a {b: selector.nest("c > ~", "d")} <===> multiple/trailing/initial/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> multiple/trailing/final/input.scss -a {b: selector-nest("c", "d + >")} +@use "sass:selector"; +a {b: selector.nest("c", "d + >")} <===> multiple/trailing/final/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> only/before/input.scss -a {b: selector-nest("~", "c")} +@use "sass:selector"; +a {b: selector.nest("~", "c")} <===> only/before/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> only/after/input.scss -a {b: selector-nest("c", "+")} +@use "sass:selector"; +a {b: selector.nest("c", "+")} <===> only/after/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> only/between/input.scss -a {b: selector-nest("c", ">", "d")} +@use "sass:selector"; +a {b: selector.nest("c", ">", "d")} <===> only/between/output.css a { diff --git a/spec/core_functions/selector/nest/error.hrx b/spec/core_functions/selector/nest/error.hrx index 1415ec7a39..df1907285e 100644 --- a/spec/core_functions/selector/nest/error.hrx +++ b/spec/core_functions/selector/nest/error.hrx @@ -1,5 +1,20 @@ +<===> wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-nest(c, d)} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-nest(c, d)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ <===> parent/first_arg/input.scss -a {b: selector-nest("&")} +@use "sass:selector"; +a {b: selector.nest("&")} <===> parent/first_arg/error Error: Parent selectors aren't allowed here. @@ -9,15 +24,16 @@ Error: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-nest("&")} +2 | a {b: selector.nest("&")} | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> parent/non_initial/input.scss -a {b: selector-nest("c", "[d]&")} +@use "sass:selector"; +a {b: selector.nest("c", "[d]&")} <===> parent/non_initial/error Error: "&" may only used at the beginning of a compound selector. @@ -27,15 +43,16 @@ Error: "&" may only used at the beginning of a compound selector. ' - 1:4 root stylesheet , -1 | a {b: selector-nest("c", "[d]&")} +2 | a {b: selector.nest("c", "[d]&")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> parent/prefix/input.scss -a {b: selector-nest("c", "d&")} +@use "sass:selector"; +a {b: selector.nest("c", "d&")} <===> parent/prefix/error Error: "&" may only used at the beginning of a compound selector. @@ -45,15 +62,16 @@ Error: "&" may only used at the beginning of a compound selector. ' - 1:2 root stylesheet , -1 | a {b: selector-nest("c", "d&")} +2 | a {b: selector.nest("c", "d&")} | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> invalid/initial/input.scss -a {b: selector-nest("[c")} +@use "sass:selector"; +a {b: selector.nest("[c")} <===> invalid/initial/error Error: expected more input. @@ -63,15 +81,16 @@ Error: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-nest("[c")} +2 | a {b: selector.nest("[c")} | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> invalid/later/input.scss -a {b: selector-nest("c", "[d")} +@use "sass:selector"; +a {b: selector.nest("c", "[d")} <===> invalid/later/error Error: expected more input. @@ -81,49 +100,52 @@ Error: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-nest("c", "[d")} +2 | a {b: selector.nest("c", "[d")} | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> type/initial/input.scss -a {b: selector-nest(1)} +@use "sass:selector"; +a {b: selector.nest(1)} <===> type/initial/error Error: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-nest(1)} +2 | a {b: selector.nest(1)} | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> type/later/input.scss -a {b: selector-nest("c", 1)} +@use "sass:selector"; +a {b: selector.nest("c", 1)} <===> type/later/error Error: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-nest("c", 1)} +2 | a {b: selector.nest("c", 1)} | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_few_args/input.scss -a {b: selector-nest()} +@use "sass:selector"; +a {b: selector.nest()} <===> too_few_args/error Error: $selectors: At least one selector must be passed. , -1 | a {b: selector-nest()} +2 | a {b: selector.nest()} | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/nest/format.hrx b/spec/core_functions/selector/nest/format.hrx index 146859ad8c..f691061b5b 100644 --- a/spec/core_functions/selector/nest/format.hrx +++ b/spec/core_functions/selector/nest/format.hrx @@ -7,7 +7,8 @@ spec just verifies one example for each parameter. <===> ================================================================================ <===> format/input/initial/input.scss -a {b: selector-nest((c, d e), "f")} +@use "sass:selector"; +a {b: selector.nest((c, d e), "f")} <===> format/input/initial/output.css a { @@ -17,7 +18,8 @@ a { <===> ================================================================================ <===> format/input/later/input.scss -a {b: selector-nest("c", (d, e f))} +@use "sass:selector"; +a {b: selector.nest("c", (d, e f))} <===> format/input/later/output.css a { diff --git a/spec/core_functions/selector/nest/list.hrx b/spec/core_functions/selector/nest/list.hrx index 6b46dcd1b8..100384138c 100644 --- a/spec/core_functions/selector/nest/list.hrx +++ b/spec/core_functions/selector/nest/list.hrx @@ -1,5 +1,6 @@ <===> list/initial/input.scss -a {b: selector-nest("c, d", "e")} +@use "sass:selector"; +a {b: selector.nest("c, d", "e")} <===> list/initial/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> list/final/input.scss -a {b: selector-nest("c", "d, e")} +@use "sass:selector"; +a {b: selector.nest("c", "d, e")} <===> list/final/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> list/many/input.scss -a {b: selector-nest("c, d", "e, f", "g, h")} +@use "sass:selector"; +a {b: selector.nest("c, d", "e, f", "g, h")} <===> list/many/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> list/parent/alone/input.scss -a {b: selector-nest("c, d", "&")} +@use "sass:selector"; +a {b: selector.nest("c, d", "&")} <===> list/parent/alone/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> list/parent/compound/input.scss -a {b: selector-nest("c, d", "&.e")} +@use "sass:selector"; +a {b: selector.nest("c, d", "&.e")} <===> list/parent/compound/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> list/parent/suffix/input.scss -a {b: selector-nest("c, d", "&e")} +@use "sass:selector"; +a {b: selector.nest("c, d", "&e")} <===> list/parent/suffix/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> list/parent/complex/input.scss -a {b: selector-nest("c, d", "e &.f")} +@use "sass:selector"; +a {b: selector.nest("c, d", "e &.f")} <===> list/parent/complex/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> list/parent/selector_pseudo/is/input.scss -a {b: selector-nest("c, d", ":is(&)")} +@use "sass:selector"; +a {b: selector.nest("c, d", ":is(&)")} <===> list/parent/selector_pseudo/is/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> list/parent/selector_pseudo/where/input.scss -a {b: selector-nest("c, d", ":where(&)")} +@use "sass:selector"; +a {b: selector.nest("c, d", ":where(&)")} <===> list/parent/selector_pseudo/where/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> list/parent/selector_pseudo/matches/input.scss -a {b: selector-nest("c, d", ":matches(&)")} +@use "sass:selector"; +a {b: selector.nest("c, d", ":matches(&)")} <===> list/parent/selector_pseudo/matches/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> list/parent/multiple/input.scss -a {b: selector-nest("c, d", "&.e &.f")} +@use "sass:selector"; +a {b: selector.nest("c, d", "&.e &.f")} <===> list/parent/multiple/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> list/parent/in_one_complex/input.scss -a {b: selector-nest("c, d", "&.e, f")} +@use "sass:selector"; +a {b: selector.nest("c, d", "&.e, f")} <===> list/parent/in_one_complex/output.css a { diff --git a/spec/core_functions/selector/nest/many_args.hrx b/spec/core_functions/selector/nest/many_args.hrx index 9c64b1c128..20b2c6789d 100644 --- a/spec/core_functions/selector/nest/many_args.hrx +++ b/spec/core_functions/selector/nest/many_args.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: selector-nest("c", "d", "e", "f", "g")} +@use "sass:selector"; +a {b: selector.nest("c", "d", "e", "f", "g")} <===> output.css a { diff --git a/spec/core_functions/selector/nest/one_arg.hrx b/spec/core_functions/selector/nest/one_arg.hrx index f67d349190..66377fbb90 100644 --- a/spec/core_functions/selector/nest/one_arg.hrx +++ b/spec/core_functions/selector/nest/one_arg.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: selector-nest("c")} +@use "sass:selector"; +a {b: selector.nest("c")} <===> output.css a { diff --git a/spec/core_functions/selector/nest/parent.hrx b/spec/core_functions/selector/nest/parent.hrx index 83af8131c5..78e55f29f4 100644 --- a/spec/core_functions/selector/nest/parent.hrx +++ b/spec/core_functions/selector/nest/parent.hrx @@ -1,5 +1,6 @@ <===> alone/input.scss -a {b: selector-nest("c", "&")} +@use "sass:selector"; +a {b: selector.nest("c", "&")} <===> alone/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> compound/input.scss -a {b: selector-nest("c", "&.d")} +@use "sass:selector"; +a {b: selector.nest("c", "&.d")} <===> compound/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> suffix/input.scss -a {b: selector-nest("c", "&d")} +@use "sass:selector"; +a {b: selector.nest("c", "&d")} <===> suffix/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> complex/simple_parent/input.scss -a {b: selector-nest("c", "d &.e")} +@use "sass:selector"; +a {b: selector.nest("c", "d &.e")} <===> complex/simple_parent/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> complex/complex_parent/input.scss -a {b: selector-nest("c d", "e &.f")} +@use "sass:selector"; +a {b: selector.nest("c d", "e &.f")} <===> complex/complex_parent/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> selector_pseudo/simple_parent/is/input.scss -a {b: selector-nest("c", ":is(&)")} +@use "sass:selector"; +a {b: selector.nest("c", ":is(&)")} <===> selector_pseudo/simple_parent/is/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> selector_pseudo/simple_parent/where/input.scss -a {b: selector-nest("c", ":where(&)")} +@use "sass:selector"; +a {b: selector.nest("c", ":where(&)")} <===> selector_pseudo/simple_parent/where/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> selector_pseudo/simple_parent/matches/input.scss -a {b: selector-nest("c", ":matches(&)")} +@use "sass:selector"; +a {b: selector.nest("c", ":matches(&)")} <===> selector_pseudo/simple_parent/matches/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> selector_pseudo/complex_parent/is/input.scss -a {b: selector-nest("c d", ":is(&)")} +@use "sass:selector"; +a {b: selector.nest("c d", ":is(&)")} <===> selector_pseudo/complex_parent/is/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> selector_pseudo/complex_parent/where/input.scss -a {b: selector-nest("c d", ":where(&)")} +@use "sass:selector"; +a {b: selector.nest("c d", ":where(&)")} <===> selector_pseudo/complex_parent/where/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> selector_pseudo/complex_parent/matches/input.scss -a {b: selector-nest("c d", ":matches(&)")} +@use "sass:selector"; +a {b: selector.nest("c d", ":matches(&)")} <===> selector_pseudo/complex_parent/matches/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> multiple/input.scss -a {b: selector-nest("c", "&.d &.e")} +@use "sass:selector"; +a {b: selector.nest("c", "&.d &.e")} <===> multiple/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> in_one_complex/input.scss -a {b: selector-nest("c", "&.d, e")} +@use "sass:selector"; +a {b: selector.nest("c", "&.d, e")} <===> in_one_complex/output.css a { diff --git a/spec/core_functions/selector/parse/error.hrx b/spec/core_functions/selector/parse/error.hrx index 7532da5f03..df627bca07 100644 --- a/spec/core_functions/selector/parse/error.hrx +++ b/spec/core_functions/selector/parse/error.hrx @@ -1,5 +1,6 @@ <===> parent/input.scss -a {b: selector-parse("&")} +@use "sass:selector"; +a {b: selector.parse("&")} <===> parent/error Error: $selector: Parent selectors aren't allowed here. @@ -9,15 +10,16 @@ Error: $selector: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-parse("&")} +2 | a {b: selector.parse("&")} | ^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> parse/invalid/input.scss -a {b: selector-parse("[c")} +@use "sass:selector"; +a {b: selector.parse("[c")} <===> parse/invalid/error Error: $selector: expected more input. @@ -27,15 +29,16 @@ Error: $selector: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-parse("[c")} +2 | a {b: selector.parse("[c")} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> parse/extra/input.scss -a {b: selector-parse("c {")} +@use "sass:selector"; +a {b: selector.parse("c {")} <===> parse/extra/error Error: $selector: expected selector. @@ -45,127 +48,151 @@ Error: $selector: expected selector. ' - 1:3 root stylesheet , -1 | a {b: selector-parse("c {")} +2 | a {b: selector.parse("c {")} | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_nested/input.scss -a {b: selector-parse((append((), append((), c)),))} +@use "sass:list"; +@use "sass:selector"; +a {b: selector.parse((list.append((), list.append((), c)),))} <===> too_nested/error Error: $selector: (c,) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-parse((append((), append((), c)),))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: selector.parse((list.append((), list.append((), c)),))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 3:7 root stylesheet <===> ================================================================================ <===> inner_comma/input.scss -a {b: selector-parse(((c,),))} +@use "sass:selector"; +a {b: selector.parse(((c,),))} <===> inner_comma/error Error: $selector: ((c,),) is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-parse(((c,),))} +2 | a {b: selector.parse(((c,),))} | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> outer_space/input.scss -a {b: selector-parse(append((), append((), c)))} +@use "sass:list"; +@use "sass:selector"; +a {b: selector.parse(list.append((), list.append((), c)))} <===> outer_space/error Error: $selector: c is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-parse(append((), append((), c)))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: selector.parse(list.append((), list.append((), c)))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 3:7 root stylesheet <===> ================================================================================ <===> slash_list/top_level/input.scss +@use "sass:selector"; @use "sass:list"; -a {b: selector-parse(list.slash(c d, e f))} +a {b: selector.parse(list.slash(c d, e f))} <===> slash_list/top_level/error Error: $selector: c d / e f is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -2 | a {b: selector-parse(list.slash(c d, e f))} +3 | a {b: selector.parse(list.slash(c d, e f))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet <===> ================================================================================ <===> slash_list/in_comma_list/input.scss +@use "sass:selector"; @use "sass:list"; -a {b: selector-parse((list.slash(c, d), list.slash(e, f)))} +a {b: selector.parse((list.slash(c, d), list.slash(e, f)))} <===> slash_list/in_comma_list/error Error: $selector: c / d, e / f is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -2 | a {b: selector-parse((list.slash(c, d), list.slash(e, f)))} +3 | a {b: selector.parse((list.slash(c, d), list.slash(e, f)))} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:7 root stylesheet + input.scss 3:7 root stylesheet <===> ================================================================================ <===> type/input.scss -a {b: selector-parse(1)} +@use "sass:selector"; +a {b: selector.parse(1)} <===> type/error Error: $selector: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-parse(1)} +2 | a {b: selector.parse(1)} | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-parse(".c.d")} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-parse(".c.d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many_args/input.scss -a {b: selector-parse(c, d)} +@use "sass:selector"; +a {b: selector.parse(c, d)} <===> too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: selector-parse(c, d)} +2 | a {b: selector.parse(c, d)} | ^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function parse($selector) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_few_args/input.scss -a {b: selector-parse()} +@use "sass:selector"; +a {b: selector.parse()} <===> too_few_args/error Error: Missing argument $selector. ,--> input.scss -1 | a {b: selector-parse()} +2 | a {b: selector.parse()} | ^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function parse($selector) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/parse/named.hrx b/spec/core_functions/selector/parse/named.hrx index 28c272b1f0..b33c3dddcd 100644 --- a/spec/core_functions/selector/parse/named.hrx +++ b/spec/core_functions/selector/parse/named.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: selector-parse($selector: "c")} +@use "sass:selector"; +a {b: selector.parse($selector: "c")} <===> output.css a { diff --git a/spec/core_functions/selector/parse/selector.hrx b/spec/core_functions/selector/parse/selector.hrx index fe14900321..0743bcad79 100644 --- a/spec/core_functions/selector/parse/selector.hrx +++ b/spec/core_functions/selector/parse/selector.hrx @@ -1,5 +1,6 @@ <===> simple/type/input.scss -a {b: selector-parse("c")} +@use "sass:selector"; +a {b: selector.parse("c")} <===> simple/type/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> simple/class/input.scss -a {b: selector-parse(".c")} +@use "sass:selector"; +a {b: selector.parse(".c")} <===> simple/class/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> simple/id/input.scss -a {b: selector-parse("#c")} +@use "sass:selector"; +a {b: selector.parse("#c")} <===> simple/id/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> simple/placeholder/input.scss -a {b: selector-parse("%c")} +@use "sass:selector"; +a {b: selector.parse("%c")} <===> simple/placeholder/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> simple/attribute/input.scss -a {b: selector-parse("[c^=d]")} +@use "sass:selector"; +a {b: selector.parse("[c^=d]")} <===> simple/attribute/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> simple/universal/input.scss -a {b: selector-parse("*")} +@use "sass:selector"; +a {b: selector.parse("*")} <===> simple/universal/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> simple/pseudo/class/no_arg/input.scss -a {b: selector-parse(":c")} +@use "sass:selector"; +a {b: selector.parse(":c")} <===> simple/pseudo/class/no_arg/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> simple/pseudo/class/arg/input.scss -a {b: selector-parse(":c(@#$)")} +@use "sass:selector"; +a {b: selector.parse(":c(@#$)")} <===> simple/pseudo/class/arg/output.css a { @@ -79,10 +87,12 @@ a { <===> ================================================================================ <===> simple/pseudo/class/selector_arg/is/input.scss -$result: selector-parse(":is(b, c)"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse(":is(b, c)"); a { result: $result; - structure: $result == (append((), ":is(b, c)"),); + structure: $result == (list.append((), ":is(b, c)"),); } <===> simple/pseudo/class/selector_arg/is/output.css @@ -94,10 +104,12 @@ a { <===> ================================================================================ <===> simple/pseudo/class/selector_arg/where/input.scss -$result: selector-parse(":where(b, c)"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse(":where(b, c)"); a { result: $result; - structure: $result == (append((), ":where(b, c)"),); + structure: $result == (list.append((), ":where(b, c)"),); } <===> simple/pseudo/class/selector_arg/where/output.css @@ -109,10 +121,12 @@ a { <===> ================================================================================ <===> simple/pseudo/class/selector_arg/matches/input.scss -$result: selector-parse(":matches(b, c)"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse(":matches(b, c)"); a { result: $result; - structure: $result == (append((), ":matches(b, c)"),); + structure: $result == (list.append((), ":matches(b, c)"),); } <===> simple/pseudo/class/selector_arg/matches/output.css @@ -124,10 +138,12 @@ a { <===> ================================================================================ <===> simple/pseudo/class/combined_arg/input.scss -$result: selector-parse(":nth-child(2n+1 of b, c)"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse(":nth-child(2n+1 of b, c)"); a { result: $result; - structure: $result == (append((), ":nth-child(2n+1 of b, c)"),); + structure: $result == (list.append((), ":nth-child(2n+1 of b, c)"),); } <===> simple/pseudo/class/combined_arg/output.css @@ -139,7 +155,8 @@ a { <===> ================================================================================ <===> simple/pseudo/element/no_arg/input.scss -a {b: selector-parse("::c")} +@use "sass:selector"; +a {b: selector.parse("::c")} <===> simple/pseudo/element/no_arg/output.css a { @@ -149,7 +166,8 @@ a { <===> ================================================================================ <===> simple/pseudo/element/arg/input.scss -a {b: selector-parse("::c(@#$)")} +@use "sass:selector"; +a {b: selector.parse("::c(@#$)")} <===> simple/pseudo/element/arg/output.css a { @@ -159,10 +177,12 @@ a { <===> ================================================================================ <===> simple/pseudo/element/selector_arg/input.scss -$result: selector-parse("::slotted(b, c)"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse("::slotted(b, c)"); a { result: $result; - structure: $result == (append((), "::slotted(b, c)"),); + structure: $result == (list.append((), "::slotted(b, c)"),); } <===> simple/pseudo/element/selector_arg/output.css @@ -174,10 +194,12 @@ a { <===> ================================================================================ <===> compound/input.scss -$result: selector-parse("b.c:d"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse("b.c:d"); a { result: $result; - structure: $result == (append((), "b.c:d"),); + structure: $result == (list.append((), "b.c:d"),); } <===> compound/output.css @@ -189,7 +211,8 @@ a { <===> ================================================================================ <===> complex/descendant/input.scss -$result: selector-parse("b c d"); +@use "sass:selector"; +$result: selector.parse("b c d"); a { result: $result; structure: $result == (b c d,); @@ -204,7 +227,8 @@ a { <===> ================================================================================ <===> complex/sibling/input.scss -$result: selector-parse("b ~ c ~ d"); +@use "sass:selector"; +$result: selector.parse("b ~ c ~ d"); a { result: $result; structure: $result == (b "~" c "~" d,); @@ -219,7 +243,8 @@ a { <===> ================================================================================ <===> complex/adjacent_sibling/input.scss -$result: selector-parse("b + c + d"); +@use "sass:selector"; +$result: selector.parse("b + c + d"); a { result: $result; structure: $result == (b "+" c "+" d,); @@ -234,7 +259,8 @@ a { <===> ================================================================================ <===> complex/child/input.scss -$result: selector-parse("b > c > d"); +@use "sass:selector"; +$result: selector.parse("b > c > d"); a { result: $result; structure: $result == (b ">" c ">" d,); @@ -249,7 +275,8 @@ a { <===> ================================================================================ <===> complex/bogus/leading/input.scss -$result: selector-parse("> b"); +@use "sass:selector"; +$result: selector.parse("> b"); a { result: $result; structure: $result == (">" b,); @@ -264,7 +291,8 @@ a { <===> ================================================================================ <===> complex/bogus/trailing/input.scss -$result: selector-parse("b +"); +@use "sass:selector"; +$result: selector.parse("b +"); a { result: $result; structure: $result == (b "+",); @@ -279,7 +307,8 @@ a { <===> ================================================================================ <===> complex/bogus/multiple/middle/input.scss -$result: selector-parse("b + ~ c"); +@use "sass:selector"; +$result: selector.parse("b + ~ c"); a { result: $result; structure: $result == (b "+" "~" c,); @@ -294,7 +323,8 @@ a { <===> ================================================================================ <===> complex/bogus/multiple/trailing/input.scss -$result: selector-parse("b ~~"); +@use "sass:selector"; +$result: selector.parse("b ~~"); a { result: $result; structure: $result == (b "~" "~",); @@ -309,10 +339,12 @@ a { <===> ================================================================================ <===> complex/bogus/only/input.scss -$result: selector-parse(">"); +@use "sass:list"; +@use "sass:selector"; +$result: selector.parse(">"); a { result: $result; - structure: $result == (append((), ">"),); + structure: $result == (list.append((), ">"),); } <===> complex/bogus/only/output.css @@ -324,7 +356,8 @@ a { <===> ================================================================================ <===> list/input.scss -$result: selector-parse("b c, d e, f g"); +@use "sass:selector"; +$result: selector.parse("b c, d e, f g"); a { result: $result; structure: $result == (b c, d e, f g); diff --git a/spec/core_functions/selector/parse/structure.hrx b/spec/core_functions/selector/parse/structure.hrx index 7eacc0214d..6eee6146a8 100644 --- a/spec/core_functions/selector/parse/structure.hrx +++ b/spec/core_functions/selector/parse/structure.hrx @@ -1,5 +1,6 @@ <===> full_string/quoted/input.scss -a {b: selector-parse("c d, e f")} +@use "sass:selector"; +a {b: selector.parse("c d, e f")} <===> full_string/quoted/output.css a { @@ -9,7 +10,9 @@ a { <===> ================================================================================ <===> full_string/unquoted/input.scss -a {b: selector-parse(unquote("c d, e f"))} +@use "sass:selector"; +@use "sass:string"; +a {b: selector.parse(string.unquote("c d, e f"))} <===> full_string/unquoted/output.css a { @@ -19,7 +22,8 @@ a { <===> ================================================================================ <===> decomposed/full/quoted/input.scss -a {b: selector-parse(("c" "d", "e" "f"))} +@use "sass:selector"; +a {b: selector.parse(("c" "d", "e" "f"))} <===> decomposed/full/quoted/output.css a { @@ -29,7 +33,8 @@ a { <===> ================================================================================ <===> decomposed/full/unquoted/input.scss -a {b: selector-parse((c d, e f))} +@use "sass:selector"; +a {b: selector.parse((c d, e f))} <===> decomposed/full/unquoted/output.css a { @@ -39,7 +44,8 @@ a { <===> ================================================================================ <===> decomposed/full/mixed/input.scss -a {b: selector-parse((c "d", e "f"))} +@use "sass:selector"; +a {b: selector.parse((c "d", e "f"))} <===> decomposed/full/mixed/output.css a { @@ -49,7 +55,8 @@ a { <===> ================================================================================ <===> decomposed/partial/quoted/input.scss -a {b: selector-parse(("c d", "e f"))} +@use "sass:selector"; +a {b: selector.parse(("c d", "e f"))} <===> decomposed/partial/quoted/output.css a { @@ -59,7 +66,9 @@ a { <===> ================================================================================ <===> decomposed/partial/unquoted/input.scss -a {b: selector-parse((unquote("c d"), unquote("e f")))} +@use "sass:selector"; +@use "sass:string"; +a {b: selector.parse((string.unquote("c d"), string.unquote("e f")))} <===> decomposed/partial/unquoted/output.css a { @@ -69,7 +78,9 @@ a { <===> ================================================================================ <===> decomposed/partial/mixed/input.scss -a {b: selector-parse((c d, unquote("e f")))} +@use "sass:selector"; +@use "sass:string"; +a {b: selector.parse((c d, string.unquote("e f")))} <===> decomposed/partial/mixed/output.css a { @@ -79,7 +90,8 @@ a { <===> ================================================================================ <===> decomposed/middle/quoted/input.scss -a {b: selector-parse("c" "d, e" "f")} +@use "sass:selector"; +a {b: selector.parse("c" "d, e" "f")} <===> decomposed/middle/quoted/output.css a { @@ -89,7 +101,9 @@ a { <===> ================================================================================ <===> decomposed/middle/unquoted/input.scss -a {b: selector-parse(c unquote("d, e") f)} +@use "sass:selector"; +@use "sass:string"; +a {b: selector.parse(c string.unquote("d, e") f)} <===> decomposed/middle/unquoted/output.css a { @@ -99,7 +113,8 @@ a { <===> ================================================================================ <===> decomposed/middle/mixed/input.scss -a {b: selector-parse(c "d, e" f)} +@use "sass:selector"; +a {b: selector.parse(c "d, e" f)} <===> decomposed/middle/mixed/output.css a { @@ -109,7 +124,8 @@ a { <===> ================================================================================ <===> decomposed/complex/quoted/input.scss -a {b: selector-parse("c" "d" "e")} +@use "sass:selector"; +a {b: selector.parse("c" "d" "e")} <===> decomposed/complex/quoted/output.css a { @@ -119,7 +135,8 @@ a { <===> ================================================================================ <===> decomposed/complex/unquoted/input.scss -a {b: selector-parse(c d e)} +@use "sass:selector"; +a {b: selector.parse(c d e)} <===> decomposed/complex/unquoted/output.css a { @@ -129,7 +146,8 @@ a { <===> ================================================================================ <===> decomposed/complex/mixed/input.scss -a {b: selector-parse(c "d" e)} +@use "sass:selector"; +a {b: selector.parse(c "d" e)} <===> decomposed/complex/mixed/output.css a { diff --git a/spec/core_functions/selector/replace.hrx b/spec/core_functions/selector/replace.hrx index 3f551c61b0..6578d0248e 100644 --- a/spec/core_functions/selector/replace.hrx +++ b/spec/core_functions/selector/replace.hrx @@ -7,7 +7,8 @@ functions. <===> ================================================================================ <===> simple/input.scss -a {b: selector-replace("c", "c", "d")} +@use "sass:selector"; +a {b: selector.replace("c", "c", "d")} <===> simple/output.css a { @@ -17,7 +18,8 @@ a { <===> ================================================================================ <===> compound/input.scss -a {b: selector-replace("c.d", "c", "e")} +@use "sass:selector"; +a {b: selector.replace("c.d", "c", "e")} <===> compound/output.css a { @@ -27,7 +29,8 @@ a { <===> ================================================================================ <===> complex/input.scss -a {b: selector-replace("c d", "d", "e f")} +@use "sass:selector"; +a {b: selector.replace("c d", "d", "e f")} <===> complex/output.css a { @@ -37,7 +40,8 @@ a { <===> ================================================================================ <===> selector_pseudo/is/input.scss -a {b: selector-replace(":is(c)", "c", "d")} +@use "sass:selector"; +a {b: selector.replace(":is(c)", "c", "d")} <===> selector_pseudo/is/output.css a { @@ -47,7 +51,8 @@ a { <===> ================================================================================ <===> selector_pseudo/where/input.scss -a {b: selector-replace(":where(c)", "c", "d")} +@use "sass:selector"; +a {b: selector.replace(":where(c)", "c", "d")} <===> selector_pseudo/where/output.css a { @@ -57,7 +62,8 @@ a { <===> ================================================================================ <===> selector_pseudo/matches/input.scss -a {b: selector-replace(":matches(c)", "c", "d")} +@use "sass:selector"; +a {b: selector.replace(":matches(c)", "c", "d")} <===> selector_pseudo/matches/output.css a { @@ -67,7 +73,8 @@ a { <===> ================================================================================ <===> selector_pseudo/not/input.scss -a {b: selector-replace(":not(c)", "c", "d")} +@use "sass:selector"; +a {b: selector.replace(":not(c)", "c", "d")} <===> selector_pseudo/not/output.css a { @@ -77,7 +84,8 @@ a { <===> ================================================================================ <===> no_op/input.scss -a {b: selector-replace("c", "d", "e")} +@use "sass:selector"; +a {b: selector.replace("c", "d", "e")} <===> no_op/output.css a { @@ -87,7 +95,8 @@ a { <===> ================================================================================ <===> partial_no_op/input.scss -a {b: selector-replace("c, d", "d", "e")} +@use "sass:selector"; +a {b: selector.replace("c, d", "d", "e")} <===> partial_no_op/output.css a { @@ -105,7 +114,8 @@ spec just verifies one example for each parameter. <===> ================================================================================ <===> format/input/non_string/selector/input.scss -a {b: selector-replace((c, d c), "c", "e")} +@use "sass:selector"; +a {b: selector.replace((c, d c), "c", "e")} <===> format/input/non_string/selector/output.css a { @@ -115,7 +125,8 @@ a { <===> ================================================================================ <===> format/input/non_string/extendee/input.scss -a {b: selector-replace("c.d", (c, ".d"), ".e")} +@use "sass:selector"; +a {b: selector.replace("c.d", (c, ".d"), ".e")} <===> format/input/non_string/extendee/output.css a { @@ -125,7 +136,8 @@ a { <===> ================================================================================ <===> format/input/non_string/extender/input.scss -a {b: selector-replace("c", "c", (d, e f))} +@use "sass:selector"; +a {b: selector.replace("c", "c", (d, e f))} <===> format/input/non_string/extender/output.css a { @@ -135,7 +147,8 @@ a { <===> ================================================================================ <===> format/input/multiple_extendees/compound/input.scss -a {b: selector-replace("c.d", "c.d", ".e")} +@use "sass:selector"; +a {b: selector.replace("c.d", "c.d", ".e")} <===> format/input/multiple_extendees/compound/output.css a { @@ -145,7 +158,8 @@ a { <===> ================================================================================ <===> format/input/multiple_extendees/list/input.scss -a {b: selector-replace("c.d", "c, .d", ".e")} +@use "sass:selector"; +a {b: selector.replace("c.d", "c, .d", ".e")} <===> format/input/multiple_extendees/list/output.css a { @@ -155,7 +169,8 @@ a { <===> ================================================================================ <===> format/input/multiple_extendees/list_of_compound/input.scss -a {b: selector-replace("c.d.e.f", "c.d, .e.f", ".g")} +@use "sass:selector"; +a {b: selector.replace("c.d.e.f", "c.d, .e.f", ".g")} <===> format/input/multiple_extendees/list_of_compound/output.css a { @@ -165,7 +180,8 @@ a { <===> ================================================================================ <===> format/output/input.scss -$result: selector-replace("c d, e f", "g", "g"); +@use "sass:selector"; +$result: selector.replace("c d, e f", "g", "g"); a { result: $result; structure: $result == ("c" "d", "e" "f"); @@ -180,17 +196,33 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: selector-replace($selector: "c.d", $original: "c", $replacement: "e")} +@use "sass:selector"; +a {b: selector.replace($selector: "c.d", $original: "c", $replacement: "e")} <===> named/output.css a { b: e.d; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-replace(c, c, d)} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-replace(c, c, d)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/selector/parent/input.scss -a {b: selector-replace("&", "c", "d")} +@use "sass:selector"; +a {b: selector.replace("&", "c", "d")} <===> error/selector/parent/error Error: $selector: Parent selectors aren't allowed here. @@ -200,15 +232,16 @@ Error: $selector: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-replace("&", "c", "d")} +2 | a {b: selector.replace("&", "c", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/selector/invalid/input.scss -a {b: selector-replace("[c", "d", "e")} +@use "sass:selector"; +a {b: selector.replace("[c", "d", "e")} <===> error/selector/invalid/error Error: $selector: expected more input. @@ -218,29 +251,31 @@ Error: $selector: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-replace("[c", "d", "e")} +2 | a {b: selector.replace("[c", "d", "e")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/selector/type/input.scss -a {b: selector-replace(1, "c", "d")} +@use "sass:selector"; +a {b: selector.replace(1, "c", "d")} <===> error/selector/type/error Error: $selector: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-replace(1, "c", "d")} +2 | a {b: selector.replace(1, "c", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extendee/parent/input.scss -a {b: selector-replace("c", "&", "d")} +@use "sass:selector"; +a {b: selector.replace("c", "&", "d")} <===> error/extendee/parent/error Error: $original: Parent selectors aren't allowed here. @@ -250,41 +285,44 @@ Error: $original: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-replace("c", "&", "d")} +2 | a {b: selector.replace("c", "&", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extendee/complex/string/input.scss -a {b: selector-replace("c", "d e", "f")} +@use "sass:selector"; +a {b: selector.replace("c", "d e", "f")} <===> error/extendee/complex/string/error Error: Can't extend complex selector d e. , -1 | a {b: selector-replace("c", "d e", "f")} +2 | a {b: selector.replace("c", "d e", "f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extendee/complex/list/input.scss -a {b: selector-replace("c", d e, "f")} +@use "sass:selector"; +a {b: selector.replace("c", d e, "f")} <===> error/extendee/complex/list/error Error: Can't extend complex selector d e. , -1 | a {b: selector-replace("c", d e, "f")} +2 | a {b: selector.replace("c", d e, "f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extendee/invalid/input.scss -a {b: selector-replace("c", "[d", "e")} +@use "sass:selector"; +a {b: selector.replace("c", "[d", "e")} <===> error/extendee/invalid/error Error: $original: expected more input. @@ -294,29 +332,31 @@ Error: $original: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-replace("c", "[d", "e")} +2 | a {b: selector.replace("c", "[d", "e")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extendee/type/input.scss -a {b: selector-replace("c", 1, "d")} +@use "sass:selector"; +a {b: selector.replace("c", 1, "d")} <===> error/extendee/type/error Error: $original: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-replace("c", 1, "d")} +2 | a {b: selector.replace("c", 1, "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extender/parent/input.scss -a {b: selector-replace("c", "d", "&")} +@use "sass:selector"; +a {b: selector.replace("c", "d", "&")} <===> error/extender/parent/error Error: $replacement: Parent selectors aren't allowed here. @@ -326,15 +366,16 @@ Error: $replacement: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-replace("c", "d", "&")} +2 | a {b: selector.replace("c", "d", "&")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extender/invalid/input.scss -a {b: selector-replace("c", "d", "[e")} +@use "sass:selector"; +a {b: selector.replace("c", "d", "[e")} <===> error/extender/invalid/error Error: $replacement: expected more input. @@ -344,55 +385,58 @@ Error: $replacement: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-replace("c", "d", "[e")} +2 | a {b: selector.replace("c", "d", "[e")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/extender/type/input.scss -a {b: selector-replace("c", "d", 1)} +@use "sass:selector"; +a {b: selector.replace("c", "d", 1)} <===> error/extender/type/error Error: $replacement: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-replace("c", "d", 1)} +2 | a {b: selector.replace("c", "d", 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: selector-replace("c", "d", "e", "f")} +@use "sass:selector"; +a {b: selector.replace("c", "d", "e", "f")} <===> error/too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: selector-replace("c", "d", "e", "f")} +2 | a {b: selector.replace("c", "d", "e", "f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function replace($selector, $original, $replacement) { | =========================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: selector-replace("c", "d")} +@use "sass:selector"; +a {b: selector.replace("c", "d")} <===> error/too_few_args/error Error: Missing argument $replacement. ,--> input.scss -1 | a {b: selector-replace("c", "d")} +2 | a {b: selector.replace("c", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:selector 1 | @function replace($selector, $original, $replacement) { | =========================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/unify/chooses_superselector.hrx b/spec/core_functions/selector/unify/chooses_superselector.hrx index ad1550d5e7..fef562e16b 100644 --- a/spec/core_functions/selector/unify/chooses_superselector.hrx +++ b/spec/core_functions/selector/unify/chooses_superselector.hrx @@ -5,7 +5,8 @@ subselector is returned (since it's more specific). <===> ================================================================================ <===> whole_selector/selector1/input.scss -a {b: selector-unify("c", "d c.e")} +@use "sass:selector"; +a {b: selector.unify("c", "d c.e")} <===> whole_selector/selector1/output.css a { @@ -15,7 +16,8 @@ a { <===> ================================================================================ <===> whole_selector/selector2/input.scss -a {b: selector-unify("d c.e", "c")} +@use "sass:selector"; +a {b: selector.unify("d c.e", "c")} <===> whole_selector/selector2/output.css a { @@ -25,7 +27,8 @@ a { <===> ================================================================================ <===> parent/selector1/input.scss -a {b: selector-unify("c d", "c.e .f")} +@use "sass:selector"; +a {b: selector.unify("c d", "c.e .f")} <===> parent/selector1/output.css a { @@ -35,7 +38,8 @@ a { <===> ================================================================================ <===> parent/selector2/input.scss -a {b: selector-unify("c.e .f", "c d")} +@use "sass:selector"; +a {b: selector.unify("c.e .f", "c d")} <===> parent/selector2/output.css a { diff --git a/spec/core_functions/selector/unify/complex/combinators/child.hrx b/spec/core_functions/selector/unify/complex/combinators/child.hrx index eae9beae00..02ed415a61 100644 --- a/spec/core_functions/selector/unify/complex/combinators/child.hrx +++ b/spec/core_functions/selector/unify/complex/combinators/child.hrx @@ -1,5 +1,6 @@ <===> and_descendant/distinct/input.scss -a {b: selector-unify(".c > .d", ".e .f")} +@use "sass:selector"; +a {b: selector.unify(".c > .d", ".e .f")} <===> and_descendant/distinct/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> and_descendant/identical/input.scss -a {b: selector-unify(".c > .s1", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c > .s1", ".c .s2")} <===> and_descendant/identical/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> and_descendant/superselector/input.scss -a {b: selector-unify(".c.s1-1 > .s1-2", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 > .s1-2", ".c .s2")} <===> and_descendant/superselector/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> and_descendant/overlap/input.scss -a {b: selector-unify(".c.s1-1 > .s1-2", ".c.s2-1 .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 > .s1-2", ".c.s2-1 .s2-2")} <===> and_descendant/overlap/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> and_child/distinct/input.scss -a {b: selector-unify(".c > .d", ".e > .f")} +@use "sass:selector"; +a {b: selector.unify(".c > .d", ".e > .f")} <===> and_child/distinct/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> and_child/superselector/input.scss -a {b: selector-unify(".c.s1-1 > .s1-2", ".c > .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 > .s1-2", ".c > .s2")} <===> and_child/superselector/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> and_child/overlap/input.scss -a {b: selector-unify(".c.s1-1 > .s1-2", ".c.s2-1 > .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 > .s1-2", ".c.s2-1 > .s2-2")} <===> and_child/overlap/output.css a { @@ -69,7 +76,9 @@ a { <===> ================================================================================ <===> and_child/conflict/input.scss -a {b: inspect(selector-unify("#s1-1 > .s1-2", "#s2-1 > .s2-2"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("#s1-1 > .s1-2", "#s2-1 > .s2-2"))} <===> and_child/conflict/output.css a { @@ -79,7 +88,8 @@ a { <===> ================================================================================ <===> and_sibling/input.scss -a {b: selector-unify(".c > .s1", ".c ~ .s2")} +@use "sass:selector"; +a {b: selector.unify(".c > .s1", ".c ~ .s2")} <===> and_sibling/output.css a { @@ -89,7 +99,8 @@ a { <===> ================================================================================ <===> and_next_sibling/input.scss -a {b: selector-unify(".c > .s1", ".c + .s2")} +@use "sass:selector"; +a {b: selector.unify(".c > .s1", ".c + .s2")} <===> and_next_sibling/output.css a { diff --git a/spec/core_functions/selector/unify/complex/combinators/initial.hrx b/spec/core_functions/selector/unify/complex/combinators/initial.hrx index 360b30764f..1f2b6cd2d1 100644 --- a/spec/core_functions/selector/unify/complex/combinators/initial.hrx +++ b/spec/core_functions/selector/unify/complex/combinators/initial.hrx @@ -6,7 +6,8 @@ Any of these specs should pass with any combination of combinators. <===> ================================================================================ <===> only_one/selector1/input.scss -a {b: selector-unify("> .c", ".d")} +@use "sass:selector"; +a {b: selector.unify("> .c", ".d")} <===> only_one/selector1/output.css a { @@ -20,15 +21,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("> .c", ".d")} +2 | a {b: selector.unify("> .c", ".d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> only_one/selector2/input.scss -a {b: selector-unify(".c", "~ .d")} +@use "sass:selector"; +a {b: selector.unify(".c", "~ .d")} <===> only_one/selector2/output.css a { @@ -42,15 +44,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c", "~ .d")} +2 | a {b: selector.unify(".c", "~ .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> same/input.scss -a {b: selector-unify("+ .c", "+ .d")} +@use "sass:selector"; +a {b: selector.unify("+ .c", "+ .d")} <===> same/output.css a { @@ -64,10 +67,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ .c", "+ .d")} +2 | a {b: selector.unify("+ .c", "+ .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: + .d is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -75,15 +78,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ .c", "+ .d")} +2 | a {b: selector.unify("+ .c", "+ .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> supersequence/contiguous/input.scss -a {b: selector-unify("+ ~ > .c", "> + ~ > > .d")} +@use "sass:selector"; +a {b: selector.unify("+ ~ > .c", "> + ~ > > .d")} <===> supersequence/contiguous/output.css @@ -94,10 +98,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ ~ > .c", "> + ~ > > .d")} +2 | a {b: selector.unify("+ ~ > .c", "> + ~ > > .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: > + ~ > > .d is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -105,15 +109,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ ~ > .c", "> + ~ > > .d")} +2 | a {b: selector.unify("+ ~ > .c", "> + ~ > > .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> supersequence/non_contiguous/input.scss -a {b: selector-unify("+ ~ > .c", "+ > ~ ~ > .d")} +@use "sass:selector"; +a {b: selector.unify("+ ~ > .c", "+ > ~ ~ > .d")} <===> supersequence/non_contiguous/output.css @@ -124,10 +129,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ ~ > .c", "+ > ~ ~ > .d")} +2 | a {b: selector.unify("+ ~ > .c", "+ > ~ ~ > .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: + > ~ ~ > .d is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -135,15 +140,17 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify("+ ~ > .c", "+ > ~ ~ > .d")} +2 | a {b: selector.unify("+ ~ > .c", "+ > ~ ~ > .d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> different/input.scss -a {b: inspect(selector-unify("+ ~ > .c", "+ > ~ ~ .d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("+ ~ > .c", "+ > ~ ~ .d"))} <===> different/output.css a { @@ -157,10 +164,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: inspect(selector-unify("+ ~ > .c", "+ > ~ ~ .d"))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: meta.inspect(selector.unify("+ ~ > .c", "+ > ~ ~ .d"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:15 root stylesheet + input.scss 3:20 root stylesheet DEPRECATION WARNING: $selector2: + > ~ ~ .d is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -168,7 +175,7 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: inspect(selector-unify("+ ~ > .c", "+ > ~ ~ .d"))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: meta.inspect(selector.unify("+ ~ > .c", "+ > ~ ~ .d"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:15 root stylesheet + input.scss 3:20 root stylesheet diff --git a/spec/core_functions/selector/unify/complex/combinators/multiple.hrx b/spec/core_functions/selector/unify/complex/combinators/multiple.hrx index c3ae67a2f1..de40f31105 100644 --- a/spec/core_functions/selector/unify/complex/combinators/multiple.hrx +++ b/spec/core_functions/selector/unify/complex/combinators/multiple.hrx @@ -1,5 +1,6 @@ <===> isolated/input.scss -a {b: selector-unify(".c > .d + .e", ".f .g ~ .h")} +@use "sass:selector"; +a {b: selector.unify(".c > .d + .e", ".f .g ~ .h")} <===> isolated/output.css a { @@ -16,7 +17,8 @@ random. Any of these specs should pass with any combination of combinators. <===> ================================================================================ <===> in_a_row/same/input.scss -a {b: selector-unify(".c + ~ > .d", ".e + ~ > .f")} +@use "sass:selector"; +a {b: selector.unify(".c + ~ > .d", ".e + ~ > .f")} <===> in_a_row/same/output.css @@ -27,10 +29,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e + ~ > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e + ~ > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: .e + ~ > .f is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -38,15 +40,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e + ~ > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e + ~ > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> in_a_row/supersequence/contiguous/input.scss -a {b: selector-unify(".c + ~ > .d", ".e > + ~ > > .f")} +@use "sass:selector"; +a {b: selector.unify(".c + ~ > .d", ".e > + ~ > > .f")} <===> in_a_row/supersequence/contiguous/output.css @@ -57,10 +60,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e > + ~ > > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e > + ~ > > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: .e > + ~ > > .f is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -68,15 +71,16 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e > + ~ > > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e > + ~ > > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> in_a_row/supersequence/non_contiguous/input.scss -a {b: selector-unify(".c + ~ > .d", ".e + > ~ ~ > .f")} +@use "sass:selector"; +a {b: selector.unify(".c + ~ > .d", ".e + > ~ ~ > .f")} <===> in_a_row/supersequence/non_contiguous/output.css @@ -87,10 +91,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e + > ~ ~ > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e + > ~ ~ > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet DEPRECATION WARNING: $selector2: .e + > ~ ~ > .f is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -98,15 +102,17 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: selector-unify(".c + ~ > .d", ".e + > ~ ~ > .f")} +2 | a {b: selector.unify(".c + ~ > .d", ".e + > ~ ~ > .f")} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> in_a_row/different/input.scss -a {b: inspect(selector-unify(".c + ~ > .d", ".e + > ~ ~ .f"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(".c + ~ > .d", ".e + > ~ ~ .f"))} <===> in_a_row/different/output.css a { @@ -120,10 +126,10 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: inspect(selector-unify(".c + ~ > .d", ".e + > ~ ~ .f"))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: meta.inspect(selector.unify(".c + ~ > .d", ".e + > ~ ~ .f"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:15 root stylesheet + input.scss 3:20 root stylesheet DEPRECATION WARNING: $selector2: .e + > ~ ~ .f is not valid CSS. This will be an error in Dart Sass 2.0.0. @@ -131,7 +137,7 @@ This will be an error in Dart Sass 2.0.0. More info: https://sass-lang.com/d/bogus-combinators , -1 | a {b: inspect(selector-unify(".c + ~ > .d", ".e + > ~ ~ .f"))} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +3 | a {b: meta.inspect(selector.unify(".c + ~ > .d", ".e + > ~ ~ .f"))} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:15 root stylesheet + input.scss 3:20 root stylesheet diff --git a/spec/core_functions/selector/unify/complex/combinators/next_sibling.hrx b/spec/core_functions/selector/unify/complex/combinators/next_sibling.hrx index 0a52eddb60..eaf45a435a 100644 --- a/spec/core_functions/selector/unify/complex/combinators/next_sibling.hrx +++ b/spec/core_functions/selector/unify/complex/combinators/next_sibling.hrx @@ -1,5 +1,6 @@ <===> and_descendant/input.scss -a {b: selector-unify(".c + .s1", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c + .s1", ".c .s2")} <===> and_descendant/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> and_child/input.scss -a {b: selector-unify(".c + .s1", ".c > .s2")} +@use "sass:selector"; +a {b: selector.unify(".c + .s1", ".c > .s2")} <===> and_child/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> and_sibling/distinct/input.scss -a {b: selector-unify(".c + .d", ".e ~ .f")} +@use "sass:selector"; +a {b: selector.unify(".c + .d", ".e ~ .f")} <===> and_sibling/distinct/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> and_sibling/identical/input.scss -a {b: selector-unify(".c + .s1", ".c ~ .s2")} +@use "sass:selector"; +a {b: selector.unify(".c + .s1", ".c ~ .s2")} <===> and_sibling/identical/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> and_sibling/superselector/input.scss -a {b: selector-unify(".c.s1-1 + .s1-2", ".c ~ .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 + .s1-2", ".c ~ .s2")} <===> and_sibling/superselector/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> and_sibling/overlap/input.scss -a {b: selector-unify(".c.s1-1 + .s1-2", ".c.s2-1 ~ .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 + .s1-2", ".c.s2-1 ~ .s2-2")} <===> and_sibling/overlap/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> and_sibling/conflict/input.scss -a {b: selector-unify("#s1-1 + .s1-2", "#s2-1 ~ .s2-2")} +@use "sass:selector"; +a {b: selector.unify("#s1-1 + .s1-2", "#s2-1 ~ .s2-2")} <===> and_sibling/conflict/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> and_next_sibling/distinct/input.scss -a {b: selector-unify(".c + .d", ".e + .f")} +@use "sass:selector"; +a {b: selector.unify(".c + .d", ".e + .f")} <===> and_next_sibling/distinct/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> and_next_sibling/superselector/input.scss -a {b: selector-unify(".c.s1-1 + .s1-2", ".c + .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 + .s1-2", ".c + .s2")} <===> and_next_sibling/superselector/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> and_next_sibling/overlap/input.scss -a {b: selector-unify(".c.s1-1 + .s1-2", ".c.s2-1 + .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 + .s1-2", ".c.s2-1 + .s2-2")} <===> and_next_sibling/overlap/output.css a { @@ -99,7 +109,9 @@ a { <===> ================================================================================ <===> and_next_sibling/conflict/input.scss -a {b: inspect(selector-unify("#s1-1 + .s1-2", "#s2-1 + .s2-2"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("#s1-1 + .s1-2", "#s2-1 + .s2-2"))} <===> and_next_sibling/conflict/output.css a { diff --git a/spec/core_functions/selector/unify/complex/combinators/sibling.hrx b/spec/core_functions/selector/unify/complex/combinators/sibling.hrx index f7da089b32..bd58fabb13 100644 --- a/spec/core_functions/selector/unify/complex/combinators/sibling.hrx +++ b/spec/core_functions/selector/unify/complex/combinators/sibling.hrx @@ -1,5 +1,6 @@ <===> and_descendant/input.scss -a {b: selector-unify(".c ~ .s1", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .s1", ".c .s2")} <===> and_descendant/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> and_child/input.scss -a {b: selector-unify(".c ~ .s1", ".c > .s2")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .s1", ".c > .s2")} <===> and_child/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> and_sibling/distinct/input.scss -a {b: selector-unify(".c ~ .d", ".e ~ .f")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .d", ".e ~ .f")} <===> and_sibling/distinct/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> and_sibling/identical/input.scss -a {b: selector-unify(".c ~ .s1", ".c ~ .s2")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .s1", ".c ~ .s2")} <===> and_sibling/identical/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> and_sibling/superselector/input.scss -a {b: selector-unify(".c.s1-1 ~ .s1-2", ".c ~ .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 ~ .s1-2", ".c ~ .s2")} <===> and_sibling/superselector/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> and_sibling/overlap/input.scss -a {b: selector-unify(".c.s1-1 ~ .s1-2", ".c.s2-1 ~ .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 ~ .s1-2", ".c.s2-1 ~ .s2-2")} <===> and_sibling/overlap/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> and_sibling/conflict/input.scss -a {b: selector-unify("#s1-1 ~ .s1-2", "#s2-1 ~ .s2-2")} +@use "sass:selector"; +a {b: selector.unify("#s1-1 ~ .s1-2", "#s2-1 ~ .s2-2")} <===> and_sibling/conflict/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> and_next_sibling/distinct/input.scss -a {b: selector-unify(".c ~ .d", ".e + .f")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .d", ".e + .f")} <===> and_next_sibling/distinct/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> and_next_sibling/identical/input.scss -a {b: selector-unify(".c ~ .s1", ".c + .s2")} +@use "sass:selector"; +a {b: selector.unify(".c ~ .s1", ".c + .s2")} <===> and_next_sibling/identical/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> and_next_sibling/superselector/input.scss -a {b: selector-unify(".c.s1-1 ~ .s1-2", ".c + .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 ~ .s1-2", ".c + .s2")} <===> and_next_sibling/superselector/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> and_next_sibling/overlap/input.scss -a {b: selector-unify(".c.s1-1 ~ .s1-2", ".c.s2-1 + .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 ~ .s1-2", ".c.s2-1 + .s2-2")} <===> and_next_sibling/overlap/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> and_next_sibling/conflict/input.scss -a {b: selector-unify("#s1-1 ~ .s1-2", "#s2-1 + .s2-2")} +@use "sass:selector"; +a {b: selector.unify("#s1-1 ~ .s1-2", "#s2-1 + .s2-2")} <===> and_next_sibling/conflict/output.css a { diff --git a/spec/core_functions/selector/unify/complex/distinct.hrx b/spec/core_functions/selector/unify/complex/distinct.hrx index 1e3a123f06..1c1fc0fc2a 100644 --- a/spec/core_functions/selector/unify/complex/distinct.hrx +++ b/spec/core_functions/selector/unify/complex/distinct.hrx @@ -1,5 +1,6 @@ <===> two_level/input.scss -a {b: selector-unify(".c .d", ".e .f")} +@use "sass:selector"; +a {b: selector.unify(".c .d", ".e .f")} <===> two_level/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> three_level/input.scss -a {b: selector-unify(".c .d .e", ".f .g .h")} +@use "sass:selector"; +a {b: selector.unify(".c .d .e", ".f .g .h")} <===> three_level/output.css a { diff --git a/spec/core_functions/selector/unify/complex/identical.hrx b/spec/core_functions/selector/unify/complex/identical.hrx index f14505bedf..8e01294500 100644 --- a/spec/core_functions/selector/unify/complex/identical.hrx +++ b/spec/core_functions/selector/unify/complex/identical.hrx @@ -1,5 +1,6 @@ <===> two_level/input.scss -a {b: selector-unify(".c .s1", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c .s1", ".c .s2")} <===> two_level/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> three_level/outer/input.scss -a {b: selector-unify(".c .s1-1 .s1-2", ".c .s2-1 .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c .s1-1 .s1-2", ".c .s2-1 .s2-2")} <===> three_level/outer/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> three_level/inner/input.scss -a {b: selector-unify(".s1-1 .d .s1-2", ".s2-1 .d .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".s1-1 .d .s1-2", ".s2-1 .d .s2-2")} <===> three_level/inner/output.css a { diff --git a/spec/core_functions/selector/unify/complex/lcs.hrx b/spec/core_functions/selector/unify/complex/lcs.hrx index 3c66a43320..ff564d0c86 100644 --- a/spec/core_functions/selector/unify/complex/lcs.hrx +++ b/spec/core_functions/selector/unify/complex/lcs.hrx @@ -6,9 +6,10 @@ where the most specific selector will be chosen as the canonical selector. <===> ================================================================================ <===> two_versus_one/input.scss +@use "sass:selector"; // The longest common subsequence is `.c .d`, which is longer than `.e`, so `.c // .d` gets unified while `.e` gets duplicated. -a {b: selector-unify(".c .d .e .s1", ".e .c .d .s2")} +a {b: selector.unify(".c .d .e .s1", ".e .c .d .s2")} <===> two_versus_one/output.css a { @@ -18,9 +19,10 @@ a { <===> ================================================================================ <===> three_versus_two/input.scss +@use "sass:selector"; // The longest common subsequence is `.c .d .e`, which is longer than `.f g`, so // `.c .d .e` gets unified while `.f .g` gets duplicated. -a {b: selector-unify(".c .d .e .f .g .s1", ".f .g .c .d .e .s2")} +a {b: selector.unify(".c .d .e .f .g .s1", ".f .g .c .d .e .s2")} <===> three_versus_two/output.css a { @@ -30,7 +32,8 @@ a { <===> ================================================================================ <===> non_contiguous/same_positions/input.scss -a {b: selector-unify(".s1-1 .c .d .s1-2 .e .s1-3", ".s2-1 .c .d .s2-2 .e .s2-3")} +@use "sass:selector"; +a {b: selector.unify(".s1-1 .c .d .s1-2 .e .s1-3", ".s2-1 .c .d .s2-2 .e .s2-3")} <===> non_contiguous/same_positions/output.css a { @@ -40,7 +43,8 @@ a { <===> ================================================================================ <===> non_contiguous/different_positions/input.scss -a {b: selector-unify(".s1-1 .c .d .s1-2 .e .s1-3", ".c .s2-1 .d .e .s2-2 .s2-3")} +@use "sass:selector"; +a {b: selector.unify(".s1-1 .c .d .s1-2 .e .s1-3", ".c .s2-1 .d .e .s2-2 .s2-3")} <===> non_contiguous/different_positions/output.css a { diff --git a/spec/core_functions/selector/unify/complex/overlap.hrx b/spec/core_functions/selector/unify/complex/overlap.hrx index 010463dd6c..e901935c21 100644 --- a/spec/core_functions/selector/unify/complex/overlap.hrx +++ b/spec/core_functions/selector/unify/complex/overlap.hrx @@ -1,7 +1,8 @@ <===> class/input.scss +@use "sass:selector"; // Because neither compound selector containing `.c` is a superselector of the // other, they aren't unified. -a {b: selector-unify(".c.s1-1 .s1-2", ".c.s2-1 .s2-2")} +a {b: selector.unify(".c.s1-1 .s1-2", ".c.s2-1 .s2-2")} <===> class/output.css a { @@ -11,7 +12,8 @@ a { <===> ================================================================================ <===> id/no_unification/input.scss -a {b: selector-unify("#s1-1.c .s1-2", "#s2-1.c .s2-2")} +@use "sass:selector"; +a {b: selector.unify("#s1-1.c .s1-2", "#s2-1.c .s2-2")} <===> id/no_unification/output.css a { @@ -21,10 +23,11 @@ a { <===> ================================================================================ <===> id/forced_unification/input.scss +@use "sass:selector"; // Even though neither selector containing `#c` is a superselector of the other, // they're still unified because the selector can't meainingfully contain two // instances of `#c`. -a {b: selector-unify("#c.s1-1 .s1-2", "#c.s2-1 .s2-2")} +a {b: selector.unify("#c.s1-1 .s1-2", "#c.s2-1 .s2-2")} <===> id/forced_unification/output.css a { @@ -34,7 +37,8 @@ a { <===> ================================================================================ <===> pseudo_element/no_unification/input.scss -a {b: selector-unify("::s1-1.c .s1-2", "::s2-1.c .s2-2")} +@use "sass:selector"; +a {b: selector.unify("::s1-1.c .s1-2", "::s2-1.c .s2-2")} <===> pseudo_element/no_unification/output.css a { @@ -44,7 +48,8 @@ a { <===> ================================================================================ <===> pseudo_element/forced_unification/input.scss -a {b: selector-unify(".s1-1::c .s1-2", ".s2-1::c .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".s1-1::c .s1-2", ".s2-1::c .s2-2")} <===> pseudo_element/forced_unification/output.css a { diff --git a/spec/core_functions/selector/unify/complex/rootish.hrx b/spec/core_functions/selector/unify/complex/rootish.hrx index 302e3e628d..797a05a45b 100644 --- a/spec/core_functions/selector/unify/complex/rootish.hrx +++ b/spec/core_functions/selector/unify/complex/rootish.hrx @@ -5,7 +5,8 @@ All rootish selectors are expected to behave like `:root`, but we only test <===> ================================================================================ <===> root/in_one/selector1/two_layer/input.scss -a {b: selector-unify(":root .c", ".d .e")} +@use "sass:selector"; +a {b: selector.unify(":root .c", ".d .e")} <===> root/in_one/selector1/two_layer/output.css a { @@ -15,7 +16,8 @@ a { <===> ================================================================================ <===> root/in_one/selector1/three_layer/input.scss -a {b: selector-unify(":root .c .d", ".e .f")} +@use "sass:selector"; +a {b: selector.unify(":root .c .d", ".e .f")} <===> root/in_one/selector1/three_layer/output.css a { @@ -25,7 +27,8 @@ a { <===> ================================================================================ <===> root/in_one/selector2/two_layer/input.scss -a {b: selector-unify(".c .d", ":root .e")} +@use "sass:selector"; +a {b: selector.unify(".c .d", ":root .e")} <===> root/in_one/selector2/two_layer/output.css a { @@ -35,7 +38,8 @@ a { <===> ================================================================================ <===> root/in_one/selector2/three_layer/input.scss -a {b: selector-unify(".c .d", ":root .e .f")} +@use "sass:selector"; +a {b: selector.unify(".c .d", ":root .e .f")} <===> root/in_one/selector2/three_layer/output.css a { @@ -45,7 +49,9 @@ a { <===> ================================================================================ <===> root/in_both/cant_unify/input.scss -a {b: inspect(selector-unify("c:root .d", "e:root .f"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c:root .d", "e:root .f"))} <===> root/in_both/cant_unify/output.css a { @@ -55,7 +61,8 @@ a { <===> ================================================================================ <===> root/in_both/superselector/input.scss -a {b: selector-unify("c:root .d", ":root .e")} +@use "sass:selector"; +a {b: selector.unify("c:root .d", ":root .e")} <===> root/in_both/superselector/output.css a { @@ -65,7 +72,8 @@ a { <===> ================================================================================ <===> root/in_both/can_unify/input.scss -a {b: selector-unify(".c:root .d", ".e:root .f")} +@use "sass:selector"; +a {b: selector.unify(".c:root .d", ".e:root .f")} <===> root/in_both/can_unify/output.css a { @@ -75,7 +83,8 @@ a { <===> ================================================================================ <===> scope/input.scss -a {b: selector-unify(":scope .c", ".d .e")} +@use "sass:selector"; +a {b: selector.unify(":scope .c", ".d .e")} <===> scope/output.css a { @@ -85,7 +94,8 @@ a { <===> ================================================================================ <===> host/input.scss -a {b: selector-unify(":host .c", ".d .e")} +@use "sass:selector"; +a {b: selector.unify(":host .c", ".d .e")} <===> host/output.css a { @@ -95,7 +105,8 @@ a { <===> ================================================================================ <===> host_context/input.scss -a {b: selector-unify(":host-context(f g) .c", ".d .e")} +@use "sass:selector"; +a {b: selector.unify(":host-context(f g) .c", ".d .e")} <===> host_context/output.css a { @@ -105,7 +116,8 @@ a { <===> ================================================================================ <===> mixed/input.scss -a {b: selector-unify(":root .c .d", ":scope .e .f")} +@use "sass:selector"; +a {b: selector.unify(":root .c .d", ":scope .e .f")} <===> mixed/output.css a { diff --git a/spec/core_functions/selector/unify/complex/superselector.hrx b/spec/core_functions/selector/unify/complex/superselector.hrx index abb38f394a..1d1ab0c056 100644 --- a/spec/core_functions/selector/unify/complex/superselector.hrx +++ b/spec/core_functions/selector/unify/complex/superselector.hrx @@ -1,5 +1,6 @@ <===> two_level/input.scss -a {b: selector-unify(".c.s1-1 .s1-2", ".c .s2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 .s1-2", ".c .s2")} <===> two_level/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> three_level/outer/input.scss -a {b: selector-unify(".c.s1-1 .s1-2 .s1-3", ".c .s2-1 .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".c.s1-1 .s1-2 .s1-3", ".c .s2-1 .s2-2")} <===> three_level/outer/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> three_level/inner/input.scss -a {b: selector-unify(".s1-1 .c.s1-2 .s1-3", ".s2-1 .c .s2-2")} +@use "sass:selector"; +a {b: selector.unify(".s1-1 .c.s1-2 .s1-3", ".s2-1 .c .s2-2")} <===> three_level/inner/output.css a { diff --git a/spec/core_functions/selector/unify/compound.hrx b/spec/core_functions/selector/unify/compound.hrx index a26bbb1155..d289d4be0a 100644 --- a/spec/core_functions/selector/unify/compound.hrx +++ b/spec/core_functions/selector/unify/compound.hrx @@ -1,5 +1,6 @@ <===> no_overlap/input.scss -a {b: selector-unify(".c.d", ".e.f")} +@use "sass:selector"; +a {b: selector.unify(".c.d", ".e.f")} <===> no_overlap/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> partial_overlap/input.scss -a {b: selector-unify(".c.d", ".d.e")} +@use "sass:selector"; +a {b: selector.unify(".c.d", ".d.e")} <===> partial_overlap/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> full_overlap/input.scss -a {b: selector-unify(".c.d", ".c.d")} +@use "sass:selector"; +a {b: selector.unify(".c.d", ".c.d")} <===> full_overlap/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> order/preserved_by_default/input.scss -a {b: selector-unify(".c.d", ".e.f")} +@use "sass:selector"; +a {b: selector.unify(".c.d", ".e.f")} <===> order/preserved_by_default/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> order/element_at_start/input.scss -a {b: selector-unify(".c", "d")} +@use "sass:selector"; +a {b: selector.unify(".c", "d")} <===> order/element_at_start/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> order/pseudo_element_at_end/input.scss -a {b: selector-unify("::c", ".d")} +@use "sass:selector"; +a {b: selector.unify("::c", ".d")} <===> order/pseudo_element_at_end/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> order/pseudo_class_at_end/input.scss -a {b: selector-unify(":c", ".d")} +@use "sass:selector"; +a {b: selector.unify(":c", ".d")} <===> order/pseudo_class_at_end/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> order/pseudo_element_after_pseudo_class/element_first/input.scss -a {b: selector-unify("::c", ":d")} +@use "sass:selector"; +a {b: selector.unify("::c", ":d")} <===> order/pseudo_element_after_pseudo_class/element_first/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> order/pseudo_element_after_pseudo_class/class_first/input.scss -a {b: selector-unify(":c", "::d")} +@use "sass:selector"; +a {b: selector.unify(":c", "::d")} <===> order/pseudo_element_after_pseudo_class/class_first/output.css a { diff --git a/spec/core_functions/selector/unify/error.hrx b/spec/core_functions/selector/unify/error.hrx index 0434da0816..6cbf1a8579 100644 --- a/spec/core_functions/selector/unify/error.hrx +++ b/spec/core_functions/selector/unify/error.hrx @@ -1,5 +1,6 @@ <===> selector1/parent/input.scss -a {b: selector-unify("&", "c")} +@use "sass:selector"; +a {b: selector.unify("&", "c")} <===> selector1/parent/error Error: $selector1: Parent selectors aren't allowed here. @@ -9,15 +10,16 @@ Error: $selector1: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-unify("&", "c")} +2 | a {b: selector.unify("&", "c")} | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> selector1/invalid/input.scss -a {b: selector-unify("[c", "d")} +@use "sass:selector"; +a {b: selector.unify("[c", "d")} <===> selector1/invalid/error Error: $selector1: expected more input. @@ -27,29 +29,31 @@ Error: $selector1: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-unify("[c", "d")} +2 | a {b: selector.unify("[c", "d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> selector1/type/input.scss -a {b: selector-unify(1, "c")} +@use "sass:selector"; +a {b: selector.unify(1, "c")} <===> selector1/type/error Error: $selector1: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-unify(1, "c")} +2 | a {b: selector.unify(1, "c")} | ^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> selector2/parent/input.scss -a {b: selector-unify("c", "&")} +@use "sass:selector"; +a {b: selector.unify("c", "&")} <===> selector2/parent/error Error: $selector2: Parent selectors aren't allowed here. @@ -59,15 +63,16 @@ Error: $selector2: Parent selectors aren't allowed here. ' - 1:1 root stylesheet , -1 | a {b: selector-unify("c", "&")} +2 | a {b: selector.unify("c", "&")} | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> selector2/invalid/input.scss -a {b: selector-unify("c", "[d")} +@use "sass:selector"; +a {b: selector.unify("c", "[d")} <===> selector2/invalid/error Error: $selector2: expected more input. @@ -77,21 +82,36 @@ Error: $selector2: expected more input. ' - 1:3 root stylesheet , -1 | a {b: selector-unify("c", "[d")} +2 | a {b: selector.unify("c", "[d")} | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> selector2/type/input.scss -a {b: selector-unify("c", 1)} +@use "sass:selector"; +a {b: selector.unify("c", 1)} <===> selector2/type/error Error: $selector2: 1 is not a valid selector: it must be a string, a list of strings, or a list of lists of strings. , -1 | a {b: selector-unify("c", 1)} +2 | a {b: selector.unify("c", 1)} | ^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:selector"; +a {b: selector.selector-unify(".c", ".d")} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: selector.selector-unify(".c", ".d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/selector/unify/format.hrx b/spec/core_functions/selector/unify/format.hrx index 7c721e51ff..6a262fcf1f 100644 --- a/spec/core_functions/selector/unify/format.hrx +++ b/spec/core_functions/selector/unify/format.hrx @@ -7,7 +7,8 @@ spec just verifies one example for each parameter. <===> ================================================================================ <===> input/non_string/selector1/input.scss -a {b: selector-unify((c, d c), ".e")} +@use "sass:selector"; +a {b: selector.unify((c, d c), ".e")} <===> input/non_string/selector1/output.css a { @@ -17,7 +18,8 @@ a { <===> ================================================================================ <===> input/non_string/selector2/input.scss -a {b: selector-unify(".e", (c, d c))} +@use "sass:selector"; +a {b: selector.unify(".e", (c, d c))} <===> input/non_string/selector2/output.css a { @@ -27,7 +29,8 @@ a { <===> ================================================================================ <===> input/two_lists/input.scss -a {b: selector-unify(".c, .d", ".e, .f")} +@use "sass:selector"; +a {b: selector.unify(".c, .d", ".e, .f")} <===> input/two_lists/output.css a { @@ -37,7 +40,8 @@ a { <===> ================================================================================ <===> output/input.scss -$result: selector-unify("c d, e f", ".g"); +@use "sass:selector"; +$result: selector.unify("c d, e f", ".g"); a { result: $result; structure: $result == ("c" "d.g", "e" "f.g"); diff --git a/spec/core_functions/selector/unify/simple/attribute.hrx b/spec/core_functions/selector/unify/simple/attribute.hrx index f2f1e685cd..950596c358 100644 --- a/spec/core_functions/selector/unify/simple/attribute.hrx +++ b/spec/core_functions/selector/unify/simple/attribute.hrx @@ -1,5 +1,6 @@ <===> same/input.scss -a {b: selector-unify("[c]", "[c]")} +@use "sass:selector"; +a {b: selector.unify("[c]", "[c]")} <===> same/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> different/input.scss -a {b: selector-unify("[c]", "[d]")} +@use "sass:selector"; +a {b: selector.unify("[c]", "[d]")} <===> different/output.css a { diff --git a/spec/core_functions/selector/unify/simple/class.hrx b/spec/core_functions/selector/unify/simple/class.hrx index df971e9b32..09e2d19b27 100644 --- a/spec/core_functions/selector/unify/simple/class.hrx +++ b/spec/core_functions/selector/unify/simple/class.hrx @@ -1,5 +1,6 @@ <===> same/input.scss -a {b: selector-unify(".c", ".c")} +@use "sass:selector"; +a {b: selector.unify(".c", ".c")} <===> same/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> different/input.scss -a {b: selector-unify(".c", ".d")} +@use "sass:selector"; +a {b: selector.unify(".c", ".d")} <===> different/output.css a { diff --git a/spec/core_functions/selector/unify/simple/different_types.hrx b/spec/core_functions/selector/unify/simple/different_types.hrx index 9dd5a7282e..cd78e96c7f 100644 --- a/spec/core_functions/selector/unify/simple/different_types.hrx +++ b/spec/core_functions/selector/unify/simple/different_types.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: selector-unify("c", "#d")} +@use "sass:selector"; +a {b: selector.unify("c", "#d")} <===> output.css a { diff --git a/spec/core_functions/selector/unify/simple/id.hrx b/spec/core_functions/selector/unify/simple/id.hrx index a00ed2b879..05b26b53e1 100644 --- a/spec/core_functions/selector/unify/simple/id.hrx +++ b/spec/core_functions/selector/unify/simple/id.hrx @@ -1,5 +1,6 @@ <===> same/input.scss -a {b: selector-unify("#c", "#c")} +@use "sass:selector"; +a {b: selector.unify("#c", "#c")} <===> same/output.css a { @@ -9,7 +10,9 @@ a { <===> ================================================================================ <===> different/input.scss -a {b: inspect(selector-unify("#c", "#d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("#c", "#d"))} <===> different/output.css a { diff --git a/spec/core_functions/selector/unify/simple/placeholder.hrx b/spec/core_functions/selector/unify/simple/placeholder.hrx index b5043d4d00..e945d05770 100644 --- a/spec/core_functions/selector/unify/simple/placeholder.hrx +++ b/spec/core_functions/selector/unify/simple/placeholder.hrx @@ -1,5 +1,6 @@ <===> same/input.scss -a {b: selector-unify("%c", "%c")} +@use "sass:selector"; +a {b: selector.unify("%c", "%c")} <===> same/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> different/input.scss -a {b: selector-unify("%c", "%d")} +@use "sass:selector"; +a {b: selector.unify("%c", "%d")} <===> different/output.css a { diff --git a/spec/core_functions/selector/unify/simple/pseudo.hrx b/spec/core_functions/selector/unify/simple/pseudo.hrx index 707597d674..9396150297 100644 --- a/spec/core_functions/selector/unify/simple/pseudo.hrx +++ b/spec/core_functions/selector/unify/simple/pseudo.hrx @@ -1,5 +1,6 @@ <===> no_arg/class/same/input.scss -a {b: selector-unify(":c", ":c")} +@use "sass:selector"; +a {b: selector.unify(":c", ":c")} <===> no_arg/class/same/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> no_arg/class/different/input.scss -a {b: selector-unify(":c", ":d")} +@use "sass:selector"; +a {b: selector.unify(":c", ":d")} <===> no_arg/class/different/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> no_arg/element/same/input.scss -a {b: selector-unify("::c", "::c")} +@use "sass:selector"; +a {b: selector.unify("::c", "::c")} <===> no_arg/element/same/output.css a { @@ -29,7 +32,9 @@ a { <===> ================================================================================ <===> no_arg/element/different/input.scss -a {b: inspect(selector-unify("::c", "::d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("::c", "::d"))} <===> no_arg/element/different/output.css a { @@ -39,7 +44,8 @@ a { <===> ================================================================================ <===> no_arg/different_syntax_same_semantics/before/input.scss -a {b: selector-unify(":before", "::before")} +@use "sass:selector"; +a {b: selector.unify(":before", "::before")} <===> no_arg/different_syntax_same_semantics/before/output.css a { @@ -49,7 +55,8 @@ a { <===> ================================================================================ <===> no_arg/different_syntax_same_semantics/after/input.scss -a {b: selector-unify(":after", "::after")} +@use "sass:selector"; +a {b: selector.unify(":after", "::after")} <===> no_arg/different_syntax_same_semantics/after/output.css a { @@ -59,7 +66,8 @@ a { <===> ================================================================================ <===> no_arg/different_syntax_same_semantics/first_line/input.scss -a {b: selector-unify(":first-line", "::first-line")} +@use "sass:selector"; +a {b: selector.unify(":first-line", "::first-line")} <===> no_arg/different_syntax_same_semantics/first_line/output.css a { @@ -69,7 +77,8 @@ a { <===> ================================================================================ <===> no_arg/different_syntax_same_semantics/first_letter/input.scss -a {b: selector-unify(":first-letter", "::first-letter")} +@use "sass:selector"; +a {b: selector.unify(":first-letter", "::first-letter")} <===> no_arg/different_syntax_same_semantics/first_letter/output.css a { @@ -79,7 +88,8 @@ a { <===> ================================================================================ <===> arg/class/same/input.scss -a {b: selector-unify(":c(@#$)", ":c(@#$)")} +@use "sass:selector"; +a {b: selector.unify(":c(@#$)", ":c(@#$)")} <===> arg/class/same/output.css a { @@ -89,7 +99,8 @@ a { <===> ================================================================================ <===> arg/class/different/input.scss -a {b: selector-unify(":c(@#$)", ":c(*&^)")} +@use "sass:selector"; +a {b: selector.unify(":c(@#$)", ":c(*&^)")} <===> arg/class/different/output.css a { @@ -99,7 +110,8 @@ a { <===> ================================================================================ <===> arg/element/same/input.scss -a {b: selector-unify("::c(@#$)", "::c(@#$)")} +@use "sass:selector"; +a {b: selector.unify("::c(@#$)", "::c(@#$)")} <===> arg/element/same/output.css a { @@ -109,7 +121,9 @@ a { <===> ================================================================================ <===> arg/element/different/input.scss -a {b: inspect(selector-unify("::c(@#$)", "::c(*&^)"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("::c(@#$)", "::c(*&^)"))} <===> arg/element/different/output.css a { @@ -119,7 +133,8 @@ a { <===> ================================================================================ <===> selector_arg/is/same/input.scss -a {b: selector-unify(":is(.c)", ":is(.c)")} +@use "sass:selector"; +a {b: selector.unify(":is(.c)", ":is(.c)")} <===> selector_arg/is/same/output.css a { @@ -129,7 +144,8 @@ a { <===> ================================================================================ <===> selector_arg/is/different/input.scss -a {b: selector-unify(":is(.c)", ":is(.d)")} +@use "sass:selector"; +a {b: selector.unify(":is(.c)", ":is(.d)")} <===> selector_arg/is/different/output.css a { @@ -139,7 +155,8 @@ a { <===> ================================================================================ <===> selector_arg/where/same/input.scss -a {b: selector-unify(":where(.c)", ":where(.c)")} +@use "sass:selector"; +a {b: selector.unify(":where(.c)", ":where(.c)")} <===> selector_arg/where/same/output.css a { @@ -149,7 +166,8 @@ a { <===> ================================================================================ <===> selector_arg/where/different/input.scss -a {b: selector-unify(":where(.c)", ":where(.d)")} +@use "sass:selector"; +a {b: selector.unify(":where(.c)", ":where(.d)")} <===> selector_arg/where/different/output.css a { @@ -159,7 +177,8 @@ a { <===> ================================================================================ <===> selector_arg/matches/same/input.scss -a {b: selector-unify(":matches(.c)", ":matches(.c)")} +@use "sass:selector"; +a {b: selector.unify(":matches(.c)", ":matches(.c)")} <===> selector_arg/matches/same/output.css a { @@ -169,7 +188,8 @@ a { <===> ================================================================================ <===> selector_arg/matches/different/input.scss -a {b: selector-unify(":matches(.c)", ":matches(.d)")} +@use "sass:selector"; +a {b: selector.unify(":matches(.c)", ":matches(.d)")} <===> selector_arg/matches/different/output.css a { @@ -179,7 +199,8 @@ a { <===> ================================================================================ <===> host/argless/host/argless/input.scss -a {b: selector-unify(":host", ":host")} +@use "sass:selector"; +a {b: selector.unify(":host", ":host")} <===> host/argless/host/argless/output.css a { @@ -189,7 +210,8 @@ a { <===> ================================================================================ <===> host/argless/host/arg/input.scss -a {b: selector-unify(":host", ":host(.c)")} +@use "sass:selector"; +a {b: selector.unify(":host", ":host(.c)")} <===> host/argless/host/arg/output.css a { @@ -199,7 +221,8 @@ a { <===> ================================================================================ <===> host/argless/host_context/left/input.scss -a {b: selector-unify(":host", ":host-context(.c)")} +@use "sass:selector"; +a {b: selector.unify(":host", ":host-context(.c)")} <===> host/argless/host_context/left/output.css a { @@ -209,7 +232,8 @@ a { <===> ================================================================================ <===> host/argless/host_context/right/input.scss -a {b: selector-unify(":host-context(.c)", ":host")} +@use "sass:selector"; +a {b: selector.unify(":host-context(.c)", ":host")} <===> host/argless/host_context/right/output.css a { @@ -219,7 +243,8 @@ a { <===> ================================================================================ <===> host/argless/selector_pseudo/left/input.scss -a {b: selector-unify(":host", ":is(.c)")} +@use "sass:selector"; +a {b: selector.unify(":host", ":is(.c)")} <===> host/argless/selector_pseudo/left/output.css a { @@ -229,7 +254,8 @@ a { <===> ================================================================================ <===> host/argless/selector_pseudo/right/input.scss -a {b: selector-unify(":is(.c)", ":host")} +@use "sass:selector"; +a {b: selector.unify(":is(.c)", ":host")} <===> host/argless/selector_pseudo/right/output.css a { @@ -239,7 +265,9 @@ a { <===> ================================================================================ <===> host/argless/pseudo/left/input.scss -a {b: inspect(selector-unify(":host", ":hover"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host", ":hover"))} <===> host/argless/pseudo/left/output.css a { @@ -249,7 +277,9 @@ a { <===> ================================================================================ <===> host/argless/pseudo/right/input.scss -a {b: inspect(selector-unify(":hover", ":host"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":hover", ":host"))} <===> host/argless/pseudo/right/output.css a { @@ -259,7 +289,9 @@ a { <===> ================================================================================ <===> host/argless/class/left/input.scss -a {b: inspect(selector-unify(":host", ".c"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host", ".c"))} <===> host/argless/class/left/output.css a { @@ -269,7 +301,9 @@ a { <===> ================================================================================ <===> host/argless/class/right/input.scss -a {b: inspect(selector-unify(".c", ":host"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(".c", ":host"))} <===> host/argless/class/right/output.css a { @@ -279,7 +313,9 @@ a { <===> ================================================================================ <===> host/argless/universal/left/input.scss -a {b: inspect(selector-unify(":host", "*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host", "*"))} <===> host/argless/universal/left/output.css a { @@ -289,7 +325,9 @@ a { <===> ================================================================================ <===> host/argless/universal/right/input.scss -a {b: inspect(selector-unify("*", ":host"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*", ":host"))} <===> host/argless/universal/right/output.css a { @@ -299,7 +337,8 @@ a { <===> ================================================================================ <===> host/argless/compound/selector_pseudos/left/input.scss -a {b: selector-unify(":host", ":is(.c):is(.d)")} +@use "sass:selector"; +a {b: selector.unify(":host", ":is(.c):is(.d)")} <===> host/argless/compound/selector_pseudos/left/output.css a { @@ -309,7 +348,8 @@ a { <===> ================================================================================ <===> host/argless/compound/selector_pseudos/right/input.scss -a {b: selector-unify(":is(.c):is(.d)", ":host")} +@use "sass:selector"; +a {b: selector.unify(":is(.c):is(.d)", ":host")} <===> host/argless/compound/selector_pseudos/right/output.css a { @@ -319,7 +359,9 @@ a { <===> ================================================================================ <===> host/argless/compound/class_and_selector_pseudo/left/input.scss -a {b: inspect(selector-unify(":host", ".c:is(.d)"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host", ".c:is(.d)"))} <===> host/argless/compound/class_and_selector_pseudo/left/output.css a { @@ -329,7 +371,9 @@ a { <===> ================================================================================ <===> host/argless/compound/class_and_selector_pseudo/right/input.scss -a {b: inspect(selector-unify(".c:is(.d)", ":host"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(".c:is(.d)", ":host"))} <===> host/argless/compound/class_and_selector_pseudo/right/output.css a { @@ -339,7 +383,9 @@ a { <===> ================================================================================ <===> host/argless/compound/host_and_class/left/input.scss -a {b: inspect(selector-unify(":host", ":host.c"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host", ":host.c"))} <===> host/argless/compound/host_and_class/left/output.css a { @@ -349,7 +395,9 @@ a { <===> ================================================================================ <===> host/argless/compound/host_and_class/right/input.scss -a {b: inspect(selector-unify(":host.c", ":host"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host.c", ":host"))} <===> host/argless/compound/host_and_class/right/output.css a { @@ -359,7 +407,8 @@ a { <===> ================================================================================ <===> host/arg/preserved/left/input.scss -a {b: selector-unify(":host(.c)", ":is(.d)")} +@use "sass:selector"; +a {b: selector.unify(":host(.c)", ":is(.d)")} <===> host/arg/preserved/left/output.css a { @@ -369,7 +418,8 @@ a { <===> ================================================================================ <===> host/arg/preserved/right/input.scss -a {b: selector-unify(":is(.c)", ":host(.d)")} +@use "sass:selector"; +a {b: selector.unify(":is(.c)", ":host(.d)")} <===> host/arg/preserved/right/output.css a { @@ -379,7 +429,9 @@ a { <===> ================================================================================ <===> host/arg/removed/left/input.scss -a {b: inspect(selector-unify(":host(.c)", ".d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host(.c)", ".d"))} <===> host/arg/removed/left/output.css a { @@ -389,7 +441,9 @@ a { <===> ================================================================================ <===> host/arg/removed/right/input.scss -a {b: inspect(selector-unify(".c", ":host(.d)"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(".c", ":host(.d)"))} <===> host/arg/removed/right/output.css a { @@ -399,7 +453,8 @@ a { <===> ================================================================================ <===> host_context/preserved/left/input.scss -a {b: selector-unify(":host-context(.c)", ":is(.d)")} +@use "sass:selector"; +a {b: selector.unify(":host-context(.c)", ":is(.d)")} <===> host_context/preserved/left/output.css a { @@ -409,7 +464,8 @@ a { <===> ================================================================================ <===> host_context/preserved/right/input.scss -a {b: selector-unify(":is(.c)", ":host-context(.d)")} +@use "sass:selector"; +a {b: selector.unify(":is(.c)", ":host-context(.d)")} <===> host_context/preserved/right/output.css a { @@ -419,7 +475,9 @@ a { <===> ================================================================================ <===> host_context/removed/left/input.scss -a {b: inspect(selector-unify(":host-context(.c)", ".d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(":host-context(.c)", ".d"))} <===> host_context/removed/left/output.css a { @@ -429,7 +487,9 @@ a { <===> ================================================================================ <===> host_context/removed/right/input.scss -a {b: inspect(selector-unify(".c", ":host-context(.d)"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify(".c", ":host-context(.d)"))} <===> host_context/removed/right/output.css a { diff --git a/spec/core_functions/selector/unify/simple/type.hrx b/spec/core_functions/selector/unify/simple/type.hrx deleted file mode 100644 index 1181f24d7a..0000000000 --- a/spec/core_functions/selector/unify/simple/type.hrx +++ /dev/null @@ -1,437 +0,0 @@ -<===> and_type/default/and_explicit/input.scss -a {b: inspect(selector-unify("c", "d|c"))} - -<===> and_type/default/and_explicit/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/default/and_empty/input.scss -a {b: inspect(selector-unify("c", "|c"))} - -<===> and_type/default/and_empty/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/default/and_default/same/input.scss -a {b: selector-unify("c", "c")} - -<===> and_type/default/and_default/same/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_type/default/and_default/different/input.scss -a {b: inspect(selector-unify("c", "d"))} - -<===> and_type/default/and_default/different/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/default/and_any/same_type/input.scss -a {b: selector-unify("c", "*|c")} - -<===> and_type/default/and_any/same_type/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_type/default/and_any/different_type/input.scss -a {b: inspect(selector-unify("c", "*|d"))} - -<===> and_type/default/and_any/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/explicit/and_explicit/same/input.scss -a {b: selector-unify("c|d", "c|d")} - -<===> and_type/explicit/and_explicit/same/output.css -a { - b: c|d; -} - -<===> -================================================================================ -<===> and_type/explicit/and_explicit/different/namespace/input.scss -a {b: inspect(selector-unify("c|d", "e|d"))} - -<===> and_type/explicit/and_explicit/different/namespace/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/explicit/and_explicit/different/type/input.scss -a {b: inspect(selector-unify("c|d", "c|e"))} - -<===> and_type/explicit/and_explicit/different/type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/explicit/and_empty/input.scss -a {b: inspect(selector-unify("c|d", "|d"))} - -<===> and_type/explicit/and_empty/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/explicit/and_default/input.scss -a {b: inspect(selector-unify("c|d", "d"))} - -<===> and_type/explicit/and_default/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/explicit/and_any/same_type/input.scss -a {b: selector-unify("c|d", "*|d")} - -<===> and_type/explicit/and_any/same_type/output.css -a { - b: c|d; -} - -<===> -================================================================================ -<===> and_type/explicit/and_any/different_type/input.scss -a {b: inspect(selector-unify("c|d", "*|e"))} - -<===> and_type/explicit/and_any/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/empty/and_explicit/input.scss -a {b: inspect(selector-unify("|c", "e|c"))} - -<===> and_type/empty/and_explicit/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/empty/and_empty/same/input.scss -a {b: selector-unify("|c", "|c")} - -<===> and_type/empty/and_empty/same/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_type/empty/and_empty/different/input.scss -a {b: inspect(selector-unify("|c", "|d"))} - -<===> and_type/empty/and_empty/different/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/empty/and_default/input.scss -a {b: inspect(selector-unify("|c", "c"))} - -<===> and_type/empty/and_default/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/empty/and_any/same_type/input.scss -a {b: selector-unify("|c", "*|c")} - -<===> and_type/empty/and_any/same_type/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_type/empty/and_any/different_type/input.scss -a {b: inspect(selector-unify("|c", "*|d"))} - -<===> and_type/empty/and_any/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/any/and_explicit/same_type/input.scss -a {b: selector-unify("*|c", "d|c")} - -<===> and_type/any/and_explicit/same_type/output.css -a { - b: d|c; -} - -<===> -================================================================================ -<===> and_type/any/and_explicit/different_type/input.scss -a {b: inspect(selector-unify("*|c", "d|e"))} - -<===> and_type/any/and_explicit/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/any/and_empty/same_type/input.scss -a {b: selector-unify("*|c", "|c")} - -<===> and_type/any/and_empty/same_type/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_type/any/and_empty/different_type/input.scss -a {b: inspect(selector-unify("*|c", "|d"))} - -<===> and_type/any/and_empty/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/any/and_default/same_type/input.scss -a {b: selector-unify("*|c", "c")} - -<===> and_type/any/and_default/same_type/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_type/any/and_default/different_type/input.scss -a {b: inspect(selector-unify("*|c", "d"))} - -<===> and_type/any/and_default/different_type/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_type/any/and_any/same/input.scss -a {b: selector-unify("*|c", "*|c")} - -<===> and_type/any/and_any/same/output.css -a { - b: *|c; -} - -<===> -================================================================================ -<===> and_type/any/and_any/different/input.scss -a {b: inspect(selector-unify("*|c", "*|d"))} - -<===> and_type/any/and_any/different/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/default/and_explicit/input.scss -a {b: inspect(selector-unify("c", "e|*"))} - -<===> and_universal/default/and_explicit/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/default/and_empty/input.scss -a {b: inspect(selector-unify("c", "|*"))} - -<===> and_universal/default/and_empty/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/default/and_default/input.scss -a {b: selector-unify("c", "*")} - -<===> and_universal/default/and_default/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_universal/default/and_any/input.scss -a {b: selector-unify("c", "*|*")} - -<===> and_universal/default/and_any/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_universal/explicit/and_explicit/same/input.scss -a {b: selector-unify("c|d", "c|*")} - -<===> and_universal/explicit/and_explicit/same/output.css -a { - b: c|d; -} - -<===> -================================================================================ -<===> and_universal/explicit/and_explicit/different/input.scss -a {b: inspect(selector-unify("c|d", "e|*"))} - -<===> and_universal/explicit/and_explicit/different/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/explicit/and_empty/input.scss -a {b: inspect(selector-unify("c|d", "|*"))} - -<===> and_universal/explicit/and_empty/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/explicit/and_default/input.scss -a {b: inspect(selector-unify("c|d", "*"))} - -<===> and_universal/explicit/and_default/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/explicit/and_any/input.scss -a {b: selector-unify("c|d", "*|*")} - -<===> and_universal/explicit/and_any/output.css -a { - b: c|d; -} - -<===> -================================================================================ -<===> and_universal/empty/and_explicit/input.scss -a {b: inspect(selector-unify("|c", "e|*"))} - -<===> and_universal/empty/and_explicit/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/empty/and_empty/input.scss -a {b: selector-unify("|c", "|*")} - -<===> and_universal/empty/and_empty/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_universal/empty/and_default/input.scss -a {b: inspect(selector-unify("|c", "*"))} - -<===> and_universal/empty/and_default/output.css -a { - b: null; -} - -<===> -================================================================================ -<===> and_universal/empty/and_any/input.scss -a {b: selector-unify("|c", "*|*")} - -<===> and_universal/empty/and_any/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_universal/any/and_explicit/input.scss -a {b: selector-unify("*|c", "d|*")} - -<===> and_universal/any/and_explicit/output.css -a { - b: d|c; -} - -<===> -================================================================================ -<===> and_universal/any/and_empty/input.scss -a {b: selector-unify("*|c", "|*")} - -<===> and_universal/any/and_empty/output.css -a { - b: |c; -} - -<===> -================================================================================ -<===> and_universal/any/and_default/input.scss -a {b: selector-unify("*|c", "*")} - -<===> and_universal/any/and_default/output.css -a { - b: c; -} - -<===> -================================================================================ -<===> and_universal/any/and_any/input.scss -a {b: selector-unify("*|c", "*|*")} - -<===> and_universal/any/and_any/output.css -a { - b: *|c; -} diff --git a/spec/core_functions/selector/unify/simple/type/and_type.hrx b/spec/core_functions/selector/unify/simple/type/and_type.hrx new file mode 100644 index 0000000000..ad204710fd --- /dev/null +++ b/spec/core_functions/selector/unify/simple/type/and_type.hrx @@ -0,0 +1,311 @@ +<===> default/and_explicit/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "d|c"))} + +<===> default/and_explicit/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> default/and_empty/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "|c"))} + +<===> default/and_empty/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> default/and_default/same/input.scss +@use "sass:selector"; +a {b: selector.unify("c", "c")} + +<===> default/and_default/same/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> default/and_default/different/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "d"))} + +<===> default/and_default/different/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> default/and_any/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("c", "*|c")} + +<===> default/and_any/same_type/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> default/and_any/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "*|d"))} + +<===> default/and_any/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_explicit/same/input.scss +@use "sass:selector"; +a {b: selector.unify("c|d", "c|d")} + +<===> explicit/and_explicit/same/output.css +a { + b: c|d; +} + +<===> +================================================================================ +<===> explicit/and_explicit/different/namespace/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "e|d"))} + +<===> explicit/and_explicit/different/namespace/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_explicit/different/type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "c|e"))} + +<===> explicit/and_explicit/different/type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_empty/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "|d"))} + +<===> explicit/and_empty/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_default/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "d"))} + +<===> explicit/and_default/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_any/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("c|d", "*|d")} + +<===> explicit/and_any/same_type/output.css +a { + b: c|d; +} + +<===> +================================================================================ +<===> explicit/and_any/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "*|e"))} + +<===> explicit/and_any/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_explicit/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "e|c"))} + +<===> empty/and_explicit/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_empty/same/input.scss +@use "sass:selector"; +a {b: selector.unify("|c", "|c")} + +<===> empty/and_empty/same/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> empty/and_empty/different/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "|d"))} + +<===> empty/and_empty/different/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_default/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "c"))} + +<===> empty/and_default/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_any/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("|c", "*|c")} + +<===> empty/and_any/same_type/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> empty/and_any/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "*|d"))} + +<===> empty/and_any/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> any/and_explicit/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "d|c")} + +<===> any/and_explicit/same_type/output.css +a { + b: d|c; +} + +<===> +================================================================================ +<===> any/and_explicit/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*|c", "d|e"))} + +<===> any/and_explicit/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> any/and_empty/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "|c")} + +<===> any/and_empty/same_type/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> any/and_empty/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*|c", "|d"))} + +<===> any/and_empty/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> any/and_default/same_type/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "c")} + +<===> any/and_default/same_type/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> any/and_default/different_type/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*|c", "d"))} + +<===> any/and_default/different_type/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> any/and_any/same/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "*|c")} + +<===> any/and_any/same/output.css +a { + b: *|c; +} + +<===> +================================================================================ +<===> any/and_any/different/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*|c", "*|d"))} + +<===> any/and_any/different/output.css +a { + b: null; +} diff --git a/spec/core_functions/selector/unify/simple/type/and_universal.hrx b/spec/core_functions/selector/unify/simple/type/and_universal.hrx new file mode 100644 index 0000000000..6849af954b --- /dev/null +++ b/spec/core_functions/selector/unify/simple/type/and_universal.hrx @@ -0,0 +1,191 @@ +<===> default/and_explicit/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "e|*"))} + +<===> default/and_explicit/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> default/and_empty/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c", "|*"))} + +<===> default/and_empty/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> default/and_default/input.scss +@use "sass:selector"; +a {b: selector.unify("c", "*")} + +<===> default/and_default/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> default/and_any/input.scss +@use "sass:selector"; +a {b: selector.unify("c", "*|*")} + +<===> default/and_any/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> explicit/and_explicit/same/input.scss +@use "sass:selector"; +a {b: selector.unify("c|d", "c|*")} + +<===> explicit/and_explicit/same/output.css +a { + b: c|d; +} + +<===> +================================================================================ +<===> explicit/and_explicit/different/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "e|*"))} + +<===> explicit/and_explicit/different/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_empty/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "|*"))} + +<===> explicit/and_empty/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_default/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|d", "*"))} + +<===> explicit/and_default/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> explicit/and_any/input.scss +@use "sass:selector"; +a {b: selector.unify("c|d", "*|*")} + +<===> explicit/and_any/output.css +a { + b: c|d; +} + +<===> +================================================================================ +<===> empty/and_explicit/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "e|*"))} + +<===> empty/and_explicit/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_empty/input.scss +@use "sass:selector"; +a {b: selector.unify("|c", "|*")} + +<===> empty/and_empty/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> empty/and_default/input.scss +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|c", "*"))} + +<===> empty/and_default/output.css +a { + b: null; +} + +<===> +================================================================================ +<===> empty/and_any/input.scss +@use "sass:selector"; +a {b: selector.unify("|c", "*|*")} + +<===> empty/and_any/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> any/and_explicit/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "d|*")} + +<===> any/and_explicit/output.css +a { + b: d|c; +} + +<===> +================================================================================ +<===> any/and_empty/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "|*")} + +<===> any/and_empty/output.css +a { + b: |c; +} + +<===> +================================================================================ +<===> any/and_default/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "*")} + +<===> any/and_default/output.css +a { + b: c; +} + +<===> +================================================================================ +<===> any/and_any/input.scss +@use "sass:selector"; +a {b: selector.unify("*|c", "*|*")} + +<===> any/and_any/output.css +a { + b: *|c; +} diff --git a/spec/core_functions/selector/unify/simple/universal.hrx b/spec/core_functions/selector/unify/simple/universal.hrx index c4098a3e92..2328f75922 100644 --- a/spec/core_functions/selector/unify/simple/universal.hrx +++ b/spec/core_functions/selector/unify/simple/universal.hrx @@ -1,5 +1,7 @@ <===> and_type/default/and_explicit/input.scss -a {b: inspect(selector-unify("*", "c|d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*", "c|d"))} <===> and_type/default/and_explicit/output.css a { @@ -9,7 +11,9 @@ a { <===> ================================================================================ <===> and_type/default/and_empty/input.scss -a {b: inspect(selector-unify("*", "|c"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*", "|c"))} <===> and_type/default/and_empty/output.css a { @@ -19,7 +23,8 @@ a { <===> ================================================================================ <===> and_type/default/and_default/input.scss -a {b: selector-unify("*", "c")} +@use "sass:selector"; +a {b: selector.unify("*", "c")} <===> and_type/default/and_default/output.css a { @@ -29,7 +34,8 @@ a { <===> ================================================================================ <===> and_type/default/and_any/input.scss -a {b: selector-unify("*", "*|c")} +@use "sass:selector"; +a {b: selector.unify("*", "*|c")} <===> and_type/default/and_any/output.css a { @@ -39,7 +45,8 @@ a { <===> ================================================================================ <===> and_type/explicit/and_explicit/same/input.scss -a {b: selector-unify("c|*", "c|d")} +@use "sass:selector"; +a {b: selector.unify("c|*", "c|d")} <===> and_type/explicit/and_explicit/same/output.css a { @@ -49,7 +56,9 @@ a { <===> ================================================================================ <===> and_type/explicit/and_explicit/different/input.scss -a {b: inspect(selector-unify("c|*", "d|e"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|*", "d|e"))} <===> and_type/explicit/and_explicit/different/output.css a { @@ -59,7 +68,9 @@ a { <===> ================================================================================ <===> and_type/explicit/and_empty/input.scss -a {b: inspect(selector-unify("c|*", "|d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|*", "|d"))} <===> and_type/explicit/and_empty/output.css a { @@ -69,7 +80,9 @@ a { <===> ================================================================================ <===> and_type/explicit/and_default/input.scss -a {b: inspect(selector-unify("c|*", "d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|*", "d"))} <===> and_type/explicit/and_default/output.css a { @@ -79,7 +92,8 @@ a { <===> ================================================================================ <===> and_type/explicit/and_any/input.scss -a {b: selector-unify("c|*", "*|d")} +@use "sass:selector"; +a {b: selector.unify("c|*", "*|d")} <===> and_type/explicit/and_any/output.css a { @@ -89,7 +103,9 @@ a { <===> ================================================================================ <===> and_type/empty/and_explicit/input.scss -a {b: inspect(selector-unify("|*", "c|d"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|*", "c|d"))} <===> and_type/empty/and_explicit/output.css a { @@ -99,7 +115,8 @@ a { <===> ================================================================================ <===> and_type/empty/and_empty/input.scss -a {b: selector-unify("|*", "|c")} +@use "sass:selector"; +a {b: selector.unify("|*", "|c")} <===> and_type/empty/and_empty/output.css a { @@ -109,7 +126,9 @@ a { <===> ================================================================================ <===> and_type/empty/and_default/input.scss -a {b: inspect(selector-unify("|*", "c"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|*", "c"))} <===> and_type/empty/and_default/output.css a { @@ -119,7 +138,8 @@ a { <===> ================================================================================ <===> and_type/empty/and_any/input.scss -a {b: selector-unify("|*", "*|c")} +@use "sass:selector"; +a {b: selector.unify("|*", "*|c")} <===> and_type/empty/and_any/output.css a { @@ -129,7 +149,8 @@ a { <===> ================================================================================ <===> and_type/any/and_explicit/input.scss -a {b: selector-unify("*|*", "c|d")} +@use "sass:selector"; +a {b: selector.unify("*|*", "c|d")} <===> and_type/any/and_explicit/output.css a { @@ -139,7 +160,8 @@ a { <===> ================================================================================ <===> and_type/any/and_empty/input.scss -a {b: selector-unify("*|*", "|c")} +@use "sass:selector"; +a {b: selector.unify("*|*", "|c")} <===> and_type/any/and_empty/output.css a { @@ -149,7 +171,8 @@ a { <===> ================================================================================ <===> and_type/any/and_default/input.scss -a {b: selector-unify("*|*", "c")} +@use "sass:selector"; +a {b: selector.unify("*|*", "c")} <===> and_type/any/and_default/output.css a { @@ -159,7 +182,8 @@ a { <===> ================================================================================ <===> and_type/any/and_any/input.scss -a {b: selector-unify("*|*", "*|c")} +@use "sass:selector"; +a {b: selector.unify("*|*", "*|c")} <===> and_type/any/and_any/output.css a { @@ -169,7 +193,9 @@ a { <===> ================================================================================ <===> and_universal/default/and_explicit/input.scss -a {b: inspect(selector-unify("*", "e|*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*", "e|*"))} <===> and_universal/default/and_explicit/output.css a { @@ -179,7 +205,9 @@ a { <===> ================================================================================ <===> and_universal/default/and_empty/input.scss -a {b: inspect(selector-unify("*", "|*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("*", "|*"))} <===> and_universal/default/and_empty/output.css a { @@ -189,7 +217,8 @@ a { <===> ================================================================================ <===> and_universal/default/and_default/input.scss -a {b: selector-unify("*", "*")} +@use "sass:selector"; +a {b: selector.unify("*", "*")} <===> and_universal/default/and_default/output.css a { @@ -199,7 +228,8 @@ a { <===> ================================================================================ <===> and_universal/default/and_any/input.scss -a {b: selector-unify("*", "*|*")} +@use "sass:selector"; +a {b: selector.unify("*", "*|*")} <===> and_universal/default/and_any/output.css a { @@ -209,7 +239,8 @@ a { <===> ================================================================================ <===> and_universal/explicit/and_explicit/input.scss -a {b: selector-unify("c|*", "c|*")} +@use "sass:selector"; +a {b: selector.unify("c|*", "c|*")} <===> and_universal/explicit/and_explicit/output.css a { @@ -219,7 +250,9 @@ a { <===> ================================================================================ <===> and_universal/explicit/and_empty/input.scss -a {b: inspect(selector-unify("c|*", "|*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|*", "|*"))} <===> and_universal/explicit/and_empty/output.css a { @@ -229,7 +262,9 @@ a { <===> ================================================================================ <===> and_universal/explicit/and_default/input.scss -a {b: inspect(selector-unify("c|*", "*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("c|*", "*"))} <===> and_universal/explicit/and_default/output.css a { @@ -239,7 +274,8 @@ a { <===> ================================================================================ <===> and_universal/explicit/and_any/input.scss -a {b: selector-unify("c|*", "*|*")} +@use "sass:selector"; +a {b: selector.unify("c|*", "*|*")} <===> and_universal/explicit/and_any/output.css a { @@ -249,7 +285,9 @@ a { <===> ================================================================================ <===> and_universal/empty/and_explicit/input.scss -a {b: inspect(selector-unify("|*", "e|*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|*", "e|*"))} <===> and_universal/empty/and_explicit/output.css a { @@ -259,7 +297,8 @@ a { <===> ================================================================================ <===> and_universal/empty/and_empty/input.scss -a {b: selector-unify("|*", "|*")} +@use "sass:selector"; +a {b: selector.unify("|*", "|*")} <===> and_universal/empty/and_empty/output.css a { @@ -269,7 +308,9 @@ a { <===> ================================================================================ <===> and_universal/empty/and_default/input.scss -a {b: inspect(selector-unify("|*", "*"))} +@use "sass:meta"; +@use "sass:selector"; +a {b: meta.inspect(selector.unify("|*", "*"))} <===> and_universal/empty/and_default/output.css a { @@ -279,7 +320,8 @@ a { <===> ================================================================================ <===> and_universal/empty/and_any/input.scss -a {b: selector-unify("|*", "*|*")} +@use "sass:selector"; +a {b: selector.unify("|*", "*|*")} <===> and_universal/empty/and_any/output.css a { @@ -289,7 +331,8 @@ a { <===> ================================================================================ <===> and_universal/any/and_explicit/input.scss -a {b: selector-unify("*|*", "c|*")} +@use "sass:selector"; +a {b: selector.unify("*|*", "c|*")} <===> and_universal/any/and_explicit/output.css a { @@ -299,7 +342,8 @@ a { <===> ================================================================================ <===> and_universal/any/and_empty/input.scss -a {b: selector-unify("*|*", "|*")} +@use "sass:selector"; +a {b: selector.unify("*|*", "|*")} <===> and_universal/any/and_empty/output.css a { @@ -309,7 +353,8 @@ a { <===> ================================================================================ <===> and_universal/any/and_default/input.scss -a {b: selector-unify("*|*", "*")} +@use "sass:selector"; +a {b: selector.unify("*|*", "*")} <===> and_universal/any/and_default/output.css a { @@ -319,7 +364,8 @@ a { <===> ================================================================================ <===> and_universal/any/and_any/input.scss -a {b: selector-unify("*|*", "*|*")} +@use "sass:selector"; +a {b: selector.unify("*|*", "*|*")} <===> and_universal/any/and_any/output.css a { diff --git a/spec/core_functions/string/index.hrx b/spec/core_functions/string/index.hrx index 0bfe917fb6..dfc031bb02 100644 --- a/spec/core_functions/string/index.hrx +++ b/spec/core_functions/string/index.hrx @@ -1,5 +1,6 @@ <===> both_empty/input.scss -a {b: str-index("", "")} +@use "sass:string"; +a {b: string.index("", "")} <===> both_empty/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> empty_substring/input.scss -a {b: str-index("cde", "")} +@use "sass:string"; +a {b: string.index("cde", "")} <===> empty_substring/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> beginning/input.scss -a {b: str-index("cde", "c")} +@use "sass:string"; +a {b: string.index("cde", "c")} <===> beginning/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> middle/input.scss -a {b: str-index("cde", "d")} +@use "sass:string"; +a {b: string.index("cde", "d")} <===> middle/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> end/input.scss -a {b: str-index("cde", "e")} +@use "sass:string"; +a {b: string.index("cde", "e")} <===> end/output.css a { @@ -49,7 +54,9 @@ a { <===> ================================================================================ <===> not_found/input.scss -a {b: inspect(str-index("cde", "f"))} +@use "sass:meta"; +@use "sass:string"; +a {b: meta.inspect(string.index("cde", "f"))} <===> not_found/output.css a { @@ -59,9 +66,10 @@ a { <===> ================================================================================ <===> double_width_character/input.scss +@use "sass:string"; // Sass treats strings as sequences of Unicode codepoint; it doesn't care if a // character is represented as two UTF-16 code units. -a {b: str-index("👭a", "a")} +a {b: string.index("👭a", "a")} <===> double_width_character/output.css a { @@ -71,10 +79,11 @@ a { <===> ================================================================================ <===> combining_character/input.scss +@use "sass:string"; // Sass does *not* treat strings as sequences of glyphs, so this string which // contains "c" followed by a combining umlaut should be considered two separate // characters even though it's rendered as only one. -a {b: str-index("c\0308 a", "a")} +a {b: string.index("c\0308 a", "a")} <===> combining_character/output.css a { @@ -84,69 +93,88 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: str-index($string: "cde", $substring: "c")} +@use "sass:string"; +a {b: string.index($string: "cde", $substring: "c")} <===> named/output.css a { b: 1; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:string"; +a {b: string.str-index("c", "c")} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: string.str-index("c", "c")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/string/input.scss -a {b: str-index(1, "c")} +@use "sass:string"; +a {b: string.index(1, "c")} <===> error/type/string/error Error: $string: 1 is not a string. , -1 | a {b: str-index(1, "c")} - | ^^^^^^^^^^^^^^^^^ +2 | a {b: string.index(1, "c")} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/substring/input.scss -a {b: str-index("c", 1)} +@use "sass:string"; +a {b: string.index("c", 1)} <===> error/type/substring/error Error: $substring: 1 is not a string. , -1 | a {b: str-index("c", 1)} - | ^^^^^^^^^^^^^^^^^ +2 | a {b: string.index("c", 1)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: str-index("c")} +@use "sass:string"; +a {b: string.index("c")} <===> error/too_few_args/error Error: Missing argument $substring. ,--> input.scss -1 | a {b: str-index("c")} - | ^^^^^^^^^^^^^^ invocation +2 | a {b: string.index("c")} + | ^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function index($string, $substring) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: str-index("c", "d", "e")} +@use "sass:string"; +a {b: string.index("c", "d", "e")} <===> error/too_many_args/error Error: Only 2 arguments allowed, but 3 were passed. ,--> input.scss -1 | a {b: str-index("c", "d", "e")} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.index("c", "d", "e")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function index($string, $substring) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/insert.hrx b/spec/core_functions/string/insert.hrx index d1a5096917..e7f5e2baf0 100644 --- a/spec/core_functions/string/insert.hrx +++ b/spec/core_functions/string/insert.hrx @@ -1,5 +1,6 @@ <===> empty_destination/empty_source/input.scss -a {b: str-insert("", "", 1)} +@use "sass:string"; +a {b: string.insert("", "", 1)} <===> empty_destination/empty_source/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> empty_destination/index_0/input.scss -a {b: str-insert("", "c", 0)} +@use "sass:string"; +a {b: string.insert("", "c", 0)} <===> empty_destination/index_0/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> empty_destination/index_1/input.scss -a {b: str-insert("", "c", 1)} +@use "sass:string"; +a {b: string.insert("", "c", 1)} <===> empty_destination/index_1/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> empty_destination/index_2/input.scss -a {b: str-insert("", "c", 2)} +@use "sass:string"; +a {b: string.insert("", "c", 2)} <===> empty_destination/index_2/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> empty_destination/index_negative_1/input.scss -a {b: str-insert("", "c", -1)} +@use "sass:string"; +a {b: string.insert("", "c", -1)} <===> empty_destination/index_negative_1/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> empty_insertion/input.scss -a {b: str-insert("cde", "", 1)} +@use "sass:string"; +a {b: string.insert("cde", "", 1)} <===> empty_insertion/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> index/positive/0/input.scss -a {b: str-insert("cde", "f", 0)} +@use "sass:string"; +a {b: string.insert("cde", "f", 0)} <===> index/positive/0/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> index/positive/1/input.scss -a {b: str-insert("cde", "f", 1)} +@use "sass:string"; +a {b: string.insert("cde", "f", 1)} <===> index/positive/1/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> index/positive/2/input.scss -a {b: str-insert("cde", "f", 2)} +@use "sass:string"; +a {b: string.insert("cde", "f", 2)} <===> index/positive/2/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> index/positive/last/input.scss -a {b: str-insert("cde", "f", 4)} +@use "sass:string"; +a {b: string.insert("cde", "f", 4)} <===> index/positive/last/output.css a { @@ -99,7 +109,8 @@ a { <===> ================================================================================ <===> index/positive/after_last/input.scss -a {b: str-insert("cde", "f", 100)} +@use "sass:string"; +a {b: string.insert("cde", "f", 100)} <===> index/positive/after_last/output.css a { @@ -109,7 +120,8 @@ a { <===> ================================================================================ <===> index/negative/1/input.scss -a {b: str-insert("cde", "f", -1)} +@use "sass:string"; +a {b: string.insert("cde", "f", -1)} <===> index/negative/1/output.css a { @@ -119,7 +131,8 @@ a { <===> ================================================================================ <===> index/negative/2/input.scss -a {b: str-insert("cde", "f", -2)} +@use "sass:string"; +a {b: string.insert("cde", "f", -2)} <===> index/negative/2/output.css a { @@ -129,7 +142,8 @@ a { <===> ================================================================================ <===> index/negative/last/input.scss -a {b: str-insert("cde", "f", -4)} +@use "sass:string"; +a {b: string.insert("cde", "f", -4)} <===> index/negative/last/output.css a { @@ -139,8 +153,9 @@ a { <===> ================================================================================ <===> index/negative/after_last/less_than_double/input.scss +@use "sass:string"; // Regression test for sass/dart-sass#1568 -a {b: str-insert("cdefghijkl", "mno", -15)} +a {b: string.insert("cdefghijkl", "mno", -15)} <===> index/negative/after_last/less_than_double/output.css a { @@ -150,7 +165,8 @@ a { <===> ================================================================================ <===> index/negative/after_last/more_than_double/input.scss -a {b: str-insert("cde", "f", -100)} +@use "sass:string"; +a {b: string.insert("cde", "f", -100)} <===> index/negative/after_last/more_than_double/output.css a { @@ -160,10 +176,11 @@ a { <===> ================================================================================ <===> double_width_character/input.scss +@use "sass:string"; // Sass treats strings as sequences of Unicode codepoint; it doesn't care if a // character is represented as two UTF-16 code units, so inserting a character // at index 2 shouldn't break this emoji in two. -a {b: str-insert("👭", "c", 2)} +a {b: string.insert("👭", "c", 2)} <===> double_width_character/output.css @charset "UTF-8"; @@ -174,11 +191,12 @@ a { <===> ================================================================================ <===> combining_character/input.scss +@use "sass:string"; // Sass does *not* treat strings as sequences of glyphs, so this string which // contains "c" followed by a combining umlaut should be considered two separate // characters even though it's rendered as only one and the "d" should be // injected between the two. -a {b: str-insert("c\0308", "d", 2)} +a {b: string.insert("c\0308", "d", 2)} <===> combining_character/output.css @charset "UTF-8"; @@ -189,95 +207,117 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: str-insert($string: "cde", $insert: "f", $index: 2)} +@use "sass:string"; +a {b: string.insert($string: "cde", $insert: "f", $index: 2)} <===> named/output.css a { b: "cfde"; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:string"; +a {b: string.str-insert("c", 1, "d")} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: string.str-insert("c", 1, "d")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + + <===> ================================================================================ <===> error/type/string/input.scss -a {b: str-insert(1, "", 1)} +@use "sass:string"; +a {b: string.insert(1, "", 1)} <===> error/type/string/error Error: $string: 1 is not a string. , -1 | a {b: str-insert(1, "", 1)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.insert(1, "", 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/insert/input.scss -a {b: str-insert("", 1, 1)} +@use "sass:string"; +a {b: string.insert("", 1, 1)} <===> error/type/insert/error Error: $insert: 1 is not a string. , -1 | a {b: str-insert("", 1, 1)} - | ^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.insert("", 1, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/type/index/input.scss -a {b: str-insert("", "", "")} +@use "sass:string"; +a {b: string.insert("", "", "")} <===> error/type/index/error Error: $index: "" is not a number. , -1 | a {b: str-insert("", "", "")} - | ^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.insert("", "", "")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/decimal/input.scss -a {b: str-insert("", "", 0.5)} +@use "sass:string"; +a {b: string.insert("", "", 0.5)} <===> error/decimal/error Error: $index: 0.5 is not an int. , -1 | a {b: str-insert("", "", 0.5)} - | ^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.insert("", "", 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: str-insert("", "")} +@use "sass:string"; +a {b: string.insert("", "")} <===> error/too_few_args/error Error: Missing argument $index. ,--> input.scss -1 | a {b: str-insert("", "")} - | ^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.insert("", "")} + | ^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function insert($string, $insert, $index) { | ================================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: str-insert("", "", 1, 2)} +@use "sass:string"; +a {b: string.insert("", "", 1, 2)} <===> error/too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: str-insert("", "", 1, 2)} - | ^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.insert("", "", 1, 2)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function insert($string, $insert, $index) { | ================================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/length.hrx b/spec/core_functions/string/length.hrx index d2ade67e90..8f295476da 100644 --- a/spec/core_functions/string/length.hrx +++ b/spec/core_functions/string/length.hrx @@ -1,5 +1,6 @@ <===> empty/input.scss -a {b: str-length("")} +@use "sass:string"; +a {b: string.length("")} <===> empty/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> one_character/input.scss -a {b: str-length("c")} +@use "sass:string"; +a {b: string.length("c")} <===> one_character/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> multiple_characters/input.scss -a {b: str-length("fblthp abatement")} +@use "sass:string"; +a {b: string.length("fblthp abatement")} <===> multiple_characters/output.css a { @@ -29,9 +32,10 @@ a { <===> ================================================================================ <===> private_use_character/input.scss +@use "sass:string"; // Dart Sass emits private-use characters as escapes in expanded mode, but it // should stil treat them as single characters for the purpose of functions. -a {b: str-length("\E000")} +a {b: string.length("\E000")} <===> private_use_character/output.css a { @@ -41,9 +45,10 @@ a { <===> ================================================================================ <===> double_width_character/input.scss +@use "sass:string"; // Sass treats strings as sequences of Unicode codepoint; it doesn't care if a // character is represented as two UTF-16 code units. -a {b: str-length("👭")} +a {b: string.length("👭")} <===> double_width_character/output.css a { @@ -53,10 +58,11 @@ a { <===> ================================================================================ <===> combining_character/input.scss +@use "sass:string"; // Sass does *not* treat strings as sequences of glyphs, so this string which // contains "c" followed by a combining umlaut should be considered two separate // characters even though it's rendered as only one. -a {b: str-length("c\0308")} +a {b: string.length("c\0308")} <===> combining_character/output.css a { @@ -66,7 +72,8 @@ a { <===> ================================================================================ <===> unquoted/input.scss -a {b: str-length(loofamonster)} +@use "sass:string"; +a {b: string.length(loofamonster)} <===> unquoted/output.css a { @@ -76,56 +83,74 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: str-length($string: "c")} +@use "sass:string"; +a {b: string.length($string: "c")} <===> named/output.css a { b: 1; } +<===> +================================================================================ +<===> error/wrong_name/input.scss +@use "sass:string"; +a {b: string.str-length("c")} + +<===> error/wrong_name/error +Error: Undefined function. + , +2 | a {b: string.str-length("c")} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss -a {b: str-length(1)} +@use "sass:string"; +a {b: string.length(1)} <===> error/type/error Error: $string: 1 is not a string. , -1 | a {b: str-length(1)} - | ^^^^^^^^^^^^^ +2 | a {b: string.length(1)} + | ^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: str-length()} +@use "sass:string"; +a {b: string.length()} <===> error/too_few_args/error Error: Missing argument $string. ,--> input.scss -1 | a {b: str-length()} - | ^^^^^^^^^^^^ invocation +2 | a {b: string.length()} + | ^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function length($string) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: str-length(c, d)} +@use "sass:string"; +a {b: string.length(c, d)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: str-length(c, d)} - | ^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.length(c, d)} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function length($string) { | =============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/quote.hrx b/spec/core_functions/string/quote.hrx index e9c0154c42..95276bf45e 100644 --- a/spec/core_functions/string/quote.hrx +++ b/spec/core_functions/string/quote.hrx @@ -1,5 +1,6 @@ <===> unquoted/input.scss -a {b: quote(c)} +@use "sass:string"; +a {b: string.quote(c)} <===> unquoted/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> quoted_double/input.scss -a {b: quote("c")} +@use "sass:string"; +a {b: string.quote("c")} <===> quoted_double/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> quoted_single/input.scss -a {b: quote('c')} +@use "sass:string"; +a {b: string.quote('c')} <===> quoted_single/output.css a { @@ -29,8 +32,9 @@ a { <===> ================================================================================ <===> quote_unquoted_quote/single/input.scss +@use "sass:string"; // See sass/libsass#2873 -a {b: quote(unquote('"'))} +a {b: string.quote(string.unquote('"'))} <===> quote_unquoted_quote/single/output.css a { @@ -40,8 +44,9 @@ a { <===> ================================================================================ <===> quote_unquoted_quote/double/input.scss +@use "sass:string"; // See sass/libsass#2873 -a {b: quote(unquote('"') + unquote("'"))} +a {b: string.quote(string.unquote('"') + string.unquote("'"))} <===> quote_unquoted_quote/double/output.css a { @@ -51,7 +56,8 @@ a { <===> ================================================================================ <===> escape/input.scss -a {b: quote(\0)} +@use "sass:string"; +a {b: string.quote(\0)} <===> escape/output.css a { @@ -61,7 +67,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: quote($string: c)} +@use "sass:string"; +a {b: string.quote($string: c)} <===> named/output.css a { @@ -71,46 +78,49 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: quote((1, 2, 3))} +@use "sass:string"; +a {b: string.quote((1, 2, 3))} <===> error/type/error Error: $string: 1, 2, 3 is not a string. , -1 | a {b: quote((1, 2, 3))} - | ^^^^^^^^^^^^^^^^ +2 | a {b: string.quote((1, 2, 3))} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: quote()} +@use "sass:string"; +a {b: string.quote()} <===> error/too_few_args/error Error: Missing argument $string. ,--> input.scss -1 | a {b: quote()} - | ^^^^^^^ invocation +2 | a {b: string.quote()} + | ^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function quote($string) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: quote(c, d)} +@use "sass:string"; +a {b: string.quote(c, d)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: quote(c, d)} - | ^^^^^^^^^^^ invocation +2 | a {b: string.quote(c, d)} + | ^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function quote($string) { | ============== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/slice/combining_character.hrx b/spec/core_functions/string/slice/combining_character.hrx index 9a28c67249..d3432dae85 100644 --- a/spec/core_functions/string/slice/combining_character.hrx +++ b/spec/core_functions/string/slice/combining_character.hrx @@ -1,9 +1,10 @@ <===> input.scss +@use "sass:string"; // Sass does *not* treat strings as sequences of glyphs, so this string which // contains "c" followed by a combining umlaut should be considered two separate // characters even though it's rendered as only one and only the "d" should be // sliced out. -a {b: str-slice("cd\0308e", 2, 2)} +a {b: string.slice("cd\0308e", 2, 2)} <===> output.css a { diff --git a/spec/core_functions/string/slice/double_width_character.hrx b/spec/core_functions/string/slice/double_width_character.hrx index 1da208faf0..dcfe7e55de 100644 --- a/spec/core_functions/string/slice/double_width_character.hrx +++ b/spec/core_functions/string/slice/double_width_character.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; // Sass treats strings as sequences of Unicode codepoint; it doesn't care if a // character is represented as two UTF-16 code units, so inserting a character // at index 2 shouldn't break this emoji in two. -a {b: str-slice("c👭d", 2, 2)} +a {b: string.slice("c👭d", 2, 2)} <===> output.css @charset "UTF-8"; diff --git a/spec/core_functions/string/slice/empty.hrx b/spec/core_functions/string/slice/empty.hrx index bc3a26c506..f0225ccd7c 100644 --- a/spec/core_functions/string/slice/empty.hrx +++ b/spec/core_functions/string/slice/empty.hrx @@ -1,5 +1,6 @@ <===> start/0/input.scss -a {b: str-slice("", 0)} +@use "sass:string"; +a {b: string.slice("", 0)} <===> start/0/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> start/1/input.scss -a {b: str-slice("", 1)} +@use "sass:string"; +a {b: string.slice("", 1)} <===> start/1/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> start/2/input.scss -a {b: str-slice("", 2)} +@use "sass:string"; +a {b: string.slice("", 2)} <===> start/2/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> start/negative_1/input.scss -a {b: str-slice("", -1)} +@use "sass:string"; +a {b: string.slice("", -1)} <===> start/negative_1/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> end/0/input.scss -a {b: str-slice("", 1, 0)} +@use "sass:string"; +a {b: string.slice("", 1, 0)} <===> end/0/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> end/1/input.scss -a {b: str-slice("", 1, 1)} +@use "sass:string"; +a {b: string.slice("", 1, 1)} <===> end/1/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> end/2/input.scss -a {b: str-slice("", 1, 2)} +@use "sass:string"; +a {b: string.slice("", 1, 2)} <===> end/2/output.css a { diff --git a/spec/core_functions/string/slice/end.hrx b/spec/core_functions/string/slice/end.hrx index f328ad88cf..37556626a6 100644 --- a/spec/core_functions/string/slice/end.hrx +++ b/spec/core_functions/string/slice/end.hrx @@ -1,5 +1,6 @@ <===> positive/0/input.scss -a {b: str-slice("cde", 1, 0)} +@use "sass:string"; +a {b: string.slice("cde", 1, 0)} <===> positive/0/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> positive/1/input.scss -a {b: str-slice("cde", 1, 1)} +@use "sass:string"; +a {b: string.slice("cde", 1, 1)} <===> positive/1/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> positive/2/input.scss -a {b: str-slice("cde", 1, 2)} +@use "sass:string"; +a {b: string.slice("cde", 1, 2)} <===> positive/2/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> positive/last/input.scss -a {b: str-slice("cde", 1, 3)} +@use "sass:string"; +a {b: string.slice("cde", 1, 3)} <===> positive/last/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> positive/after_last/input.scss -a {b: str-slice("cde", 1, 100)} +@use "sass:string"; +a {b: string.slice("cde", 1, 100)} <===> positive/after_last/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> positive/after_start/input.scss -a {b: str-slice("cdef", 2, 3)} +@use "sass:string"; +a {b: string.slice("cdef", 2, 3)} <===> positive/after_start/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> negative/1/input.scss -a {b: str-slice("cde", 1, -1)} +@use "sass:string"; +a {b: string.slice("cde", 1, -1)} <===> negative/1/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> negative/2/input.scss -a {b: str-slice("cde", 1, -2)} +@use "sass:string"; +a {b: string.slice("cde", 1, -2)} <===> negative/2/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> negative/last/input.scss -a {b: str-slice("cde", 1, -4)} +@use "sass:string"; +a {b: string.slice("cde", 1, -4)} <===> negative/last/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> negative/after_last/input.scss -a {b: str-slice("cde", 1, -100)} +@use "sass:string"; +a {b: string.slice("cde", 1, -100)} <===> negative/after_last/output.css a { diff --git a/spec/core_functions/string/slice/error.hrx b/spec/core_functions/string/slice/error.hrx index 6c298a176e..03a71c5599 100644 --- a/spec/core_functions/string/slice/error.hrx +++ b/spec/core_functions/string/slice/error.hrx @@ -1,122 +1,145 @@ <===> type/string/input.scss -a {b: str-slice(1, 2)} +@use "sass:string"; +a {b: string.slice(1, 2)} <===> type/string/error Error: $string: 1 is not a string. , -1 | a {b: str-slice(1, 2)} - | ^^^^^^^^^^^^^^^ +2 | a {b: string.slice(1, 2)} + | ^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> type/start_at/input.scss -a {b: str-slice("cde", "f")} +@use "sass:string"; +a {b: string.slice("cde", "f")} <===> type/start_at/error Error: $start-at: "f" is not a number. , -1 | a {b: str-slice("cde", "f")} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("cde", "f")} + | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> type/end_at/input.scss -a {b: str-slice("cde", 1, "f")} +@use "sass:string"; +a {b: string.slice("cde", 1, "f")} <===> type/end_at/error Error: $end-at: "f" is not a number. , -1 | a {b: str-slice("cde", 1, "f")} - | ^^^^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("cde", 1, "f")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> decimal/start/input.scss -a {b: str-slice("", 0.5)} +@use "sass:string"; +a {b: string.slice("", 0.5)} <===> decimal/start/error Error: 0.5 is not an int. , -1 | a {b: str-slice("", 0.5)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("", 0.5)} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> decimal/end/input.scss -a {b: str-slice("", 1, 1.5)} +@use "sass:string"; +a {b: string.slice("", 1, 1.5)} <===> decimal/end/error Error: 1.5 is not an int. , -1 | a {b: str-slice("", 1, 1.5)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("", 1, 1.5)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unit/start/input.scss -a {b: str-slice("", 1px)} +@use "sass:string"; +a {b: string.slice("", 1px)} <===> unit/start/error Error: $start-at: Expected 1px to have no units. , -1 | a {b: str-slice("", 1px)} - | ^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("", 1px)} + | ^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unit/end/input.scss -a {b: str-slice("", 1, 2px)} +@use "sass:string"; +a {b: string.slice("", 1, 2px)} <===> unit/end/error Error: $end-at: Expected 2px to have no units. , -1 | a {b: str-slice("", 1, 2px)} - | ^^^^^^^^^^^^^^^^^^^^^ +2 | a {b: string.slice("", 1, 2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> wrong_name/input.scss +@use "sass:string"; +a {b: string.str-slice("c", 1, 1)} + +<===> wrong_name/error +Error: Undefined function. + , +2 | a {b: string.str-slice("c", 1, 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_few_args/input.scss -a {b: str-slice("cde")} +@use "sass:string"; +a {b: string.slice("cde")} <===> too_few_args/error Error: Missing argument $start-at. ,--> input.scss -1 | a {b: str-slice("cde")} - | ^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.slice("cde")} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function slice($string, $start-at, $end-at: -1) { | ====================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many_args/input.scss -a {b: str-slice("cde", 1, 2, 3)} +@use "sass:string"; +a {b: string.slice("cde", 1, 2, 3)} <===> too_many_args/error Error: Only 3 arguments allowed, but 4 were passed. ,--> input.scss -1 | a {b: str-slice("cde", 1, 2, 3)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.slice("cde", 1, 2, 3)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function slice($string, $start-at, $end-at: -1) { | ====================================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/slice/named.hrx b/spec/core_functions/string/slice/named.hrx index 6296ed8f52..0ad8645420 100644 --- a/spec/core_functions/string/slice/named.hrx +++ b/spec/core_functions/string/slice/named.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: str-slice($string: "cde", $start-at: 2, $end-at: 2)} +@use "sass:string"; +a {b: string.slice($string: "cde", $start-at: 2, $end-at: 2)} <===> output.css a { diff --git a/spec/core_functions/string/slice/start.hrx b/spec/core_functions/string/slice/start.hrx index 8409dae328..8749d04a9f 100644 --- a/spec/core_functions/string/slice/start.hrx +++ b/spec/core_functions/string/slice/start.hrx @@ -1,5 +1,6 @@ <===> positive/0/input.scss -a {b: str-slice("cde", 0)} +@use "sass:string"; +a {b: string.slice("cde", 0)} <===> positive/0/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> positive/1/input.scss -a {b: str-slice("cde", 1)} +@use "sass:string"; +a {b: string.slice("cde", 1)} <===> positive/1/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> positive/2/input.scss -a {b: str-slice("cde", 2)} +@use "sass:string"; +a {b: string.slice("cde", 2)} <===> positive/2/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> positive/last/input.scss -a {b: str-slice("cde", 4)} +@use "sass:string"; +a {b: string.slice("cde", 4)} <===> positive/last/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> positive/after_last/input.scss -a {b: str-slice("cde", 100)} +@use "sass:string"; +a {b: string.slice("cde", 100)} <===> positive/after_last/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> positive/after_end/input.scss -a {b: str-slice("cdef", 3, 2)} +@use "sass:string"; +a {b: string.slice("cdef", 3, 2)} <===> positive/after_end/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> negative/1/input.scss -a {b: str-slice("cde", -1)} +@use "sass:string"; +a {b: string.slice("cde", -1)} <===> negative/1/output.css a { @@ -69,7 +76,8 @@ a { <===> ================================================================================ <===> negative/2/input.scss -a {b: str-slice("cde", -2)} +@use "sass:string"; +a {b: string.slice("cde", -2)} <===> negative/2/output.css a { @@ -79,7 +87,8 @@ a { <===> ================================================================================ <===> negative/last/input.scss -a {b: str-slice("cde", -3)} +@use "sass:string"; +a {b: string.slice("cde", -3)} <===> negative/last/output.css a { @@ -89,7 +98,8 @@ a { <===> ================================================================================ <===> negative/after_last/input.scss -a {b: str-slice("cde", -100)} +@use "sass:string"; +a {b: string.slice("cde", -100)} <===> negative/after_last/output.css a { diff --git a/spec/core_functions/string/slice/unquoted.hrx b/spec/core_functions/string/slice/unquoted.hrx index 132b81df2d..1e50acbc4a 100644 --- a/spec/core_functions/string/slice/unquoted.hrx +++ b/spec/core_functions/string/slice/unquoted.hrx @@ -1,5 +1,6 @@ <===> input.scss -a {b: str-slice(cdefgh, 3, 5)} +@use "sass:string"; +a {b: string.slice(cdefgh, 3, 5)} <===> output.css a { diff --git a/spec/core_functions/string/split.hrx b/spec/core_functions/string/split.hrx index 1d1958e232..e114c88e8e 100644 --- a/spec/core_functions/string/split.hrx +++ b/spec/core_functions/string/split.hrx @@ -10,11 +10,13 @@ a { <===> ================================================================================ <===> empty/input.scss +@use "sass:list"; +@use "sass:meta"; @use "sass:string"; $result: string.split("", "/"); a { - value: inspect($result); - separator: list-separator($result); + value: meta.inspect($result); + separator: list.separator($result); } <===> empty/output.css @@ -26,11 +28,13 @@ a { <===> ================================================================================ <===> single/input.scss +@use "sass:list"; +@use "sass:meta"; @use "sass:string"; $result: string.split("a", ""); a { - value: inspect($result); - separator: list-separator($result); + value: meta.inspect($result); + separator: list.separator($result); } <===> single/output.css diff --git a/spec/core_functions/string/to_lower_case.hrx b/spec/core_functions/string/to_lower_case.hrx index 263d690ef4..221a099246 100644 --- a/spec/core_functions/string/to_lower_case.hrx +++ b/spec/core_functions/string/to_lower_case.hrx @@ -1,5 +1,6 @@ <===> empty/input.scss -a {b: to-lower-case("")} +@use "sass:string"; +a {b: string.to-lower-case("")} <===> empty/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> alphabet/input.scss -a {b: to-lower-case("ABCDEFGHIJKLMNOPQRSTUVQXYZ")} +@use "sass:string"; +a {b: string.to-lower-case("ABCDEFGHIJKLMNOPQRSTUVQXYZ")} <===> alphabet/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> number/input.scss -a {b: to-lower-case("1234567890")} +@use "sass:string"; +a {b: string.to-lower-case("1234567890")} <===> number/output.css a { @@ -29,8 +32,9 @@ a { <===> ================================================================================ <===> non_ascii/input.scss +@use "sass:string"; // Only ASCII characters have their case changed. -a {b: to-lower-case("ÄÇÐØÞ")} +a {b: string.to-lower-case("ÄÇÐØÞ")} <===> non_ascii/output.css @charset "UTF-8"; @@ -41,7 +45,8 @@ a { <===> ================================================================================ <===> unquoted/input.scss -a {b: to-lower-case(aBcDeF)} +@use "sass:string"; +a {b: string.to-lower-case(aBcDeF)} <===> unquoted/output.css a { @@ -51,7 +56,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: to-lower-case($string: abcDEF)} +@use "sass:string"; +a {b: string.to-lower-case($string: abcDEF)} <===> named/output.css a { @@ -61,47 +67,50 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: to-lower-case(1)} +@use "sass:string"; +a {b: string.to-lower-case(1)} <===> error/type/error Error: $string: 1 is not a string. , -1 | a {b: to-lower-case(1)} - | ^^^^^^^^^^^^^^^^ +2 | a {b: string.to-lower-case(1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: to-lower-case()} +@use "sass:string"; +a {b: string.to-lower-case()} <===> error/too_few_args/error Error: Missing argument $string. ,--> input.scss -1 | a {b: to-lower-case()} - | ^^^^^^^^^^^^^^^ invocation +2 | a {b: string.to-lower-case()} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function to-lower-case($string) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: to-lower-case("", "")} +@use "sass:string"; +a {b: string.to-lower-case("", "")} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: to-lower-case("", "")} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.to-lower-case("", "")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function to-lower-case($string) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/to_upper_case.hrx b/spec/core_functions/string/to_upper_case.hrx index 3c5fea09db..f25cb90d44 100644 --- a/spec/core_functions/string/to_upper_case.hrx +++ b/spec/core_functions/string/to_upper_case.hrx @@ -1,5 +1,6 @@ <===> empty/input.scss -a {b: to-upper-case("")} +@use "sass:string"; +a {b: string.to-upper-case("")} <===> empty/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> alphabet/input.scss -a {b: to-upper-case("abcdefghijklmnopqrstuvqxyz")} +@use "sass:string"; +a {b: string.to-upper-case("abcdefghijklmnopqrstuvqxyz")} <===> alphabet/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> number/input.scss -a {b: to-upper-case("1234567890")} +@use "sass:string"; +a {b: string.to-upper-case("1234567890")} <===> number/output.css a { @@ -29,8 +32,9 @@ a { <===> ================================================================================ <===> non_ascii/input.scss +@use "sass:string"; // Only ASCII characters have their case changed. -a {b: to-upper-case("äçðøþ")} +a {b: string.to-upper-case("äçðøþ")} <===> non_ascii/output.css @charset "UTF-8"; @@ -41,7 +45,8 @@ a { <===> ================================================================================ <===> unquoted/input.scss -a {b: to-upper-case(aBcDeF)} +@use "sass:string"; +a {b: string.to-upper-case(aBcDeF)} <===> unquoted/output.css a { @@ -51,7 +56,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: to-upper-case($string: abcDEF)} +@use "sass:string"; +a {b: string.to-upper-case($string: abcDEF)} <===> named/output.css a { @@ -61,47 +67,50 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: to-upper-case(1)} +@use "sass:string"; +a {b: string.to-upper-case(1)} <===> error/type/error Error: $string: 1 is not a string. , -1 | a {b: to-upper-case(1)} - | ^^^^^^^^^^^^^^^^ +2 | a {b: string.to-upper-case(1)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: to-upper-case()} +@use "sass:string"; +a {b: string.to-upper-case()} <===> error/too_few_args/error Error: Missing argument $string. ,--> input.scss -1 | a {b: to-upper-case()} - | ^^^^^^^^^^^^^^^ invocation +2 | a {b: string.to-upper-case()} + | ^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function to-upper-case($string) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: to-upper-case("", "")} +@use "sass:string"; +a {b: string.to-upper-case("", "")} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: to-upper-case("", "")} - | ^^^^^^^^^^^^^^^^^^^^^ invocation +2 | a {b: string.to-upper-case("", "")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function to-upper-case($string) { | ====================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/unique_id.hrx b/spec/core_functions/string/unique_id.hrx index 4ccbca6c17..8b81fd0074 100644 --- a/spec/core_functions/string/unique_id.hrx +++ b/spec/core_functions/string/unique_id.hrx @@ -1,14 +1,16 @@ <===> is_unique/input.scss +@use "sass:map"; +@use "sass:string"; // As the name suggests, every call to unique-id() should return a different // value. $ids: (); @for $i from 1 to 1000 { - $id: unique-id(); - @if map-has-key($ids, $id) { + $id: string.unique-id(); + @if map.has-key($ids, $id) { @error "#{$id} generated more than once"; } - $ids: map-merge($ids, ($id: null)); + $ids: map.merge($ids, ($id: null)); } <===> is_unique/output.css @@ -16,11 +18,13 @@ $ids: (); <===> ================================================================================ <===> is_identifier/input.scss +@use "sass:selector"; +@use "sass:string"; // Every call to unique-id() should return a valid CSS identifier. We can't test // this directly, so we make sure it can parse as a class selector with // selector-parse(). @for $i from 1 to 1000 { - $_: selector-parse(".#{unique-id()}"); + $_: selector.parse(".#{string.unique-id()}"); } <===> is_identifier/output.css @@ -28,16 +32,17 @@ $ids: (); <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: unique-id(c)} +@use "sass:string"; +a {b: string.unique-id(c)} <===> error/too_many_args/error Error: Only 0 arguments allowed, but 1 was passed. ,--> input.scss -1 | a {b: unique-id(c)} - | ^^^^^^^^^^^^ invocation +2 | a {b: string.unique-id(c)} + | ^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function unique-id() { | =========== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/string/unquote.hrx b/spec/core_functions/string/unquote.hrx index 8a19dbf2d7..2368c921a1 100644 --- a/spec/core_functions/string/unquote.hrx +++ b/spec/core_functions/string/unquote.hrx @@ -6,7 +6,8 @@ value with the same serialization. <===> ================================================================================ <===> unquoted/input.scss -a {b: unquote(c)} +@use "sass:string"; +a {b: string.unquote(c)} <===> unquoted/output.css a { @@ -16,7 +17,8 @@ a { <===> ================================================================================ <===> quoted/input.scss -a {b: unquote("c")} +@use "sass:string"; +a {b: string.unquote("c")} <===> quoted/output.css a { @@ -26,10 +28,11 @@ a { <===> ================================================================================ <===> empty/input.scss -$result: unquote(""); +@use "sass:string"; +$result: string.unquote(""); a { result: $result; // This will not be emitted because the contents is empty. - length: str-length($result); + length: string.length($result); same: $result == ""; } @@ -42,12 +45,13 @@ a { <===> ================================================================================ <===> escaped_quotes/unquoted/input.scss +@use "sass:string"; // Unquoting an unquoted string returns it exactly as-is, leaving escapes // totally unchanged (whether they're quotes or not). -$result: unquote(\"c\"); +$result: string.unquote(\"c\"); a { result: $result; - length: str-length($result); + length: string.length($result); same: $result == \"c\"; } @@ -61,13 +65,14 @@ a { <===> ================================================================================ <===> escaped_quotes/quoted/input.scss +@use "sass:string"; // Unquoting a quoted string returns an unquoted string with the same code // points. Code points such as quotes that need to be escaped in the original // don't need escaping in the output. -$result: unquote("\"c\""); +$result: string.unquote("\"c\""); a { result: $result; - length: str-length($result); + length: string.length($result); same: $result == "\"c\""; } @@ -81,14 +86,15 @@ a { <===> ================================================================================ <===> meaningful_css_characters/input.scss +@use "sass:string"; // Unquoted strings aren't required to be valid CSS identifiers, and the // `unquote()` function does *not* escape characters that aren't valid // identifier characters. This allows it to be used as an escape hatch to // produce CSS that Sass doesn't otherwise support. -$result: unquote("b; c {d: e"); +$result: string.unquote("b; c {d: e"); a { result: $result; - length: str-length($result); + length: string.length($result); same: $result == "b; c {d: e"; } @@ -102,10 +108,11 @@ a { <===> ================================================================================ <===> escaped_backslash/input.scss -$result: unquote("\\0 "); +@use "sass:string"; +$result: string.unquote("\\0 "); a { result: $result; - length: str-length($result); + length: string.length($result); same-as-argument: $result == "\\0 "; same-as-literal: $result == \0 ; } @@ -121,7 +128,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: unquote($string: c)} +@use "sass:string"; +a {b: string.unquote($string: c)} <===> named/output.css a { @@ -131,46 +139,49 @@ a { <===> ================================================================================ <===> error/type/input.scss -a {b: unquote(1)} +@use "sass:string"; +a {b: string.unquote(1)} <===> error/type/error Error: $string: 1 is not a string. , -1 | a {b: unquote(1)} - | ^^^^^^^^^^ +2 | a {b: string.unquote(1)} + | ^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_few_args/input.scss -a {b: unquote()} +@use "sass:string"; +a {b: string.unquote()} <===> error/too_few_args/error Error: Missing argument $string. ,--> input.scss -1 | a {b: unquote()} - | ^^^^^^^^^ invocation +2 | a {b: string.unquote()} + | ^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function unquote($string) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> error/too_many_args/input.scss -a {b: unquote(c, d)} +@use "sass:string"; +a {b: string.unquote(c, d)} <===> error/too_many_args/error Error: Only 1 argument allowed, but 2 were passed. ,--> input.scss -1 | a {b: unquote(c, d)} - | ^^^^^^^^^^^^^ invocation +2 | a {b: string.unquote(c, d)} + | ^^^^^^^^^^^^^^^^^^^^ invocation ' ,--> sass:string 1 | @function unquote($string) { | ================ declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/directives/use/css/import.hrx b/spec/directives/use/css/import.hrx index b31b9a119c..4d54df8a44 100644 --- a/spec/directives/use/css/import.hrx +++ b/spec/directives/use/css/import.hrx @@ -154,15 +154,17 @@ in-input { outer {@import "imported"} <===> nested_import_into_use/_imported.scss +@use "sass:meta"; @use "used"; -in-imported {parent: inspect(&)} +in-imported {parent: meta.inspect(&)} <===> nested_import_into_use/_used.scss +@use "sass:meta"; // This parent selector will be `null`, because used modules are always // evaluated in a clean context, even if their CSS is then copied into an // imported file. -in-used {parent: inspect(&)} +in-used {parent: meta.inspect(&)} <===> nested_import_into_use/output.css outer in-used { diff --git a/spec/directives/use/member/nested_global_variable.hrx b/spec/directives/use/member/nested_global_variable.hrx index 2a5e015295..41b9f8ebd9 100644 --- a/spec/directives/use/member/nested_global_variable.hrx +++ b/spec/directives/use/member/nested_global_variable.hrx @@ -1,7 +1,8 @@ <===> direct/input.scss +@use "sass:meta"; @use "other"; -a {b: inspect(other.$member)} +a {b: meta.inspect(other.$member)} <===> direct/other.scss x { @@ -22,9 +23,10 @@ a { <===> ================================================================================ <===> through_import/input.scss +@use "sass:meta"; @use "used"; -a {b: inspect(used.$member)} +a {b: meta.inspect(used.$member)} <===> through_import/used.scss @import "imported"; diff --git a/spec/directives/warn.hrx b/spec/directives/warn.hrx index 6042e9bfd5..cecf15a46e 100644 --- a/spec/directives/warn.hrx +++ b/spec/directives/warn.hrx @@ -105,8 +105,10 @@ WARNING: warning <===> ================================================================================ <===> functions_in_stack/input.scss +@use "sass:meta"; + @function issues-warning($a) { - @warn "From function: #{inspect($a)}"; + @warn "From function: #{meta.inspect($a)}"; @return $a; } @@ -125,9 +127,9 @@ WARNING: warning <===> functions_in_stack/warning WARNING: From function: testing - input.scss 2:3 issues-warning() - input.scss 7:11 calls-function-that-warns() - input.scss 11:3 root stylesheet + input.scss 4:3 issues-warning() + input.scss 9:11 calls-function-that-warns() + input.scss 13:3 root stylesheet <===> ================================================================================ diff --git a/spec/non_conformant/basic/22_colors_with_alpha.hrx b/spec/non_conformant/basic/22_colors_with_alpha.hrx index 18c699a70b..91d1df1cc6 100644 --- a/spec/non_conformant/basic/22_colors_with_alpha.hrx +++ b/spec/non_conformant/basic/22_colors_with_alpha.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:color"; $x: rgb(0, 255, 255); div { @@ -13,13 +14,13 @@ div { $x: rgb(123, 45, 6); - hoo: red($x); - moo: green($x); - poo: blue($x); + hoo: color.red($x); + moo: color.green($x); + poo: color.blue($x); - goo: mix(rgba(255, 0, 0, 0.5), #00f); + goo: color.mix(rgba(255, 0, 0, 0.5), #00f); - boo: invert(#123456); + boo: color.invert(#123456); } <===> output.css diff --git a/spec/non_conformant/basic/23_basic_value_interpolation.hrx b/spec/non_conformant/basic/23_basic_value_interpolation.hrx index 89a6ff3e41..e9024e0244 100644 --- a/spec/non_conformant/basic/23_basic_value_interpolation.hrx +++ b/spec/non_conformant/basic/23_basic_value_interpolation.hrx @@ -1,11 +1,12 @@ <===> input.scss +@use "sass:meta"; div { a: hello#{world}; a: hello #{world}; b: 12#{3}; - b: type-of(12#{3}); + b: meta.type-of(12#{3}); b: #{12 + 111}; - b: type-of(#{12 + 111}); + b: meta.type-of(#{12 + 111}); } <===> output.css div { diff --git a/spec/non_conformant/basic/24_namespace_properties.hrx b/spec/non_conformant/basic/24_namespace_properties.hrx index 54b9c3e3b0..415531585f 100644 --- a/spec/non_conformant/basic/24_namespace_properties.hrx +++ b/spec/non_conformant/basic/24_namespace_properties.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:meta"; div { a: { p1: q; @@ -12,7 +13,7 @@ div { foo { bar: baz { bip: bop; - bing: type-of("hello"); + bing: meta.type-of("hello"); bang: 1 + 2; bung: bap; bong: bup { diff --git a/spec/non_conformant/basic/25_basic_string_interpolation.hrx b/spec/non_conformant/basic/25_basic_string_interpolation.hrx index d4bd8d1154..479a521080 100644 --- a/spec/non_conformant/basic/25_basic_string_interpolation.hrx +++ b/spec/non_conformant/basic/25_basic_string_interpolation.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:math"; div { - blah: "hello #{2+2} world #{unit(23px)} #{'bloo\n'} blah"; + blah: "hello #{2+2} world #{math.unit(23px)} #{'bloo\n'} blah"; } <===> output.css div { diff --git a/spec/non_conformant/basic/26_selector_interpolation.hrx b/spec/non_conformant/basic/26_selector_interpolation.hrx index 7c15b26392..847f3dccb9 100644 --- a/spec/non_conformant/basic/26_selector_interpolation.hrx +++ b/spec/non_conformant/basic/26_selector_interpolation.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:list"; $x: oo, ba; $y: az, hu; @@ -6,7 +7,7 @@ f#{$x}r { p: 1; b#{$y}x { q: 2; - mumble#{length($x) + length($y)} { + mumble#{list.length($x) + list.length($y)} { r: 3; } } diff --git a/spec/non_conformant/basic/29_if.hrx b/spec/non_conformant/basic/29_if.hrx index 806e8bc6eb..e308b43a23 100644 --- a/spec/non_conformant/basic/29_if.hrx +++ b/spec/non_conformant/basic/29_if.hrx @@ -1,29 +1,31 @@ <===> input.scss +@use "sass:list"; +@use "sass:meta"; $x: a, b, 1+2; -@if type-of(nth($x, 3)) == number { +@if meta.type-of(list.nth($x, 3)) == number { div { background: gray; } } -@if type-of(nth($x, 2)) == number { +@if meta.type-of(list.nth($x, 2)) == number { div { background: gray; } } -@else if type-of(nth($x, 2)) == string { +@else if meta.type-of(list.nth($x, 2)) == string { div { background: blue; } } -@if type-of(nth($x, 2)) == number { +@if meta.type-of(list.nth($x, 2)) == number { div { background: gray; } } -@else if type-of(nth($x, 2)) == color { +@else if meta.type-of(list.nth($x, 2)) == color { div { background: blue; } diff --git a/spec/non_conformant/basic/33_ambiguous_imports.hrx b/spec/non_conformant/basic/33_ambiguous_imports.hrx index 1eea08b616..5d11131842 100644 --- a/spec/non_conformant/basic/33_ambiguous_imports.hrx +++ b/spec/non_conformant/basic/33_ambiguous_imports.hrx @@ -1,15 +1,17 @@ <===> input.scss +@use "sass:meta"; main { color: red; } -@import "dir"; +@include meta.load-css("dir"); <===> dir.scss +@use "sass:meta"; dir { color: blue; } -@import "blir/fudge"; +@include meta.load-css("blir/fudge"); <===> blir/_fudge.scss fudge { color: brown; diff --git a/spec/non_conformant/basic/51_trailing_commas_in_list.hrx b/spec/non_conformant/basic/51_trailing_commas_in_list.hrx index cfcd31b0ff..6052439a13 100644 --- a/spec/non_conformant/basic/51_trailing_commas_in_list.hrx +++ b/spec/non_conformant/basic/51_trailing_commas_in_list.hrx @@ -1,10 +1,12 @@ <===> input.scss +@use "sass:list"; +@use "sass:meta"; $mylist: (alpha, beta, gamma, ); $my-single-item-list: (alpha,); .test { - out1: length($mylist); - blah: type-of(nth($mylist,3)); - out: length($my-single-item-list); + out1: list.length($mylist); + blah: meta.type-of(list.nth($mylist,3)); + out: list.length($my-single-item-list); } <===> output.css .test { diff --git a/spec/non_conformant/basic/55_variable_exists.hrx b/spec/non_conformant/basic/55_variable_exists.hrx index 631efc46e0..e6658a002b 100644 --- a/spec/non_conformant/basic/55_variable_exists.hrx +++ b/spec/non_conformant/basic/55_variable_exists.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:meta"; @function exists($name) { - @return variable-exists($name); + @return meta.variable-exists($name); } @function f() { @@ -9,30 +10,30 @@ } @function g() { - @return variable-exists(foo); + @return meta.variable-exists(foo); } div { - foo: variable-exists(x); - foo: variable-exists("x"); + foo: meta.variable-exists(x); + foo: meta.variable-exists("x"); span { $x: false; - foo: variable-exists(x); - foo: variable-exists("x"); - foo: variable-exists(y); - foo: variable-exists("y"); + foo: meta.variable-exists(x); + foo: meta.variable-exists("x"); + foo: meta.variable-exists(y); + foo: meta.variable-exists("y"); foo: exists(x); foo: exists("x"); p { - foo: variable-exists(x); - foo: variable-exists("x"); + foo: meta.variable-exists(x); + foo: meta.variable-exists("x"); foo: exists(x); foo: exists("x"); - foo: variable-exists(y); - foo: variable-exists("y"); + foo: meta.variable-exists(y); + foo: meta.variable-exists("y"); foo: f(); $y: blah; } diff --git a/spec/non_conformant/basic/56_global_variable_exists.hrx b/spec/non_conformant/basic/56_global_variable_exists.hrx index 112f3a82db..441678df5d 100644 --- a/spec/non_conformant/basic/56_global_variable_exists.hrx +++ b/spec/non_conformant/basic/56_global_variable_exists.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:meta"; @function exists($name) { - @return global-variable-exists($name); + @return meta.global-variable-exists($name); } @function f() { @@ -9,37 +10,37 @@ } @function g() { - @return global-variable-exists(foo); + @return meta.global-variable-exists(foo); } $z: hi; div { - foo: global-variable-exists(x); - foo: global-variable-exists("x"); - foo: global-variable-exists(z); - foo: global-variable-exists("z"); + foo: meta.global-variable-exists(x); + foo: meta.global-variable-exists("x"); + foo: meta.global-variable-exists(z); + foo: meta.global-variable-exists("z"); span { $x: false; - foo: global-variable-exists(x); - foo: global-variable-exists("x"); - foo: global-variable-exists(y); - foo: global-variable-exists("y"); + foo: meta.global-variable-exists(x); + foo: meta.global-variable-exists("x"); + foo: meta.global-variable-exists(y); + foo: meta.global-variable-exists("y"); - foo: global-variable-exists(z); - foo: global-variable-exists("z"); + foo: meta.global-variable-exists(z); + foo: meta.global-variable-exists("z"); p { - foo: global-variable-exists(x); - foo: global-variable-exists("x"); + foo: meta.global-variable-exists(x); + foo: meta.global-variable-exists("x"); foo: exists(x); foo: exists("x"); - foo: global-variable-exists(z); - foo: global-variable-exists("z"); - foo: global-variable-exists(y); - foo: global-variable-exists("y"); + foo: meta.global-variable-exists(z); + foo: meta.global-variable-exists("z"); + foo: meta.global-variable-exists(y); + foo: meta.global-variable-exists("y"); foo: f(); $y: blah; //TODO: check for shadowing diff --git a/spec/non_conformant/basic/57_function_exists.hrx b/spec/non_conformant/basic/57_function_exists.hrx index cfd90b653f..62b51a84b8 100644 --- a/spec/non_conformant/basic/57_function_exists.hrx +++ b/spec/non_conformant/basic/57_function_exists.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:meta"; @function exists($name) { - @return function-exists($name); + @return meta.function-exists($name); } @function f() { @@ -9,54 +10,54 @@ } @function g() { - @return function-exists(foo); + @return meta.function-exists(foo); } @function h() { - @return function-exists(lighten); + @return meta.function-exists(lighten); } div { - foo: function-exists(lighten); - foo: function-exists("lighten"); - foo: function-exists(exists); - foo: function-exists("exists"); - foo: function-exists(f); - foo: function-exists("f"); - foo: function-exists(g); - foo: function-exists("g"); - foo: function-exists(nope); - foo: function-exists("nope"); + foo: meta.function-exists(lighten); + foo: meta.function-exists("lighten"); + foo: meta.function-exists(exists); + foo: meta.function-exists("exists"); + foo: meta.function-exists(f); + foo: meta.function-exists("f"); + foo: meta.function-exists(g); + foo: meta.function-exists("g"); + foo: meta.function-exists(nope); + foo: meta.function-exists("nope"); foo: g(); foo: f(); foo: h(); span { - foo: function-exists(lighten); - foo: function-exists("lighten"); - foo: function-exists(exists); - foo: function-exists("exists"); - foo: function-exists(f); - foo: function-exists("f"); - foo: function-exists(g); - foo: function-exists("g"); - foo: function-exists(nope); - foo: function-exists("nope"); + foo: meta.function-exists(lighten); + foo: meta.function-exists("lighten"); + foo: meta.function-exists(exists); + foo: meta.function-exists("exists"); + foo: meta.function-exists(f); + foo: meta.function-exists("f"); + foo: meta.function-exists(g); + foo: meta.function-exists("g"); + foo: meta.function-exists(nope); + foo: meta.function-exists("nope"); foo: g(); foo: f(); foo: h(); p { - foo: function-exists(lighten); - foo: function-exists("lighten"); - foo: function-exists(exists); - foo: function-exists("exists"); - foo: function-exists(f); - foo: function-exists("f"); - foo: function-exists(g); - foo: function-exists("g"); - foo: function-exists(nope); - foo: function-exists("nope"); + foo: meta.function-exists(lighten); + foo: meta.function-exists("lighten"); + foo: meta.function-exists(exists); + foo: meta.function-exists("exists"); + foo: meta.function-exists(f); + foo: meta.function-exists("f"); + foo: meta.function-exists(g); + foo: meta.function-exists("g"); + foo: meta.function-exists(nope); + foo: meta.function-exists("nope"); foo: g(); foo: f(); foo: h(); diff --git a/spec/non_conformant/basic/58_mixin_exists.hrx b/spec/non_conformant/basic/58_mixin_exists.hrx index 05f8570b37..c59236371f 100644 --- a/spec/non_conformant/basic/58_mixin_exists.hrx +++ b/spec/non_conformant/basic/58_mixin_exists.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:meta"; @function exists($name) { - @return mixin-exists($name); + @return meta.mixin-exists($name); } @function f() { @@ -9,11 +10,11 @@ } @function g() { - @return mixin-exists(foo); + @return meta.mixin-exists(foo); } @function h() { - @return mixin-exists(lighten); + @return meta.mixin-exists(lighten); } @mixin red-text { color: red; } @@ -21,40 +22,40 @@ @mixin green-text { color: red; } div { - foo: mixin-exists(red-text); - foo: mixin-exists("red-text"); - foo: mixin-exists(blue-text); - foo: mixin-exists("blue-text"); - foo: mixin-exists(green-text); - foo: mixin-exists("green-text"); - foo: mixin-exists(nope); - foo: mixin-exists("nope"); + foo: meta.mixin-exists(red-text); + foo: meta.mixin-exists("red-text"); + foo: meta.mixin-exists(blue-text); + foo: meta.mixin-exists("blue-text"); + foo: meta.mixin-exists(green-text); + foo: meta.mixin-exists("green-text"); + foo: meta.mixin-exists(nope); + foo: meta.mixin-exists("nope"); foo: g(); foo: f(); foo: h(); span { - foo: mixin-exists(red-text); - foo: mixin-exists("red-text"); - foo: mixin-exists(blue-text); - foo: mixin-exists("blue-text"); - foo: mixin-exists(green-text); - foo: mixin-exists("green-text"); - foo: mixin-exists(nope); - foo: mixin-exists("nope"); + foo: meta.mixin-exists(red-text); + foo: meta.mixin-exists("red-text"); + foo: meta.mixin-exists(blue-text); + foo: meta.mixin-exists("blue-text"); + foo: meta.mixin-exists(green-text); + foo: meta.mixin-exists("green-text"); + foo: meta.mixin-exists(nope); + foo: meta.mixin-exists("nope"); foo: g(); foo: f(); foo: h(); p { - foo: mixin-exists(red-text); - foo: mixin-exists("red-text"); - foo: mixin-exists(blue-text); - foo: mixin-exists("blue-text"); - foo: mixin-exists(green-text); - foo: mixin-exists("green-text"); - foo: mixin-exists(nope); - foo: mixin-exists("nope"); + foo: meta.mixin-exists(red-text); + foo: meta.mixin-exists("red-text"); + foo: meta.mixin-exists(blue-text); + foo: meta.mixin-exists("blue-text"); + foo: meta.mixin-exists(green-text); + foo: meta.mixin-exists("green-text"); + foo: meta.mixin-exists(nope); + foo: meta.mixin-exists("nope"); foo: g(); foo: f(); foo: h(); diff --git a/spec/non_conformant/basic/59_if_expression.hrx b/spec/non_conformant/basic/59_if_expression.hrx index 6dc369315c..62c05bc427 100644 --- a/spec/non_conformant/basic/59_if_expression.hrx +++ b/spec/non_conformant/basic/59_if_expression.hrx @@ -1,11 +1,12 @@ <===> input.scss +@use "sass:string"; $x: 0; $if-false: whatever; div { foo: if($if-true: hey, $if-false: ho, $condition: true); foo: if($if-true: hey, $if-false: ho, $condition: false); - foo: if($x != 0, if($x, true, false), unquote("x is zero")); + foo: if($x != 0, if($x, true, false), string.unquote("x is zero")); foo: if(false, 1/0, $if-false: $if-false); } <===> output.css diff --git a/spec/non_conformant/colors/basic.hrx b/spec/non_conformant/colors/basic.hrx index 8d0d96a389..5e696a7a99 100644 --- a/spec/non_conformant/colors/basic.hrx +++ b/spec/non_conformant/colors/basic.hrx @@ -1,10 +1,11 @@ <===> input.scss +@use "sass:string"; p { color: rgb(255, 128, 0); color: red green blue; color: (red) (green) (blue); color: red + hux; - color: unquote("red") + green; + color: string.unquote("red") + green; foo: rgb(200, 150%, 170%); } <===> output.css diff --git a/spec/non_conformant/colors/change-color.hrx b/spec/non_conformant/colors/change-color.hrx index ce7d4ec719..27371a80d5 100644 --- a/spec/non_conformant/colors/change-color.hrx +++ b/spec/non_conformant/colors/change-color.hrx @@ -1,9 +1,10 @@ <===> input.scss +@use "sass:color"; p { - color: change-color(#102030, $blue: 5); - color: change-color(#102030, $alpha: .325); - color: change-color(#102030, $red: 120, $blue: 5); - color: change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8); + color: color.change(#102030, $blue: 5); + color: color.change(#102030, $alpha: .325); + color: color.change(#102030, $red: 120, $blue: 5); + color: color.change(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8); } <===> output.css p { diff --git a/spec/non_conformant/errors/fn-change-color-1.hrx b/spec/non_conformant/errors/fn-change-color-1.hrx index 8355cac004..c3816b9efa 100644 --- a/spec/non_conformant/errors/fn-change-color-1.hrx +++ b/spec/non_conformant/errors/fn-change-color-1.hrx @@ -1,11 +1,12 @@ <===> input.scss +@use "sass:color"; foo { - test: change-color(red, $red: 0.5, $hue: 0.2); + test: color.change(red, $red: 0.5, $hue: 0.2); } <===> error Error: RGB parameters may not be passed along with HSL parameters. , -2 | test: change-color(red, $red: 0.5, $hue: 0.2); +3 | test: color.change(red, $red: 0.5, $hue: 0.2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 2:9 root stylesheet + input.scss 3:9 root stylesheet diff --git a/spec/non_conformant/errors/import/file/mixin/simple/inside.hrx b/spec/non_conformant/errors/import/file/mixin/simple/inside.hrx index 3cbc07d8fd..43fca1bd7b 100644 --- a/spec/non_conformant/errors/import/file/mixin/simple/inside.hrx +++ b/spec/non_conformant/errors/import/file/mixin/simple/inside.hrx @@ -1,9 +1,10 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } foo { - $family: unquote("Droid+Sans"); + $family: string.unquote("Droid+Sans"); @include import-google-fonts(); } <===> _include.scss @@ -11,8 +12,8 @@ foo { <===> error Error: Undefined variable. , -2 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); +3 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); | ^^^^^^^ ' - input.scss 2:57 import-google-fonts() - input.scss 6:3 root stylesheet + input.scss 3:57 import-google-fonts() + input.scss 7:3 root stylesheet diff --git a/spec/non_conformant/errors/import/file/mixin/simple/outside.hrx b/spec/non_conformant/errors/import/file/mixin/simple/outside.hrx index ca5e5f18fa..1a42c5e009 100644 --- a/spec/non_conformant/errors/import/file/mixin/simple/outside.hrx +++ b/spec/non_conformant/errors/import/file/mixin/simple/outside.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } -$family: unquote("Droid+Sans"); +$family: string.unquote("Droid+Sans"); @include import-google-fonts(); <===> _include.scss diff --git a/spec/non_conformant/errors/import/miss/mixin/simple/inside.hrx b/spec/non_conformant/errors/import/miss/mixin/simple/inside.hrx index ac91bab7e4..0459ae76eb 100644 --- a/spec/non_conformant/errors/import/miss/mixin/simple/inside.hrx +++ b/spec/non_conformant/errors/import/miss/mixin/simple/inside.hrx @@ -1,16 +1,17 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } foo { - $family: unquote("Droid+Sans"); + $family: string.unquote("Droid+Sans"); @include import-google-fonts(); } <===> error Error: Undefined variable. , -2 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); +3 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); | ^^^^^^^ ' - input.scss 2:57 import-google-fonts() - input.scss 6:3 root stylesheet + input.scss 3:57 import-google-fonts() + input.scss 7:3 root stylesheet diff --git a/spec/non_conformant/errors/import/miss/mixin/simple/outside.hrx b/spec/non_conformant/errors/import/miss/mixin/simple/outside.hrx index 5cf1442ed3..5e34b1d922 100644 --- a/spec/non_conformant/errors/import/miss/mixin/simple/outside.hrx +++ b/spec/non_conformant/errors/import/miss/mixin/simple/outside.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } -$family: unquote("Droid+Sans"); +$family: string.unquote("Droid+Sans"); @include import-google-fonts(); <===> output.css @import url("http://fonts.googleapis.com/css?family=Droid+Sans"); diff --git a/spec/non_conformant/errors/import/url/mixin/simple/inside.hrx b/spec/non_conformant/errors/import/url/mixin/simple/inside.hrx index ac91bab7e4..0459ae76eb 100644 --- a/spec/non_conformant/errors/import/url/mixin/simple/inside.hrx +++ b/spec/non_conformant/errors/import/url/mixin/simple/inside.hrx @@ -1,16 +1,17 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } foo { - $family: unquote("Droid+Sans"); + $family: string.unquote("Droid+Sans"); @include import-google-fonts(); } <===> error Error: Undefined variable. , -2 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); +3 | @import url("http://fonts.googleapis.com/css?family=#{$family}"); | ^^^^^^^ ' - input.scss 2:57 import-google-fonts() - input.scss 6:3 root stylesheet + input.scss 3:57 import-google-fonts() + input.scss 7:3 root stylesheet diff --git a/spec/non_conformant/errors/import/url/mixin/simple/outside.hrx b/spec/non_conformant/errors/import/url/mixin/simple/outside.hrx index 5cf1442ed3..5e34b1d922 100644 --- a/spec/non_conformant/errors/import/url/mixin/simple/outside.hrx +++ b/spec/non_conformant/errors/import/url/mixin/simple/outside.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } -$family: unquote("Droid+Sans"); +$family: string.unquote("Droid+Sans"); @include import-google-fonts(); <===> output.css @import url("http://fonts.googleapis.com/css?family=Droid+Sans"); diff --git a/spec/non_conformant/misc/import_in_mixin.hrx b/spec/non_conformant/misc/import_in_mixin.hrx index 0803158f1e..d4d33cbdbc 100644 --- a/spec/non_conformant/misc/import_in_mixin.hrx +++ b/spec/non_conformant/misc/import_in_mixin.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; @mixin import-google-fonts() { @import url("http://fonts.googleapis.com/css?family=#{$family}"); } -$family: unquote("Droid+Sans"); +$family: string.unquote("Droid+Sans"); @include import-google-fonts(); <===> output.css diff --git a/spec/non_conformant/misc/import_with_interpolation.hrx b/spec/non_conformant/misc/import_with_interpolation.hrx index 1ae4920d0d..4956f12074 100644 --- a/spec/non_conformant/misc/import_with_interpolation.hrx +++ b/spec/non_conformant/misc/import_with_interpolation.hrx @@ -1,5 +1,6 @@ <===> input.scss -$family: unquote("Droid+Sans"); +@use "sass:string"; +$family: string.unquote("Droid+Sans"); @import url("http://fonts.googleapis.com/css?family=#{$family}"); <===> output.css diff --git a/spec/non_conformant/mixin/content/arguments/receiving.hrx b/spec/non_conformant/mixin/content/arguments/receiving.hrx index 0b5f142e1b..48897de76c 100644 --- a/spec/non_conformant/mixin/content/arguments/receiving.hrx +++ b/spec/non_conformant/mixin/content/arguments/receiving.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:meta"; // Content blocks' argument lists can define arguments in in all the same ways // as they're defined in any other argument list. @@ -44,8 +45,8 @@ with-splat { } @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); + positional: meta.inspect($args); + keywords: meta.inspect(keywords($args)); } } @@ -55,8 +56,8 @@ with-splat { } @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); + positional: meta.inspect($args); + keywords: meta.inspect(keywords($args)); } } @@ -66,8 +67,8 @@ with-splat { } @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); + positional: meta.inspect($args); + keywords: meta.inspect(keywords($args)); } } @@ -77,8 +78,8 @@ with-splat { } @include mixin using ($args...) { - positional: inspect($args); - keywords: inspect(keywords($args)); + positional: meta.inspect($args); + keywords: meta.inspect(keywords($args)); } } } diff --git a/spec/non_conformant/sass/var-args/success.hrx b/spec/non_conformant/sass/var-args/success.hrx index 809a8f9405..9bf23d51ae 100644 --- a/spec/non_conformant/sass/var-args/success.hrx +++ b/spec/non_conformant/sass/var-args/success.hrx @@ -1,24 +1,26 @@ <===> input.scss +@use "sass:list"; +@use "sass:meta"; @mixin foo($x, $y, $zs...) { - grarh: type-of(false); + grarh: meta.type-of(false); f: $zs; fa: $x, $y, $zs; fv: $zs; - ft: type-of($zs); - fj: join(1 2 3, $zs); - fjt: type-of(join(1 2 3, $zs)); - fkt: type-of(join($zs, 1 2 3)); - hoopla: length(a b c d e); - boopla: type-of(123+234); - koopla: type-of(length(a b c d)); + ft: meta.type-of($zs); + fj: list.join(1 2 3, $zs); + fjt: meta.type-of(list.join(1 2 3, $zs)); + fkt: meta.type-of(list.join($zs, 1 2 3)); + hoopla: list.length(a b c d e); + boopla: meta.type-of(123+234); + koopla: meta.type-of(list.length(a b c d)); } @mixin bar($x, $y, $z) { ba: $x, $y, $z; bv: $z; - bt: type-of($z); - bj: join(1 2 3, $z); - bjt: type-of(join(1 2 3, $z)); + bt: meta.type-of($z); + bj: list.join(1 2 3, $z); + bjt: meta.type-of(list.join(1 2 3, $z)); } $stuff: hey hoo ha; @@ -35,7 +37,7 @@ div { @include foo(a, b, c d e...); @include foo(a, c d e...); @include foo(a, $stuff...); - new: type-of("hello"); + new: meta.type-of("hello"); } @mixin bad($x, $y, $z) { @@ -45,9 +47,9 @@ div { } @mixin foo($x, $y, $z) { - a: type-of(join($x, $y)); - b: type-of($z); - c: type-of(length($x)); + a: meta.type-of(list.join($x, $y)); + b: meta.type-of($z); + c: meta.type-of(list.length($x)); } div { diff --git a/spec/non_conformant/scss-tests/008_test_sass_script.hrx b/spec/non_conformant/scss-tests/008_test_sass_script.hrx index 5f9eb8f9df..18f509cea5 100644 --- a/spec/non_conformant/scss-tests/008_test_sass_script.hrx +++ b/spec/non_conformant/scss-tests/008_test_sass_script.hrx @@ -1,9 +1,10 @@ <===> input.scss +@use "sass:math"; foo { a: 1 + 2; b: 1 - 2; c: foo + bar; - d: floor(12.3px); } + d: math.floor(12.3px); } <===> output.css foo { diff --git a/spec/non_conformant/scss-tests/028_test_import_with_interpolation.hrx b/spec/non_conformant/scss-tests/028_test_import_with_interpolation.hrx index 1ae4920d0d..4956f12074 100644 --- a/spec/non_conformant/scss-tests/028_test_import_with_interpolation.hrx +++ b/spec/non_conformant/scss-tests/028_test_import_with_interpolation.hrx @@ -1,5 +1,6 @@ <===> input.scss -$family: unquote("Droid+Sans"); +@use "sass:string"; +$family: string.unquote("Droid+Sans"); @import url("http://fonts.googleapis.com/css?family=#{$family}"); <===> output.css diff --git a/spec/non_conformant/scss-tests/065_test_mixin_empty_var_args.hrx b/spec/non_conformant/scss-tests/065_test_mixin_empty_var_args.hrx index bd34695b41..28a4cafb6e 100644 --- a/spec/non_conformant/scss-tests/065_test_mixin_empty_var_args.hrx +++ b/spec/non_conformant/scss-tests/065_test_mixin_empty_var_args.hrx @@ -1,7 +1,8 @@ <===> input.scss +@use "sass:list"; @mixin foo($a, $b...) { a: $a; - b: length($b); + b: list.length($b); } .foo {@include foo(1)} diff --git a/spec/non_conformant/scss-tests/066_test_mixin_var_args_act_like_list.hrx b/spec/non_conformant/scss-tests/066_test_mixin_var_args_act_like_list.hrx index 2d39d5ea61..65bbdc017e 100644 --- a/spec/non_conformant/scss-tests/066_test_mixin_var_args_act_like_list.hrx +++ b/spec/non_conformant/scss-tests/066_test_mixin_var_args_act_like_list.hrx @@ -1,7 +1,8 @@ <===> input.scss +@use "sass:list"; @mixin foo($a, $b...) { - a: length($b); - b: nth($b, 2); + a: list.length($b); + b: list.nth($b, 2); } .foo {@include foo(1, 2, 3, 4)} diff --git a/spec/non_conformant/scss-tests/084_test_function_empty_var_args.hrx b/spec/non_conformant/scss-tests/084_test_function_empty_var_args.hrx index b0f4512a58..85a92a815d 100644 --- a/spec/non_conformant/scss-tests/084_test_function_empty_var_args.hrx +++ b/spec/non_conformant/scss-tests/084_test_function_empty_var_args.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:list"; @function foo($a, $b...) { - @return "a: #{$a}, b: #{length($b)}"; + @return "a: #{$a}, b: #{list.length($b)}"; } .foo {val: foo(1)} diff --git a/spec/non_conformant/scss-tests/085_test_function_var_args_act_like_list.hrx b/spec/non_conformant/scss-tests/085_test_function_var_args_act_like_list.hrx index 620510aec7..44e0839aa5 100644 --- a/spec/non_conformant/scss-tests/085_test_function_var_args_act_like_list.hrx +++ b/spec/non_conformant/scss-tests/085_test_function_var_args_act_like_list.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:list"; @function foo($a, $b...) { - @return "a: #{length($b)}, b: #{nth($b, 2)}"; + @return "a: #{list.length($b)}, b: #{list.nth($b, 2)}"; } .foo {val: foo(1, 2, 3, 4)} diff --git a/spec/non_conformant/scss-tests/103_test_function_var_args_passed_to_native.hrx b/spec/non_conformant/scss-tests/103_test_function_var_args_passed_to_native.hrx index 70e6e6510b..fe2b49b01a 100644 --- a/spec/non_conformant/scss-tests/103_test_function_var_args_passed_to_native.hrx +++ b/spec/non_conformant/scss-tests/103_test_function_var_args_passed_to_native.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:color"; @function foo($args...) { - @return adjust-color($args...); + @return color.adjust($args...); } .foo {val: foo(#102030, $blue: 5)} diff --git a/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx b/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx index d42969daa2..364a5651be 100644 --- a/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx +++ b/spec/non_conformant/scss-tests/190_test_options_passed_to_script.hrx @@ -1,5 +1,6 @@ <===> input.scss -foo {color: darken(black, 10%)} +@use "sass:color"; +foo {color: color.adjust(black, $lightness: -10%)} <===> output.css foo { diff --git a/spec/non_conformant/scss/alpha.hrx b/spec/non_conformant/scss/alpha.hrx index 8626c43b9d..bf638dc5fa 100644 --- a/spec/non_conformant/scss/alpha.hrx +++ b/spec/non_conformant/scss/alpha.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:color"; $x: rgb(0, 255, 255); div { @@ -14,13 +15,13 @@ div { $x: rgb(123, 45, 6); - hoo: red($x); - moo: green($x); - poo: blue($x); + hoo: color.red($x); + moo: color.green($x); + poo: color.blue($x); // goo: mix(rgba(255, 0, 0, 0.5), #00f); - boo: invert(#123456); + boo: color.invert(#123456); } <===> output.css diff --git a/spec/non_conformant/scss/cons-up.hrx b/spec/non_conformant/scss/cons-up.hrx index 1077200f83..3fadae3e8c 100644 --- a/spec/non_conformant/scss/cons-up.hrx +++ b/spec/non_conformant/scss/cons-up.hrx @@ -1,4 +1,7 @@ <===> input.scss +@use "sass:string"; +@use "sass:list"; + $inputs-list: 'input[type="email"]', 'input[type="number"]', 'input[type="password"]', @@ -19,13 +22,13 @@ $inputs-list: 'input[type="email"]', $unquoted-inputs-list: (); @each $input-type in $inputs-list { - $unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma); + $unquoted-inputs-list: list.append($unquoted-inputs-list, string.unquote($input-type), comma); } div { content: $unquoted-inputs-list; - content: append((), hello); - content: length(()); + content: list.append((), hello); + content: list.length(()); } <===> output.css div { diff --git a/spec/non_conformant/scss/directives-in-propsets.hrx b/spec/non_conformant/scss/directives-in-propsets.hrx index 8b8e91adee..6d2b0ec157 100644 --- a/spec/non_conformant/scss/directives-in-propsets.hrx +++ b/spec/non_conformant/scss/directives-in-propsets.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:meta"; $color: red; $position: 50%; $x: 0; @@ -12,10 +13,10 @@ div { something: { color: green; } - @if (type-of($color) == "color") { + @if (meta.type-of($color) == "color") { color: $color; } - @if (type-of($position) == "number") { + @if (meta.type-of($position) == "number") { position: $position; @include foo(); } diff --git a/spec/non_conformant/scss/each_in_functions.hrx b/spec/non_conformant/scss/each_in_functions.hrx index e1c382af93..e27781dd94 100644 --- a/spec/non_conformant/scss/each_in_functions.hrx +++ b/spec/non_conformant/scss/each_in_functions.hrx @@ -1,11 +1,13 @@ <===> input.scss +@use "sass:list"; +@use "sass:meta"; $GLOBAL: global; @function foo($g1, $g2, $g3) { @each $value in $g1, $g2, $g3 { $GLOBAL: $GLOBAL each $value !global; - $GLOBAL: $GLOBAL type1 type-of(nth($value, 1)) !global; - $GLOBAL: $GLOBAL type2 type-of(nth($value, 2)) !global; + $GLOBAL: $GLOBAL type1 meta.type-of(list.nth($value, 1)) !global; + $GLOBAL: $GLOBAL type2 meta.type-of(list.nth($value, 2)) !global; } @each $value in (foo: foo, bar: bar) { $GLOBAL: $GLOBAL map $value !global; @@ -17,7 +19,7 @@ div { a: foo(50% 50%, cover circle, red blue); b: $GLOBAL; $colors: red green blue; - c: a, b, type-of(nth($colors, 2)), d; + c: a, b, meta.type-of(list.nth($colors, 2)), d; } <===> output.css diff --git a/spec/non_conformant/scss/ie-backslash.hrx b/spec/non_conformant/scss/ie-backslash.hrx index c442e85068..3b72ce5d58 100644 --- a/spec/non_conformant/scss/ie-backslash.hrx +++ b/spec/non_conformant/scss/ie-backslash.hrx @@ -1,6 +1,7 @@ <===> input.scss +@use "sass:color"; div { - background-color: darken(red, 10%) \9; + background-color: color.adjust(red, $lightness: -10%) \9; } <===> output.css div { diff --git a/spec/non_conformant/scss/ie-functions.hrx b/spec/non_conformant/scss/ie-functions.hrx index dc544d96be..d42c7cdc42 100644 --- a/spec/non_conformant/scss/ie-functions.hrx +++ b/spec/non_conformant/scss/ie-functions.hrx @@ -1,9 +1,13 @@ <===> input.scss +@use "sass:color"; +@use "sass:math"; +@use "sass:meta"; + @mixin ie-opacity($opacity) { - opacity: $opacity / 100; + opacity: math.div($opacity, 100); filter: alpha(opacity=$opacity); bilter: alpha(opacity=$opacity); - kilter: type-of(opacity=$opacity); + kilter: meta.type-of(opacity=$opacity); left: expression(document.body.clientWidth/2-oDiv.offsetWidth/2); flop: expression(document.body.clientHeight/2-oDiv.offsetHeight/2); } @@ -16,10 +20,10 @@ foo { something: blah(hux = mumble); blah: progid:something.something(flip=foobar, bang=#abc); blah: progid:bar.hux(); - blah: type-of(hux = mumble); + blah: meta.type-of(hux = mumble); @include ie-opacity(.5); left: expression(document.body.clientWidth/4); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{color.ie-hex-str($startColor)}', endColorstr='#{color.ie-hex-str($endColor)}', GradientType=1); } .parser { @@ -69,17 +73,3 @@ foo { filter: progid:DXImageTransform.Microsoft.MotionBlur(strength=13, direction=310) progid:DXImageTransform.Microsoft.Blur(pixelradius=2) progid:DXImageTransform.Microsoft.Wheel(duration=3); filter: progid:DXImageTransform.Microsoft.gradient(enabled="false", startColorstr=#550000FF, endColorstr=#55FFFF00); } - -<===> warning -DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div($opacity, 100) or calc($opacity / 100) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -2 | opacity: $opacity / 100; - | ^^^^^^^^^^^^^^ - ' - input.scss 2:12 ie-opacity() - input.scss 19:3 root stylesheet diff --git a/spec/non_conformant/scss/media/script_features.hrx b/spec/non_conformant/scss/media/script_features.hrx index b0dfa9abfc..41087ef31a 100644 --- a/spec/non_conformant/scss/media/script_features.hrx +++ b/spec/non_conformant/scss/media/script_features.hrx @@ -1,4 +1,5 @@ <===> input.scss +@use "sass:list"; $foo: 3; $bar: 4; // Media features are special-cased to allow raw script without interpolation. @@ -6,7 +7,7 @@ $bar: 4; // Not just variables, but full script $vals: 1 2 3; -@media screen and (max-width: 1 + 2) and (min-width: 5 + 6 + nth($vals, 2)) {x {y: z}} +@media screen and (max-width: 1 + 2) and (min-width: 5 + 6 + list.nth($vals, 2)) {x {y: z}} <===> output.css diff --git a/spec/non_conformant/scss/null.hrx b/spec/non_conformant/scss/null.hrx index a303edee99..dcf6e0f343 100644 --- a/spec/non_conformant/scss/null.hrx +++ b/spec/non_conformant/scss/null.hrx @@ -1,27 +1,29 @@ <===> input.scss +@use "sass:list"; +@use "sass:meta"; $x: 2; div { $x: null; - a: length(null null null); + a: list.length(null null null); b: #{null}; - d: type-of($x); + d: meta.type-of($x); e: null == null; f: -null; g: -fudge; h: (null null null); i: froo(null, 4); j: (null), (null), 3, 4; - k: length(((null), (null), 3, 4)); - - a2: length($x $x $x); + k: list.length(((null), (null), 3, 4)); + + a2: list.length($x $x $x); b2: #{$x}; e2: $x == null; f2: -$x; h2: ($x $x $x); i2: froo($x, 4); j2: ($x), ($x), 3, 4; - k2: length((($x), ($x), 3, 4)); + k2: list.length((($x), ($x), 3, 4)); } <===> output.css div { diff --git a/spec/non_conformant/scss/sass_script.hrx b/spec/non_conformant/scss/sass_script.hrx index 5f9eb8f9df..18f509cea5 100644 --- a/spec/non_conformant/scss/sass_script.hrx +++ b/spec/non_conformant/scss/sass_script.hrx @@ -1,9 +1,10 @@ <===> input.scss +@use "sass:math"; foo { a: 1 + 2; b: 1 - 2; c: foo + bar; - d: floor(12.3px); } + d: math.floor(12.3px); } <===> output.css foo { diff --git a/spec/non_conformant/scss/simple-lists.hrx b/spec/non_conformant/scss/simple-lists.hrx index 195e6dbc68..d233924dcf 100644 --- a/spec/non_conformant/scss/simple-lists.hrx +++ b/spec/non_conformant/scss/simple-lists.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:string"; div { hey: a, b, c, d; ho: a b c d; - ha: unquote("a, b, c, d"); + ha: string.unquote("a, b, c, d"); } <===> output.css div { diff --git a/spec/non_conformant/scss/zero-compression.hrx b/spec/non_conformant/scss/zero-compression.hrx index 6c65c02f8f..cb274906dc 100644 --- a/spec/non_conformant/scss/zero-compression.hrx +++ b/spec/non_conformant/scss/zero-compression.hrx @@ -1,12 +1,14 @@ <===> input.scss -$orig: 0.12em; -$value: (0.12em); -$score: (item-height: 0.12em); -foo { - tst-1: 0 -#{0.12em}; - tst-2: 0 -#{$orig}; - tst-3: 0 -#{$value}; - tst-4: 0 -#{map-get($score, item-height)}; +@use "sass:map"; + +$orig: 0.12em; +$value: (0.12em); +$score: (item-height: 0.12em); +foo { + tst-1: 0 -#{0.12em}; + tst-2: 0 -#{$orig}; + tst-3: 0 -#{$value}; + tst-4: 0 -#{map.get($score, item-height)}; } <===> output.css foo { diff --git a/spec/values/colors/alpha_hex/initial_digit.hrx b/spec/values/colors/alpha_hex/initial_digit.hrx index 4820997d9e..2b4c2aa09c 100644 --- a/spec/values/colors/alpha_hex/initial_digit.hrx +++ b/spec/values/colors/alpha_hex/initial_digit.hrx @@ -1,18 +1,19 @@ <===> input.scss +@use "sass:color"; a { four-digit: #0123; eight-digit: #98765432; // Verify that the color channels are set correctly. - four-digit-red: red(#0123); - four-digit-green: green(#0123); - four-digit-blue: blue(#0123); - four-digit-alpha: alpha(#0123); + four-digit-red: color.red(#0123); + four-digit-green: color.green(#0123); + four-digit-blue: color.blue(#0123); + four-digit-alpha: color.alpha(#0123); - eight-digit-red: red(#98765432); - eight-digit-green: green(#98765432); - eight-digit-blue: blue(#98765432); - eight-digit-alpha: alpha(#98765432); + eight-digit-red: color.red(#98765432); + eight-digit-green: color.green(#98765432); + eight-digit-blue: color.blue(#98765432); + eight-digit-alpha: color.alpha(#98765432); } <===> output.css diff --git a/spec/values/colors/alpha_hex/initial_letter.hrx b/spec/values/colors/alpha_hex/initial_letter.hrx index 51904d1a7e..fde7d324be 100644 --- a/spec/values/colors/alpha_hex/initial_letter.hrx +++ b/spec/values/colors/alpha_hex/initial_letter.hrx @@ -1,18 +1,19 @@ <===> input.scss +@use "sass:color"; a { four-digit: #AbCd; eight-digit: #aBcDeF12; // Verify that the color channels are set correctly. - four-digit-red: red(#abcd); - four-digit-green: green(#abcd); - four-digit-blue: blue(#abcd); - four-digit-alpha: alpha(#abcd); + four-digit-red: color.red(#abcd); + four-digit-green: color.green(#abcd); + four-digit-blue: color.blue(#abcd); + four-digit-alpha: color.alpha(#abcd); - eight-digit-red: red(#ABCDEF12); - eight-digit-green: green(#ABCDEF12); - eight-digit-blue: blue(#ABCDEF12); - eight-digit-alpha: alpha(#ABCDEF12); + eight-digit-red: color.red(#ABCDEF12); + eight-digit-green: color.green(#ABCDEF12); + eight-digit-blue: color.blue(#ABCDEF12); + eight-digit-alpha: color.alpha(#ABCDEF12); } <===> output.css diff --git a/spec/values/identifiers/escape/script.hrx b/spec/values/identifiers/escape/script.hrx index 2ab8efbb11..58c1e45369 100644 --- a/spec/values/identifiers/escape/script.hrx +++ b/spec/values/identifiers/escape/script.hrx @@ -1,14 +1,15 @@ <===> input.scss +@use "sass:string"; // SassScript functions operate on the normalized form of the identifier. .script { - unescaped-str-length: str-length(ax) str-length(\61x) str-length(\00061 x); - escaped-str-length: str-length(\1Ax) str-length(\0001A x); + unescaped-str-length: string.length(ax) string.length(\61x) string.length(\00061 x); + escaped-str-length: string.length(\1Ax) string.length(\0001A x); - unescaped-slice: str-slice(xaz, 2, 2) str-slice(x\61z, 2, 2) str-slice(x\00061 z, 2, 2); - escaped-slice: str-slice(x\1Az, 2, 5) str-slice(x\0001A z, 2, 5); + unescaped-slice: string.slice(xaz, 2, 2) string.slice(x\61z, 2, 2) string.slice(x\00061 z, 2, 2); + escaped-slice: string.slice(x\1Az, 2, 5) string.slice(x\0001A z, 2, 5); - unescaped-quote: quote(ax) quote(\61x) quote(\00061 x); - escaped-quote: quote(\1Ax) quote(\0001A x); + unescaped-quote: string.quote(ax) string.quote(\61x) string.quote(\00061 x); + escaped-quote: string.quote(\1Ax) string.quote(\0001A x); } <===> output.css diff --git a/spec/values/lists/slash.hrx b/spec/values/lists/slash.hrx index e5058aa94c..a10090132e 100644 --- a/spec/values/lists/slash.hrx +++ b/spec/values/lists/slash.hrx @@ -65,7 +65,7 @@ a { @use "sass:list"; // CSS doesn't use slash-separated bracketed lists, but Sass supports them in // case one day that changes. -a {b: join(c d, e f, $separator: slash, $bracketed: true)} +a {b: list.join(c d, e f, $separator: slash, $bracketed: true)} <===> output/bracketed_slash/output.css a { @@ -76,7 +76,7 @@ a { ================================================================================ <===> functions/length/input.scss @use "sass:list"; -a {b: length(list.slash(c, d, e, f, g))} +a {b: list.length(list.slash(c, d, e, f, g))} <===> functions/length/output.css a { @@ -87,7 +87,7 @@ a { ================================================================================ <===> functions/nth/input.scss @use "sass:list"; -a {b: nth(list.slash(c, d, e, f, g), 3)} +a {b: list.nth(list.slash(c, d, e, f, g), 3)} <===> functions/nth/output.css a { diff --git a/spec/values/maps/key_equality.hrx b/spec/values/maps/key_equality.hrx index 19d52b34af..f8a796f2f9 100644 --- a/spec/values/maps/key_equality.hrx +++ b/spec/values/maps/key_equality.hrx @@ -1,102 +1,39 @@ <===> nan/input.scss -a {b: inspect(map-get(((0/0): b), 0/0))} +@use "sass:map"; +@use "sass:math"; +@use "sass:meta"; + +a {b: meta.inspect(map.get((math.div(0, 0): b), math.div(0, 0)))} <===> nan/output.css a { b: null; } -<===> nan/warning -DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(0, 0) or calc(0 / 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((0/0): b), 0/0))} - | ^^^ - ' - input.scss 1:25 root stylesheet - -DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(0, 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((0/0): b), 0/0))} - | ^^^ - ' - input.scss 1:35 root stylesheet - <===> ================================================================================ <===> infinity/positive/input.scss -a {b: inspect(map-get(((1/0): b), 1/0))} +@use "sass:map"; +@use "sass:math"; +@use "sass:meta"; + +a {b: meta.inspect(map.get(((math.div(1, 0)): b), math.div(1, 0)))} <===> infinity/positive/output.css a { b: b; } -<===> infinity/positive/warning -DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(1, 0) or calc(1 / 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((1/0): b), 1/0))} - | ^^^ - ' - input.scss 1:25 root stylesheet - -DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(1, 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((1/0): b), 1/0))} - | ^^^ - ' - input.scss 1:35 root stylesheet - <===> ================================================================================ <===> infinity/negative/input.scss -a {b: inspect(map-get(((-1/0): b), -1/0))} +@use "sass:map"; +@use "sass:math"; +@use "sass:meta"; + +a {b: meta.inspect(map.get(((math.div(-1, 0)): b), math.div(-1, 0)))} <===> infinity/negative/output.css a { b: b; } - -<===> infinity/negative/warning -DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(-1, 0) or calc(-1 / 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((-1/0): b), -1/0))} - | ^^^^ - ' - input.scss 1:25 root stylesheet - -DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. - -Recommendation: math.div(-1, 0) - -More info and automated migrator: https://sass-lang.com/d/slash-div - - , -1 | a {b: inspect(map-get(((-1/0): b), -1/0))} - | ^^^^ - ' - input.scss 1:36 root stylesheet diff --git a/spec/values/maps/length.hrx b/spec/values/maps/length.hrx index 8471a78f16..c22e6ebb40 100644 --- a/spec/values/maps/length.hrx +++ b/spec/values/maps/length.hrx @@ -1,8 +1,9 @@ <===> input.scss +@use "sass:list"; $map: (aaa: 100, bbb: 200, ccc: 300); a { - b: length($map); + b: list.length($map); } <===> output.css diff --git a/spec/values/maps/map-values.hrx b/spec/values/maps/map-values.hrx index 291fb04299..9fbff6a159 100644 --- a/spec/values/maps/map-values.hrx +++ b/spec/values/maps/map-values.hrx @@ -1,7 +1,8 @@ <===> input.scss +@use "sass:map"; div { - foo: map-values((foo: 1, bar: 2)); - foo: map-values((foo: 1, bar: 2, baz: 2)); + foo: map.values((foo: 1, bar: 2)); + foo: map.values((foo: 1, bar: 2, baz: 2)); } <===> output.css diff --git a/spec/values/numbers/divide/slash_free/argument.hrx b/spec/values/numbers/divide/slash_free/argument.hrx index 7538a3cf6b..b708e44edf 100644 --- a/spec/values/numbers/divide/slash_free/argument.hrx +++ b/spec/values/numbers/divide/slash_free/argument.hrx @@ -24,7 +24,8 @@ More info and automated migrator: https://sass-lang.com/d/slash-div <===> ================================================================================ <===> function/built_in/input.scss -c {d: join(1/2, 3/4)} +@use "sass:list"; +c {d: list.join(1/2, 3/4)} <===> function/built_in/output.css c { @@ -39,10 +40,10 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2, 3/4)} - | ^^^ +2 | c {d: list.join(1/2, 3/4)} + | ^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. @@ -51,15 +52,16 @@ Recommendation: math.div(3, 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2, 3/4)} - | ^^^ +2 | c {d: list.join(1/2, 3/4)} + | ^^^ ' - input.scss 1:17 root stylesheet + input.scss 2:22 root stylesheet <===> ================================================================================ <===> function/named/input.scss -c {d: join($list1: 1/2, $list2: 3/4)} +@use "sass:list"; +c {d: list.join($list1: 1/2, $list2: 3/4)} <===> function/named/output.css c { @@ -74,10 +76,10 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join($list1: 1/2, $list2: 3/4)} - | ^^^ +2 | c {d: list.join($list1: 1/2, $list2: 3/4)} + | ^^^ ' - input.scss 1:20 root stylesheet + input.scss 2:25 root stylesheet DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. @@ -86,15 +88,16 @@ Recommendation: math.div(3, 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join($list1: 1/2, $list2: 3/4)} - | ^^^ +2 | c {d: list.join($list1: 1/2, $list2: 3/4)} + | ^^^ ' - input.scss 1:33 root stylesheet + input.scss 2:38 root stylesheet <===> ================================================================================ <===> function/rest/single/input.scss -c {d: join(1/2, 3/4...)} +@use "sass:list"; +c {d: list.join(1/2, 3/4...)} <===> function/rest/single/output.css c { @@ -109,10 +112,10 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2, 3/4...)} - | ^^^ +2 | c {d: list.join(1/2, 3/4...)} + | ^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. @@ -121,15 +124,16 @@ Recommendation: math.div(3, 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2, 3/4...)} - | ^^^ +2 | c {d: list.join(1/2, 3/4...)} + | ^^^ ' - input.scss 1:17 root stylesheet + input.scss 2:22 root stylesheet <===> ================================================================================ <===> function/rest/list/input.scss -c {d: join(1/2 3/4...)} +@use "sass:list"; +c {d: list.join(1/2 3/4...)} <===> function/rest/list/output.css c { @@ -144,10 +148,10 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2 3/4...)} - | ^^^^^^^ +2 | c {d: list.join(1/2 3/4...)} + | ^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet DEPRECATION WARNING: Using / for division is deprecated and will be removed in Dart Sass 2.0.0. @@ -156,15 +160,16 @@ Recommendation: math.div(3, 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2 3/4...)} - | ^^^^^^^ +2 | c {d: list.join(1/2 3/4...)} + | ^^^^^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet <===> ================================================================================ <===> function/rest/map/input.scss -c {d: join(("list1": 1/2, "list2": 3/4)...)} +@use "sass:list"; +c {d: list.join(("list1": 1/2, "list2": 3/4)...)} <===> function/rest/map/output.css c { @@ -179,10 +184,10 @@ Recommendation: math.div(1, 2) or calc(1 / 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(("list1": 1/2, "list2": 3/4)...)} - | ^^^ +2 | c {d: list.join(("list1": 1/2, "list2": 3/4)...)} + | ^^^ ' - input.scss 1:22 root stylesheet + input.scss 2:27 root stylesheet DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. @@ -191,15 +196,16 @@ Recommendation: math.div(3, 4) or calc(3 / 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(("list1": 1/2, "list2": 3/4)...)} - | ^^^ +2 | c {d: list.join(("list1": 1/2, "list2": 3/4)...)} + | ^^^ ' - input.scss 1:36 root stylesheet + input.scss 2:41 root stylesheet <===> ================================================================================ <===> function/rest/kwargs/input.scss -c {d: join(1/2..., ("list2": 3/4)...)} +@use "sass:list"; +c {d: list.join(1/2..., ("list2": 3/4)...)} <===> function/rest/kwargs/output.css c { @@ -214,10 +220,10 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2..., ("list2": 3/4)...)} - | ^^^ +2 | c {d: list.join(1/2..., ("list2": 3/4)...)} + | ^^^ ' - input.scss 1:12 root stylesheet + input.scss 2:17 root stylesheet DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. @@ -226,10 +232,10 @@ Recommendation: math.div(3, 4) or calc(3 / 4) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | c {d: join(1/2..., ("list2": 3/4)...)} - | ^^^ +2 | c {d: list.join(1/2..., ("list2": 3/4)...)} + | ^^^ ' - input.scss 1:30 root stylesheet + input.scss 2:35 root stylesheet <===> ================================================================================ diff --git a/spec/values/numbers/divide/slash_free/return.hrx b/spec/values/numbers/divide/slash_free/return.hrx index 36bbbc80c8..3d9d3ee1c5 100644 --- a/spec/values/numbers/divide/slash_free/return.hrx +++ b/spec/values/numbers/divide/slash_free/return.hrx @@ -25,7 +25,8 @@ More info and automated migrator: https://sass-lang.com/d/slash-div <===> ================================================================================ <===> built_in/input.scss -a {b: nth(3 1/2 4, 2)} +@use "sass:list"; +a {b: list.nth(3 1/2 4, 2)} <===> built_in/output.css a { @@ -40,7 +41,7 @@ Recommendation: math.div(1, 2) More info and automated migrator: https://sass-lang.com/d/slash-div , -1 | a {b: nth(3 1/2 4, 2)} - | ^^^^^^^^^^^^^^^ +2 | a {b: list.nth(3 1/2 4, 2)} + | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/values/numbers/divide/slash_separated.hrx b/spec/values/numbers/divide/slash_separated.hrx index 9d6e03ce0a..28b6c255ff 100644 --- a/spec/values/numbers/divide/slash_separated.hrx +++ b/spec/values/numbers/divide/slash_separated.hrx @@ -91,7 +91,8 @@ c { <===> ================================================================================ <===> list/argument/function/built_in/input.scss -c {d: join(1 2/3 4, ())} +@use "sass:list"; +c {d: list.join(1 2/3 4, ())} <===> list/argument/function/built_in/output.css c {