Skip to content

Commit 1e3d62b

Browse files
authored
feat(utilities): update .u-list-style-* styling (#213)
1 parent 4fd890c commit 1e3d62b

File tree

2 files changed

+76
-11
lines changed

2 files changed

+76
-11
lines changed

demo/utilities/list-style/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
><a class="u-fg-inherit" href="..">Utilities</a
3030
><span> / List Style</span>
3131
</h1>
32+
<ul class="c-ctl c-ctl--header">
33+
<li class="c-ctl__item">
34+
<fieldset class="c-chk">
35+
<input class="c-chk__input js-rtl" id="nav.ctl.rtl" type="checkbox">
36+
<label class="c-chk__label c-chk__label--toggle" for="nav.ctl.rtl">RTL</label>
37+
</fieldset>
38+
</li>
39+
</ul>
3240
</header>
3341
<main class="c-main c-main--page">
3442
<h1 class="c-main__title">Utilities: List Style</h1>
@@ -141,5 +149,10 @@ <h2 class="u-fs-lg u-mb-sm"><code class="c-code">.u-list-style-upper-roman</code
141149
</main>
142150
<script src="//zendeskgarden.github.io/index.js"></script>
143151
<script src="../../forms/checkbox/index.js"></script>
152+
<script>
153+
$(document).ready(function() {
154+
Garden.rtlClasses.push('[class^="u-list-style-"]');
155+
});
156+
</script>
144157
</body>
145158
</html>

packages/utilities/src/list-style.css

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,76 @@
88
@import '@zendeskgarden/css-variables';
99

1010
/* stylelint-disable declaration-no-important */
11-
.u-list-style-circle { list-style: circle inside !important; }
11+
.u-list-style-circle {
12+
list-style: circle outside !important;
13+
}
1214

13-
.u-list-style-decimal { list-style: decimal inside !important; }
15+
.u-list-style-decimal {
16+
list-style: decimal outside !important;
17+
}
1418

15-
/* stylelint-disable-next-line max-line-length */
16-
.u-list-style-decimal-leading-zero { list-style: decimal-leading-zero inside !important; }
19+
.u-list-style-decimal-leading-zero {
20+
list-style: decimal-leading-zero outside !important;
21+
}
1722

18-
.u-list-style-disc { list-style: disc inside !important; }
23+
.u-list-style-disc {
24+
list-style: disc outside !important;
25+
}
1926

20-
.u-list-style-lower-alpha { list-style: lower-alpha inside !important; }
27+
.u-list-style-lower-alpha {
28+
list-style: lower-alpha outside !important;
29+
}
2130

22-
.u-list-style-lower-roman { list-style: lower-roman inside !important; }
31+
.u-list-style-lower-roman {
32+
list-style: lower-roman outside !important;
33+
}
2334

24-
.u-list-style-none { list-style: none inside !important; }
35+
.u-list-style-none {
36+
list-style: none outside !important;
37+
}
2538

26-
.u-list-style-square { list-style: square inside !important; }
39+
.u-list-style-square {
40+
list-style: square outside !important;
41+
}
2742

28-
.u-list-style-upper-alpha { list-style: upper-alpha inside !important; }
43+
.u-list-style-upper-alpha {
44+
list-style: upper-alpha outside !important;
45+
}
2946

30-
.u-list-style-upper-roman { list-style: upper-roman inside !important; }
47+
.u-list-style-upper-roman {
48+
list-style: upper-roman outside !important;
49+
}
3150
/* stylelint-enable declaration-no-important */
51+
52+
[class^='u-list-style-'] {
53+
margin-left: 24px;
54+
padding: 0;
55+
}
56+
57+
[class^='u-list-style-'].is-rtl {
58+
direction: rtl;
59+
margin-right: 24px;
60+
margin-left: 0;
61+
}
62+
63+
.u-list-style-decimal > li,
64+
.u-list-style-decimal-leading-zero > li,
65+
.u-list-style-lower-alpha > li,
66+
.u-list-style-lower-roman > li,
67+
.u-list-style-upper-alpha > li,
68+
.u-list-style-upper-roman > li {
69+
margin-left: -4px;
70+
padding-left: 4px;
71+
}
72+
73+
.u-list-style-decimal.is-rtl > li,
74+
.u-list-style-decimal-leading-zero.is-rtl > li,
75+
.u-list-style-lower-alpha.is-rtl > li,
76+
.u-list-style-lower-roman.is-rtl > li,
77+
.u-list-style-upper-alpha.is-rtl > li,
78+
.u-list-style-upper-roman.is-rtl > li {
79+
margin-right: -4px;
80+
margin-left: 0;
81+
padding-right: 4px;
82+
padding-left: 0;
83+
}

0 commit comments

Comments
 (0)