Skip to content

Commit 658068b

Browse files
Merge pull request #1527 from ASU/uds-1636
fix(unity-bootstrap-theme): standardize all list types margins
2 parents b282e4e + 9cccf5e commit 658068b

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

packages/unity-bootstrap-theme/src/scss/extends/_list.scss

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
--list-padding-top: 0;
66
--list-padding-right: 0;
77
--list-padding-bottom: 3rem;
8-
--list-padding-left: 2rem;
8+
--list-padding-left: 3rem;
99
--list-list-style: none;
1010
--li-before-line-height: 1.5rem;
1111

@@ -32,6 +32,10 @@
3232
color: var(--li-before-color);
3333
background-color: var(--li-before-background-color);
3434
line-height: var(--li-before-line-height);
35+
left: -3rem;
36+
text-align: right;
37+
position: absolute;
38+
width: 2rem;
3539
}
3640
}
3741
}
@@ -44,7 +48,6 @@ ul.uds-list ul {
4448
--list-padding-top: 1rem;
4549
--list-padding-right: 0;
4650
--list-padding-bottom: 0;
47-
--list-padding-left: 1.5rem;
4851
--list-list-style: none;
4952
}
5053

@@ -101,8 +104,6 @@ ul.uds-list,
101104
& > li:before{
102105
--li-before-font-size: 2rem;
103106
vertical-align: middle;
104-
padding-right: 1.25rem; // Magic number.;
105-
margin-left: -2rem;
106107
}
107108
}
108109

@@ -162,7 +163,6 @@ ul.uds-list {
162163
&.fa-ul {
163164
@include uds-list-spacing;
164165

165-
--list-padding-left: 2.25rem; // Avoid icon clipping.
166166
margin-left: 0rem;
167167
margin-bottom: 0rem;
168168
li .fa-li {
@@ -197,17 +197,10 @@ ol.uds-list,
197197
& > li:before {
198198
--li-before-font-size: 1rem;
199199
counter-increment: listcounter;
200-
padding-right: .75rem;
201-
margin-left: -1.9rem;
202-
}
203-
204-
// Adjust indent for double digits.
205-
li:nth-of-type(9) ~ li:before {
206-
margin-left: -2.4rem;
207-
}
208-
// Adjust indent for triple digits.
209-
li:nth-of-type(99) ~ li:before {
210-
margin-left: -2.9rem;
200+
left: -3rem;
201+
text-align: right;
202+
position: absolute;
203+
width: 2rem;
211204
}
212205

213206
// Step List styles
@@ -236,10 +229,13 @@ ol.uds-list,
236229
--li-before-color: #{$uds-color-base-gray-1};
237230
--li-before-font-size: 1.25rem;
238231
border-radius: 50rem;
239-
padding: 0.5rem 0.8rem; // Following is more true to XD step circle sizing, but looks less rounded: padding: 0.4rem 0.6rem;
232+
padding: 0.4rem 0.8rem;
240233
margin-right: 2rem;
241234
margin-left: -4.5rem;
242235
font-weight: bold;
236+
position: absolute;
237+
left: auto;
238+
width: auto;
243239
}
244240
}
245241

packages/unity-react-core/src/components/List/List.stories.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,29 @@ const decorator = (story:StoryFn, context: StoryContext) =>
1010
export default {
1111
title: "Components/List",
1212
component: List,
13+
args: {
14+
multiplier: 1,
15+
},
16+
argTypes: {
17+
multiplier: {
18+
name: "Multiplier",
19+
description: "Storybook control - Number of times to repeat the items.",
20+
control: {
21+
type: "number",
22+
min: 1,
23+
max: 111,
24+
step: 1,
25+
},
26+
},
27+
},
1328
decorators: [decorator]
1429
};
1530

16-
const listTemplate = (args: ListProps) => {
17-
return <List {...args} />
31+
const listTemplate = (args: ListProps & { multiplier: number }) => {
32+
const multiplier = args.multiplier > 0 ? args.multiplier : 1;
33+
return (
34+
<List {...args} items={new Array(multiplier).fill(args.items).flat()} />
35+
);
1836
};
1937

2038
export const UnorderedList = {

0 commit comments

Comments
 (0)