1
- <h1>CSS Cascading and Inheritance Level 4 </h1>
1
+ <h1>CSS Cascading and Inheritance Level 3 </h1>
2
2
3
3
<pre class='metadata'>
4
4
Shortname : css-cascade
@@ -40,13 +40,27 @@ Introduction</h2>
40
40
Importing Style Sheets: the ''@import'' rule</h2>
41
41
42
42
The <dfn>@import</dfn> rule allows users to import style rules from other style sheets.
43
+ If an ''@import'' rule refers to a valid stylesheet,
44
+ user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule.
45
+
46
+ <p class='example'>
47
+ For example, declarations in style rules from imported stylesheets interact with the cascade
48
+ as if they were written literally into the stylesheet at the point of the ''@import'' .
49
+ Similarly, style rules in a stylesheet imported into a scoped stylesheet
50
+ are scoped in the same way.
51
+
43
52
Any ''@import'' rules must precede all other at-rules and style rules in a style sheet
44
53
(besides ''@charset'' , which must be the first thing in the style sheet if it exists),
45
54
or else the ''@import'' rule is invalid.
46
55
The syntax of ''@import'' is:
47
56
48
57
<pre class='prod'>@import [ <<url>> | <<string>> ] <<media-query-list>> ? ;</pre>
49
58
59
+ Where the <<url>> or <<string>> gives the URL of the style sheet to be imported,
60
+ and the optional <<media-query-list>>
61
+ (the <dfn>import conditions</dfn> )
62
+ states the conditions under which it applies.
63
+
50
64
If a <<string>> is provided,
51
65
it must be interpreted as a url with the same value.
52
66
@@ -61,20 +75,9 @@ Importing Style Sheets: the ''@import'' rule</h2>
61
75
</pre>
62
76
</div>
63
77
64
- If an ''@import'' rule refers to a valid stylesheet,
65
- user agents must treat the contents of the stylesheet as if they were written in place of the ''@import'' rule.
66
-
67
- <p class='example'>
68
- For example, declarations in style rules from imported stylesheets interact with the cascade
69
- as if they were written literally into the stylesheet at the point of the ''@import'' .
70
- Similarly, style rules in a stylesheet imported into a scoped stylesheet
71
- are scoped in the same way.
72
-
73
- An ''@import'' rule can be media-dependent:
74
- such media-dependent imports include a comma-separated list of “media queries” after the URI,
75
- which specify to which media the imported style sheet applies.
76
- In the absence of any media query, the import is unconditional.
77
- (Specifying ''@media/all'' for the medium has the same effect.)
78
+ The <a>import conditions</a> allow the import to be media-dependent.
79
+ In the absence of any <a>import conditions</a> , the import is unconditional.
80
+ (Specifying ''@media/all'' for the <<media-query-list>> has the same effect.)
78
81
79
82
The evaluation and full syntax of the expressions after the URL
80
83
is defined by the <a href="http://www.w3.org/TR/css3-mediaqueries/">Media Queries</a> specification [[!MEDIAQ]] .
0 commit comments