forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_list.scss
94 lines (78 loc) · 2.14 KB
/
_list.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// Copyright IBM Corp. 2016, 2018
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
//-----------------------------
// List
//-----------------------------
@use '../../config' as *;
@use '../../spacing' as *;
@use '../../theme' as *;
@use '../../type';
@use '../../utilities/component-reset';
@use '../../utilities/convert';
/// List styles
/// @access public
/// @group list
@mixin list {
.#{$prefix}--list--nested,
.#{$prefix}--list--unordered,
.#{$prefix}--list--ordered,
.#{$prefix}--list--ordered--native {
@include component-reset.reset;
@include type.type-style('body-01');
list-style: none;
}
.#{$prefix}--list--expressive,
.#{$prefix}--list--expressive .#{$prefix}--list--nested {
@include type.type-style('body-02');
}
.#{$prefix}--list--ordered--native {
list-style: decimal;
}
.#{$prefix}--list__item {
color: $text-primary;
}
.#{$prefix}--list--nested {
margin-left: convert.rem(32px);
}
.#{$prefix}--list--nested .#{$prefix}--list__item {
padding-left: $spacing-02;
}
.#{$prefix}--list--ordered:not(.#{$prefix}--list--nested) {
counter-reset: item;
}
.#{$prefix}--list--ordered:not(.#{$prefix}--list--nested)
> .#{$prefix}--list__item {
position: relative;
}
.#{$prefix}--list--ordered:not(.#{$prefix}--list--nested)
> .#{$prefix}--list__item::before {
position: absolute;
left: convert.rem(-24px);
content: counter(item) '.';
counter-increment: item;
}
.#{$prefix}--list--ordered.#{$prefix}--list--nested,
.#{$prefix}--list--ordered--native.#{$prefix}--list--nested {
list-style-type: lower-latin;
}
.#{$prefix}--list--unordered > .#{$prefix}--list__item {
position: relative;
&::before {
position: absolute;
left: calc(-1 * #{$spacing-05});
// – en dash
content: '\002013';
}
}
.#{$prefix}--list--unordered.#{$prefix}--list--nested
> .#{$prefix}--list__item::before {
// offset to account for smaller ▪ vs –
left: calc(-1 * #{$spacing-04});
// ▪ square
content: '\0025AA';
}
}