mirror of
https://github.com/sass/sass.git
synced 2024-09-21 18:47:25 +00:00
Add the syntax definition for the import rule (#3294)
This commit is contained in:
parent
066d10831d
commit
012f79f373
@ -6,6 +6,23 @@ still supported for backwards-compatibility.
|
||||
|
||||
[`@use` rule]: use.md
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Syntax](#syntax)
|
||||
* [Semantics](#semantics)
|
||||
|
||||
## Syntax
|
||||
|
||||
<x><pre>
|
||||
**ImportRule** ::= '@import' ImportArgument (',' ImportArgument)*
|
||||
**ImportArgument** ::= ImportUrl ImportSupportsDeclaration? [MediaQueryList][]?
|
||||
**ImportUrl** ::= QuotedString | [InterpolatedUrl][]
|
||||
**ImportSupportsDeclaration** ::= 'supports(' SupportsDeclaration ')'
|
||||
</pre></x>
|
||||
|
||||
[InterpolatedUrl]: ../syntax.md#InterpolatedUrl
|
||||
[MediaQueryList]: media.md#syntax
|
||||
|
||||
## Semantics
|
||||
|
||||
To execute an `@import` rule `rule`:
|
||||
@ -16,8 +33,9 @@ To execute an `@import` rule `rule`:
|
||||
|
||||
* `argument`'s URL string begins with `http://` or `https://`.
|
||||
* `argument`'s URL string ends with `.css`.
|
||||
* `argument`'s URL string is syntactically defined as a `url()`.
|
||||
* `argument` has a media query and/or a supports query.
|
||||
* `argument`'s URL is an `InterpolatedUrl`.
|
||||
* `argument` has an `ImportSupportsDeclaration`.
|
||||
* `argument` has a `MediaQueryList`.
|
||||
|
||||
> Note that this means that imports that explicitly end with `.css` are
|
||||
> treated as plain CSS `@import` rules, rather than importing stylesheets as
|
||||
|
@ -7,6 +7,7 @@
|
||||
* [Vendor Prefix](#vendor-prefix)
|
||||
* [Grammar](#grammar)
|
||||
* [`InterpolatedIdentifier`](#interpolatedidentifier)
|
||||
* [`InterpolatedUrl`](#interpolatedurl)
|
||||
* [`Name`](#name)
|
||||
* [`SpecialFunctionExpression`](#specialfunctionexpression)
|
||||
* [`PseudoSelector`](#pseudoselector)
|
||||
@ -50,6 +51,17 @@ as the *unprefixed identifier*.
|
||||
|
||||
No whitespace is allowed between components of an `InterpolatedIdentifier`.
|
||||
|
||||
### `InterpolatedUrl`
|
||||
|
||||
<x><pre>
|
||||
**InterpolatedUrl** ::= 'url(' (QuotedString | InterpolatedUnquotedUrlContents) ')'
|
||||
**InterpolatedUnquotedUrlContents** ::= ([unescaped url contents][] | [escape][] | Interpolation)*
|
||||
</pre></x>
|
||||
|
||||
[unescaped url contents]: https://www.w3.org/TR/css-syntax-3/#url-token-diagram
|
||||
|
||||
No whitespace is allowed between components of an `InterpolatedUnquotedUrlContents`.
|
||||
|
||||
### `Name`
|
||||
|
||||
<x><pre>
|
||||
|
Loading…
Reference in New Issue
Block a user