mirror of
https://github.com/sass/sass.git
synced 2024-09-21 10:37:22 +00:00
Explicitly specify underscore-insensitivity for module member names (#3866)
This commit is contained in:
parent
bf3982b0f0
commit
a46939253b
@ -156,8 +156,9 @@ Before beginning compilation:
|
||||
|
||||
* Let `name` be `signature`'s <ident-token>.
|
||||
|
||||
* If there's already a global function whose name is underscore-insensitively
|
||||
equal to `name`, continue to the next key/value pair.
|
||||
* If there's already a global function whose name is
|
||||
[underscore-insensitively] equal to `name`, continue to the next key/value
|
||||
pair.
|
||||
|
||||
* Otherwise, add a global function whose signature is `signature`. When this
|
||||
function is called:
|
||||
@ -182,6 +183,7 @@ Before beginning compilation:
|
||||
replaced with the result of [simplifying] those calculations.
|
||||
|
||||
[<ident-token>]: https://drafts.csswg.org/css-syntax-3/#ident-token-diagram
|
||||
[underscore-insensitively]: ../modules.md#underscore-insensitive
|
||||
[`SassFunction`]: value/function.d.ts.md
|
||||
[simplifying]: https://github.com/sass/sass/tree/main/spec/types/calculation.md#simplifying-a-calculation
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
* [Package Importers](#package-importers)
|
||||
* [Node Package Importer](#node-package-importer)
|
||||
* [Global Importer List](#global-importer-list)
|
||||
* [Underscore-Insensitive](#underscore-insensitive)
|
||||
* [Basename](#basename)
|
||||
* [Dirname](#dirname)
|
||||
* [Syntax](#syntax)
|
||||
@ -70,7 +71,10 @@ A new *configuration* ID is unique unless otherwise specified.
|
||||
A *module* is a collection of various properties:
|
||||
|
||||
* A set of [members](#member) that contains at most one member of any given type
|
||||
and name.
|
||||
and [underscore-insensitive] name. All lookups in this set are
|
||||
underscore-insensitive unless explicitly specified otherwise.
|
||||
|
||||
[underscore-insensitive]: #underscore-insensitive
|
||||
|
||||
> For example, a module may not have two variables named `$name`, although it
|
||||
> may contain a function and a mixin with the same name or two functions with
|
||||
@ -300,6 +304,16 @@ When the Node Package Importer is invoked with a string named `string`:
|
||||
The *global importer list* is a list of importers that's set for the entire
|
||||
duration of a Sass compilation.
|
||||
|
||||
### Underscore-Insensitive
|
||||
|
||||
If a name comparison is *underscore-insensitive*, it considers the characters
|
||||
U+002D HYPHEN-MINUS and U+005F LOW LINE to be equal to one another.
|
||||
|
||||
> Long ago, Sass only supported underscores as separators for Sass identifiers.
|
||||
> When support for hyphens was added to match CSS, they were made equivalent to
|
||||
> underscores for backwards-compatibility. This insensitivity is generally only
|
||||
> used for Sass member names, not any other identifiers.
|
||||
|
||||
### Basename
|
||||
|
||||
The *basename* of a URL is the final component of that URL's path.
|
||||
|
Loading…
Reference in New Issue
Block a user