Skip to content

[css-cascade] Clarify how @import behaves with invalid rules #5313 #5358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions css-cascade-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ Importing Style Sheets: the ''@import'' rule</h2>
then it doesn't apply to the imported stylesheet.

* If a feature relies on the relative ordering of two or more constructs in a stylesheet
(such as the requirement that ''@charset'' must not have any other content preceding it),
(such as the requirement that ''@namespace'' rules must not have any other rules other than
''@import'' preceding it),
it only applies between constructs in the same stylesheet.

<p class='example'>
For example, declarations in style rules from imported stylesheets interact with the cascade
as if they were written literally into the stylesheet at the point of the ''@import''.

Any ''@import'' rules must precede all other at-rules and style rules in a style sheet
(besides ''@charset'', which must be the first thing in the style sheet if it exists),
or else the ''@import'' rule is invalid.
Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
(with ''@charset'' counting as an invalid rule), or else the ''@import'' rule is invalid.
The syntax of ''@import'' is:

<pre class='prod'>@import [ <<url>> | <<string>> ] <<media-query-list>>? ;</pre>
Expand Down
8 changes: 4 additions & 4 deletions css-cascade-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Importing Style Sheets: the ''@import'' rule</h2>
then it doesn't apply to the imported stylesheet.

* If a feature relies on the relative ordering of two or more constructs in a stylesheet
(such as the requirement that ''@charset'' must not have any other content preceding it),
(such as the requirement that ''@namespace'' rules must not have any other rules other than
''@import'' preceding it),
it only applies between constructs in the same stylesheet.

<p class='example'>
Expand All @@ -89,9 +90,8 @@ Importing Style Sheets: the ''@import'' rule</h2>
Similarly, style rules in a stylesheet imported into a scoped stylesheet
are scoped in the same way.

Any ''@import'' rules must precede all other at-rules and style rules in a style sheet
(besides ''@charset'', which must be the first thing in the style sheet if it exists),
or else the ''@import'' rule is invalid.
Any ''@import'' rules must precede all other valid at-rules and style rules in a style sheet
(with ''@charset'' counting as an invalid rule), or else the ''@import'' rule is invalid.
The syntax of ''@import'' is:

<pre class='prod'>
Expand Down