8000 [css3-lists] Add :dir() pseudoclasses to the default stylesheet to ha… · w3c/csswg-drafts@922525b · GitHub
Skip to content

Commit 922525b

Browse files
committed
[css3-lists] Add :dir() pseudoclasses to the default stylesheet to handle *-left/right stuff properly.
1 parent 7b96554 commit 922525b

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

css3-lists/Overview.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,9 +2107,15 @@ <h2 id=ua-stylesheet><span class=secno>10. </span> Sample style sheet for
21072107
ol, ul {
21082108
display: block;
21092109
margin: 1em 0;
2110-
padding-left: 40px;
21112110
marker-side: list-container;
21122111
}
2112+
2113+
ol:dir(ltr), ul:dir(ltr) {
2114+
padding-left: 40px;
2115+
}
2116+
ol:dir(rtl), ul:dir(rtl) {
2117+
padding-right: 40px;
2118+
}
21132119

21142120
ol ol, ol ul, ul ul, ul ol {
21152121
margin-top: 0;
@@ -2122,11 +2128,17 @@ <h2 id=ua-stylesheet><span class=secno>10. </span> Sample style sheet for
21222128

21232129
li::marker {
21242130
display: inline;
2125-
margin-right: 1em;
21262131
text-align: end;
21272132
unicode-bidi: isolate;
21282133
/* 'position' computes to "static" or "marker" depending on list-style-position */
21292134
}
2135+
2136+
li:dir(ltr)::marker {
2137+
margin-right: 1em;
2138+
}
2139+
li:dir(rtl)::marker {
2140+
margin-left: 1em;
2141+
}
21302142
</pre>
21312143
<!-- ====================================================================== -->
21322144

css3-lists/Overview.src.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,9 +1539,15 @@ <h2 id='ua-stylesheet'>
15391539
ol, ul {
15401540
display: block;
15411541
margin: 1em 0;
1542-
padding-left: 40px;
15431542
marker-side: list-container;
15441543
}
1544+
1545+
ol:dir(ltr), ul:dir(ltr) {
1546+
padding-left: 40px;
1547+
}
1548+
ol:dir(rtl), ul:dir(rtl) {
1549+
padding-right: 40px;
1550+
}
15451551

15461552
ol ol, ol ul, ul ul, ul ol {
15471553
margin-top: 0;
@@ -1554,11 +1560,17 @@ <h2 id='ua-stylesheet'>
15541560

15551561
li::marker {
15561562
display: inline;
1557-
margin-right: 1em;
15581563
text-align: end;
15591564
unicode-bidi: isolate;
15601565
/* 'position' computes to "static" or "marker" depending on list-style-position */
15611566
}
1567+
1568+
li:dir(ltr)::marker {
1569+
margin-right: 1em;
1570+
}
1571+
li:dir(rtl)::marker {
1572+
margin-left: 1em;
1573+
}
15621574
</pre>
15631575

15641576
<!-- ====================================================================== -->

0 commit comments

Comments
 (0)