mirror of
https://github.com/sass/sass.git
synced 2024-09-21 02:27:30 +00:00
[Media Logic] Mark as accepted (#3360)
This makes a few changes that came up during implementation. See the changelog for details.
This commit is contained in:
parent
1b14a802d8
commit
bcfe3cbb90
13
accepted/media-logic.changes.md
Normal file
13
accepted/media-logic.changes.md
Normal file
@ -0,0 +1,13 @@
|
||||
## Draft 1.1
|
||||
|
||||
* In the `MediaQuery` production, don't allow an `Interpolation` to be followed
|
||||
by `(MediaAnd* | MediaOr*)` since `Interpolation` is ambiguous with
|
||||
`MediaType`.
|
||||
|
||||
* Forbid whitespace in the `MediaNot`, `MediaAnd`, and `MediaOr` productions.
|
||||
|
||||
* Fix the link for `CssMediaQuery`.
|
||||
|
||||
## Draft 1
|
||||
|
||||
* Initial draft.
|
@ -1,6 +1,6 @@
|
||||
# Media Logic: Draft 1
|
||||
# Media Logic: Draft 1.1
|
||||
|
||||
*([Issue](https://github.com/sass/sass/issues/2538))*
|
||||
*([Issue](https://github.com/sass/sass/issues/2538), [Changelog](media-logic.changes.md))*
|
||||
|
||||
This proposal adds support for the full [Media Queries Level 4] syntax for media
|
||||
conditions, including arbitrary boolean logic using `and`, `or`, and `not`.
|
||||
@ -61,17 +61,17 @@ all identifiers matched case-insensitively):
|
||||
|
||||
<x><pre>
|
||||
**MediaQuery** ::= MediaNot
|
||||
  | MediaOrInterp (MediaAnd* | MediaOr*)
|
||||
  | MediaInParens (MediaAnd* | MediaOr*)
|
||||
  | MediaType ('and' MediaNot | MediaAnd*)
|
||||
**MediaType** ::= [InterpolatedIdentifier] [InterpolatedIdentifier]¹?
|
||||
**MediaNot** ::= 'not' MediaOrInterp
|
||||
**MediaAnd** ::= 'and' MediaOrInterp
|
||||
**MediaOr** ::= 'or' MediaOrInterp
|
||||
**MediaNot**² ::= 'not' MediaOrInterp
|
||||
**MediaAnd**² ::= 'and' MediaOrInterp
|
||||
**MediaOr**² ::= 'or' MediaOrInterp
|
||||
**MediaOrInterp** ::= Interpolation | MediaInParens
|
||||
**MediaInParens** ::= '(' Expression² ')'
|
||||
  | '(' Expression² [\<mf-comparison>] Expression² ')'
|
||||
  | '(' Expression² [\<mf-lt>] Expression² [\<mf-lt>] Expression² ')'
|
||||
  | '(' Expression² [\<mf-gt>] Expression² [\<mf-gt>] Expression² ')'
|
||||
**MediaInParens** ::= '(' Expression³ ')'
|
||||
  | '(' Expression³ [\<mf-comparison>] Expression³ ')'
|
||||
  | '(' Expression³ [\<mf-lt>] Expression³ [\<mf-lt>] Expression³ ')'
|
||||
  | '(' Expression³ [\<mf-gt>] Expression³ [\<mf-gt>] Expression³ ')'
|
||||
  | '(' MediaNot ')'
|
||||
  | '(' MediaInParens (MediaAnd* | MediaOr*) ')'
|
||||
</pre></x>
|
||||
@ -83,7 +83,10 @@ all identifiers matched case-insensitively):
|
||||
|
||||
1. This `InterpolatedIdentifier` may not be the identifier `"and"`.
|
||||
|
||||
2. These `Expression`s may not:
|
||||
2. No whitespace is allowed between the identifier and the `MediaOrInterp` in
|
||||
these productions.
|
||||
|
||||
3. These `Expression`s may not:
|
||||
|
||||
* Contain binary operator expressions with the operators `=`, `>`, `>=`, `<`,
|
||||
or `<=`, except within parentheses (including function calls and map
|
||||
@ -98,7 +101,7 @@ all identifiers matched case-insensitively):
|
||||
Replace the definition of the [`CssMediaQuery`] production with the following (with
|
||||
all identifiers matched case-insensitively):
|
||||
|
||||
[`MediaQuery`]: ../spec/at-rules/media.md#css
|
||||
[`CssMediaQuery`]: ../spec/at-rules/media.md#css
|
||||
|
||||
<x><pre>
|
||||
**CssMediaQuery** ::= CssMediaCondition
|
Loading…
Reference in New Issue
Block a user