Skip to content

Commit b261d87

Browse files
committed
Add u-listReset
1 parent 684dfca commit b261d87

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SUIT CSS list utilities
1313

1414
## Available classes
1515

16+
* `u-listReset` - Remove default margin and padding
1617
* `u-listIndent` - Set the left indent. Default is `40px` as found in browser
1718
defaults
1819
* `u-listNone` - Remove list style

lib/list.css

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
--list-indentSize: 40px;
77
}
88

9+
/*
10+
* Remove browser default margin and padding. Useful for setting a base
11+
* on components (e.g navigation) when a reset like suitcss-base is not in use.
12+
*/
13+
14+
.u-listReset {
15+
margin-bottom: 0;
16+
margin-top: 0;
17+
padding-left: 0;
18+
}
19+
920
/*
1021
* Set the left indent. Browser default is 40px
1122
*/

test/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414
<div class="Test">
1515
<h1 class="Test-title">SUIT CSS: <a href="https://github.com/simonsmith/suit-utils-flex">list</a> tests</h1>
1616

17+
<h2 class="Test-describe">.u-listReset</h2>
18+
<h3 class="Test-it">it should remove default margin and padding on parent list</h3>
19+
<div class="Test-run dev-highlight">
20+
<ul class="u-listReset">
21+
<li>ul item 1</li>
22+
<li>ul item 2</li>
23+
<li>
24+
<ul>
25+
<li>&gt; ul item 1</li>
26+
<li>&gt; ul item 2</li>
27+
</ul>
28+
</li>
29+
<li>ul item 3</li>
30+
</ul>
31+
</div>
32+
1733
<h2 class="Test-describe">.u-listNone</h2>
1834
<h3 class="Test-it">it should not render any list style on parent list</h3>
1935
<div class="Test-run dev-highlight">

0 commit comments

Comments
 (0)