forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_structured-list.scss
230 lines (197 loc) · 6.2 KB
/
_structured-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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
//
// 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.
//
@use '../../config' as *;
@use '../../feature-flags' as *;
@use '../../type' as *;
@use '../../motion';
@use '../../theme' as *;
@use '../../utilities/focus-outline' as *;
@use '../../utilities/skeleton' as *;
@use '../../utilities/high-contrast-mode' as *;
@use '../../utilities/convert' as *;
@use 'mixins' as *;
@mixin structured-list {
.#{$prefix}--structured-list--selection .#{$prefix}--structured-list-td,
.#{$prefix}--structured-list--selection .#{$prefix}--structured-list-th {
@include padding--data-structured-list;
}
@if enabled('enable-v11-release') {
.#{$prefix}--structured-list-row--focused-within {
@include focus-outline('outline');
}
} @else {
.#{$prefix}--structured-list-input {
display: none;
}
}
.#{$prefix}--structured-list {
@include reset;
display: table;
width: 100%;
@if not enabled('enable-v11-release') {
margin-bottom: 5rem;
}
background-color: transparent;
border-collapse: collapse;
border-spacing: 0;
overflow-x: auto;
// Condensed list
&.#{$prefix}--structured-list--condensed .#{$prefix}--structured-list-td,
&.#{$prefix}--structured-list--condensed .#{$prefix}--structured-list-th {
@include padding-td--condensed;
//8px padding all over
}
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-td:first-of-type,
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-th:first-of-type {
padding-left: 1rem;
// specs require 16px spacing between columns
// 8px side padding between col creates 16 px, with exception of 1st col, which needs an override to be 16px
}
// Flush list
&.#{$prefix}--structured-list--flush
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-td,
&.#{$prefix}--structured-list--flush
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-th,
&.#{$prefix}--structured-list--flush
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-td:first-of-type,
&.#{$prefix}--structured-list--flush
.#{$prefix}--structured-list-row
.#{$prefix}--structured-list-th:first-of-type {
padding-right: 1rem;
padding-left: 0;
}
}
.#{$prefix}--structured-list-row {
display: table-row;
border-bottom: 1px solid $border-subtle;
transition: background-color motion.$duration-fast-02
motion.motion(standard, productive);
}
.#{$prefix}--structured-list--selection
.#{$prefix}--structured-list-row:hover:not(.#{$prefix}--structured-list-row--header-row):not(.#{$prefix}--structured-list-row--selected) {
border-bottom: 1px solid $background-hover;
background-color: $background-hover;
cursor: pointer;
}
.#{$prefix}--structured-list-row.#{$prefix}--structured-list-row--selected {
background-color: $background-selected;
}
.#{$prefix}--structured-list-row.#{$prefix}--structured-list-row--header-row {
border-bottom: 1px solid $background-selected;
cursor: inherit;
}
@if not enabled('enable-v11-release') {
.#{$prefix}--structured-list-row:focus:not(.#{$prefix}--structured-list-row--header-row) {
@include focus-outline('outline');
}
}
.#{$prefix}--structured-list--selection
.#{$prefix}--structured-list-row:hover:not(.#{$prefix}--structured-list-row--header-row)
> .#{$prefix}--structured-list-td,
.#{$prefix}--structured-list-row.#{$prefix}--structured-list-row--selected
> .#{$prefix}--structured-list-td {
color: $text-primary;
}
.#{$prefix}--structured-list--selection
.#{$prefix}--structured-list-row:hover:not(.#{$prefix}--structured-list-row--header-row)
> .#{$prefix}--structured-list-td {
@if enabled('enable-v11-release') {
border-top: 1px solid $border-subtle;
} @else {
border-top: 1px solid $layer;
}
}
.#{$prefix}--structured-list-thead {
display: table-header-group;
vertical-align: middle;
}
.#{$prefix}--structured-list-th {
@include reset;
@include padding-th;
@include type-style('heading-compact-01');
display: table-cell;
height: rem(40px);
color: $text-primary;
font-weight: 600;
text-align: left;
text-transform: $structured-list-text-transform;
vertical-align: top;
}
.#{$prefix}--structured-list-tbody {
display: table-row-group;
vertical-align: middle;
}
.#{$prefix}--structured-list-td {
@include reset;
@include type-style('body-01');
@include padding-td;
position: relative;
display: table-cell;
max-width: 36rem;
color: $text-secondary;
@if enabled('enable-v11-release') {
border-top: 1px solid $border-subtle;
}
transition: color motion.$duration-fast-02
motion.motion(standard, productive);
}
.#{$prefix}--structured-list-content--nowrap {
white-space: nowrap;
}
.#{$prefix}--structured-list-svg {
display: inline-block;
fill: transparent;
transition: all motion.$duration-fast-02 motion.motion(standard, productive);
vertical-align: middle;
}
.#{$prefix}--structured-list-input:checked
+ .#{$prefix}--structured-list-row
.#{$prefix}--structured-list-svg,
.#{$prefix}--structured-list-input:checked
+ .#{$prefix}--structured-list-td
.#{$prefix}--structured-list-svg {
fill: $icon-primary;
}
// Skeleton State
.#{$prefix}--structured-list.#{$prefix}--skeleton {
.#{$prefix}--structured-list-th {
&:first-child {
width: 8%;
}
&:nth-child(3n + 2) {
width: 30%;
}
&:nth-child(3n + 3) {
width: 15%;
}
}
span {
@include skeleton;
display: block;
width: 75%;
height: 1rem;
}
}
.#{$prefix}--structured-list.#{$prefix}--structured-list--selection.#{$prefix}--skeleton
.#{$prefix}--structured-list-th:first-child {
width: 5%;
span {
display: none;
}
}
// Windows HCM fix
.#{$prefix}--structured-list-input:checked
+ .#{$prefix}--structured-list-td
.#{$prefix}--structured-list-svg {
@include high-contrast-mode('icon-fill');
}
}