@carbon/elements 10.27.0-rc.0 → 10.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/es/index.js +1 -1
- package/lib/index.js +48 -8
- package/package.json +12 -12
- package/scss/grid/modules/_breakpoint.scss +266 -0
- package/scss/grid/modules/_config.scss +12 -0
- package/scss/grid/modules/_mixins.scss +323 -0
- package/scss/grid/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +5 -5
- package/scss/grid/vendor/@carbon/layout/modules/generated/_spacing.scss +13 -13
- package/scss/layout/modules/generated/_fluid-spacing.scss +5 -5
- package/scss/layout/modules/generated/_spacing.scss +13 -13
- package/scss/motion/motion.scss +24 -0
- package/scss/themes/generated/_mixins.scss +9 -0
- package/scss/themes/generated/_themes.scss +20 -8
- package/scss/themes/generated/_tokens.scss +20 -7
- package/scss/themes/modules/_theme.scss +50 -0
- package/scss/themes/modules/_themes.scss +8 -0
- package/scss/themes/modules/_utilities.scss +18 -0
- package/scss/themes/modules/generated/_themes.scss +247 -0
- package/scss/type/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +5 -5
- package/scss/type/vendor/@carbon/layout/modules/generated/_spacing.scss +13 -13
- package/src/__tests__/__snapshots__/PublicAPI-test.js.snap +7 -0
- package/src/index.js +10 -1
- package/umd/index.js +48 -8
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2018, 2018
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use 'config' as *;
|
|
9
|
+
@use 'breakpoint' as *;
|
|
10
|
+
|
|
11
|
+
// -----------------------------------------------------------------------------
|
|
12
|
+
// Columns
|
|
13
|
+
// -----------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
/// Used to initialize the default properties for a column class, most notably
|
|
16
|
+
/// for setting width and default gutters when a column's breakpoint has not been
|
|
17
|
+
/// hit yet.
|
|
18
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
|
|
19
|
+
/// @param {Number} $collapsed-gutter [$grid-gutter--condensed] - The condensed mode gutter
|
|
20
|
+
/// @access private
|
|
21
|
+
/// @group @carbon/grid
|
|
22
|
+
@mixin -make-col-ready(
|
|
23
|
+
$gutter: $grid-gutter,
|
|
24
|
+
$condensed-gutter: $grid-gutter--condensed
|
|
25
|
+
) {
|
|
26
|
+
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
27
|
+
// always setting `width: 100%;`. This works because we use `flex` values
|
|
28
|
+
// later on to override this initial width.
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding-right: ($gutter / 2);
|
|
31
|
+
padding-left: ($gutter / 2);
|
|
32
|
+
|
|
33
|
+
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each
|
|
34
|
+
// side.
|
|
35
|
+
.#{$prefix}--row--condensed &,
|
|
36
|
+
.#{$prefix}--grid--condensed & {
|
|
37
|
+
padding-right: ($condensed-gutter / 2);
|
|
38
|
+
padding-left: ($condensed-gutter / 2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// For our narrow use-case, our container hangs 16px into the gutter
|
|
42
|
+
.#{$prefix}--row--narrow &,
|
|
43
|
+
.#{$prefix}--grid--narrow & {
|
|
44
|
+
padding-right: ($gutter / 2);
|
|
45
|
+
padding-left: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Define the width of the column for a given span and column count.
|
|
50
|
+
/// A width of 0 will hide the column entirely.
|
|
51
|
+
/// @param {Number} $span - The number of columns covered
|
|
52
|
+
/// @param {Number} $columns - The total number of columns available
|
|
53
|
+
/// @access private
|
|
54
|
+
/// @group @carbon/grid
|
|
55
|
+
@mixin -make-col($span, $columns) {
|
|
56
|
+
@if $span == 0 {
|
|
57
|
+
display: none;
|
|
58
|
+
} @else {
|
|
59
|
+
// Explicitly include `display: block` to override
|
|
60
|
+
display: block;
|
|
61
|
+
flex: 0 0 percentage($span / $columns);
|
|
62
|
+
// Add a `max-width` to ensure content within each column does not blow out
|
|
63
|
+
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
64
|
+
// do not appear to require this.
|
|
65
|
+
max-width: percentage($span / $columns);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// Create a column offset for a given span and column count.
|
|
70
|
+
/// @param {Number} $span - The number of columns the offset should cover
|
|
71
|
+
/// @param {Number} $columns - The total number of columns available
|
|
72
|
+
/// @access private
|
|
73
|
+
/// @group @carbon/grid
|
|
74
|
+
@mixin -make-col-offset($span, $columns) {
|
|
75
|
+
$offset: $span / $columns;
|
|
76
|
+
@if $offset == 0 {
|
|
77
|
+
margin-left: 0;
|
|
78
|
+
} @else {
|
|
79
|
+
margin-left: percentage($offset);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// Output the CSS required for all the columns in a given grid system.
|
|
84
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints in the grid system
|
|
85
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
|
|
86
|
+
/// @access private
|
|
87
|
+
/// @group @carbon/grid
|
|
88
|
+
@mixin -make-grid-columns(
|
|
89
|
+
$breakpoints: $grid-breakpoints,
|
|
90
|
+
$gutter: $grid-gutter
|
|
91
|
+
) {
|
|
92
|
+
.#{$prefix}--col {
|
|
93
|
+
@include -make-col-ready($gutter);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@each $breakpoint in map-keys($breakpoints) {
|
|
97
|
+
$infix: breakpoint-infix($breakpoint);
|
|
98
|
+
$columns: map-get(map-get($breakpoints, $breakpoint), columns);
|
|
99
|
+
|
|
100
|
+
// Allow columns to stretch full width below their breakpoints
|
|
101
|
+
@for $i from 0 through $columns {
|
|
102
|
+
.#{$prefix}--col#{$infix}-#{$i} {
|
|
103
|
+
@include -make-col-ready($gutter);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.#{$prefix}--col#{$infix},
|
|
108
|
+
.#{$prefix}--col#{$infix}--auto {
|
|
109
|
+
@include -make-col-ready($gutter);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@include breakpoint($breakpoint, $breakpoints) {
|
|
113
|
+
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
|
|
114
|
+
.#{$prefix}--col,
|
|
115
|
+
.#{$prefix}--col#{$infix} {
|
|
116
|
+
flex-basis: 0;
|
|
117
|
+
flex-grow: 1;
|
|
118
|
+
max-width: 100%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.#{$prefix}--col--auto,
|
|
122
|
+
.#{$prefix}--col#{$infix}--auto {
|
|
123
|
+
flex: 1 0 0%;
|
|
124
|
+
width: auto;
|
|
125
|
+
// Reset earlier grid tiers
|
|
126
|
+
max-width: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@for $i from 0 through $columns {
|
|
130
|
+
.#{$prefix}--col#{$infix}-#{$i} {
|
|
131
|
+
@include -make-col($i, $columns);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@for $i from 0 through ($columns - 1) {
|
|
136
|
+
@if not($infix == '') {
|
|
137
|
+
.#{$prefix}--offset#{$infix}-#{$i} {
|
|
138
|
+
@include -make-col-offset($i, $columns);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// -----------------------------------------------------------------------------
|
|
147
|
+
// Rows
|
|
148
|
+
// -----------------------------------------------------------------------------
|
|
149
|
+
|
|
150
|
+
/// Define the properties for a selector assigned to a row in the grid system.
|
|
151
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
|
|
152
|
+
/// @access private
|
|
153
|
+
/// @group @carbon/grid
|
|
154
|
+
@mixin make-row($gutter: $grid-gutter) {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-wrap: wrap;
|
|
157
|
+
margin-right: -1 * $gutter / 2;
|
|
158
|
+
margin-left: -1 * $gutter / 2;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// -----------------------------------------------------------------------------
|
|
162
|
+
// No gutter
|
|
163
|
+
// -----------------------------------------------------------------------------
|
|
164
|
+
|
|
165
|
+
/// Add `no-gutter` and `no-gutter--{start,end}` classes to the output CSS. These
|
|
166
|
+
/// classes are useful for dropping the gutter in fluid situations.
|
|
167
|
+
/// @access private
|
|
168
|
+
/// @group @carbon/grid
|
|
169
|
+
@mixin -no-gutter {
|
|
170
|
+
.#{$prefix}--no-gutter,
|
|
171
|
+
.#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
|
|
172
|
+
padding-right: 0;
|
|
173
|
+
padding-left: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.#{$prefix}--no-gutter--start,
|
|
177
|
+
.#{$prefix}--row.#{$prefix}--no-gutter--start [class*='#{$prefix}--col'] {
|
|
178
|
+
padding-left: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.#{$prefix}--no-gutter--end,
|
|
182
|
+
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
|
|
183
|
+
padding-right: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Deprecated ☠️
|
|
187
|
+
.#{$prefix}--no-gutter--left,
|
|
188
|
+
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
|
|
189
|
+
padding-left: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.#{$prefix}--no-gutter--right,
|
|
193
|
+
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
|
|
194
|
+
padding-right: 0;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// -----------------------------------------------------------------------------
|
|
199
|
+
// Hang
|
|
200
|
+
// -----------------------------------------------------------------------------
|
|
201
|
+
|
|
202
|
+
/// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
|
|
203
|
+
/// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
|
|
204
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
|
|
205
|
+
/// @access private
|
|
206
|
+
/// @group @carbon/grid
|
|
207
|
+
@mixin -hang($gutter: $grid-gutter) {
|
|
208
|
+
.#{$prefix}--hang--start {
|
|
209
|
+
padding-left: ($gutter / 2);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.#{$prefix}--hang--end {
|
|
213
|
+
padding-right: ($gutter / 2);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Deprecated ☠️
|
|
217
|
+
.#{$prefix}--hang--left {
|
|
218
|
+
padding-left: ($gutter / 2);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.#{$prefix}--hang--right {
|
|
222
|
+
padding-right: ($gutter / 2);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// -----------------------------------------------------------------------------
|
|
227
|
+
// Grid
|
|
228
|
+
// -----------------------------------------------------------------------------
|
|
229
|
+
|
|
230
|
+
/// Create the container for a grid. Will cause full-bleed for the grid unless
|
|
231
|
+
/// max-width properties are added with `-make-container-max-widths`
|
|
232
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
233
|
+
/// @access private
|
|
234
|
+
/// @group @carbon/grid
|
|
235
|
+
@mixin -make-container($breakpoints: $grid-breakpoints) {
|
|
236
|
+
margin-right: auto;
|
|
237
|
+
margin-left: auto;
|
|
238
|
+
|
|
239
|
+
@include -set-largest-breakpoint();
|
|
240
|
+
|
|
241
|
+
@each $name, $value in $breakpoints {
|
|
242
|
+
$prev-breakpoint: map-get($breakpoints, breakpoint-prev($name));
|
|
243
|
+
$margin: map-get($value, margin);
|
|
244
|
+
|
|
245
|
+
@if $prev-breakpoint {
|
|
246
|
+
$prev-margin: map-get($prev-breakpoint, margin);
|
|
247
|
+
@if $prev-margin != $margin {
|
|
248
|
+
@include breakpoint($name) {
|
|
249
|
+
padding-right: #{($grid-gutter / 2) + $margin};
|
|
250
|
+
padding-left: #{($grid-gutter / 2) + $margin};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
} @else {
|
|
254
|
+
@include breakpoint($name) {
|
|
255
|
+
padding-right: #{($grid-gutter / 2) + $margin};
|
|
256
|
+
padding-left: #{($grid-gutter / 2) + $margin};
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/// Get the last breakpoint width and set max-width to its value
|
|
263
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
264
|
+
/// @access private
|
|
265
|
+
/// @group @carbon/grid
|
|
266
|
+
@mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
|
|
267
|
+
$largest-breakpoint: last-map-item($breakpoints);
|
|
268
|
+
|
|
269
|
+
max-width: map-get($largest-breakpoint, 'width');
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/// Add in the max-widths for each breakpoint to the container
|
|
273
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
274
|
+
/// @access private
|
|
275
|
+
/// @group @carbon/grid
|
|
276
|
+
@mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
|
|
277
|
+
@each $name, $value in $breakpoints {
|
|
278
|
+
@include breakpoint($name) {
|
|
279
|
+
max-width: map-get($value, width);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/// Generate the CSS for a grid for the given breakpoints and gutters
|
|
285
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The default breakpoints
|
|
286
|
+
/// @param {Number} $grid-gutter [$grid-gutter] - The default gutters
|
|
287
|
+
/// @param {Number} $condensed-gutter [$grid-gutter--condensed] - The condensed mode gutter
|
|
288
|
+
/// @access public
|
|
289
|
+
/// @group @carbon/grid
|
|
290
|
+
@mixin grid(
|
|
291
|
+
$breakpoints: $grid-breakpoints,
|
|
292
|
+
$grid-gutter: $grid-gutter,
|
|
293
|
+
$condensed-gutter: $grid-gutter--condensed
|
|
294
|
+
) {
|
|
295
|
+
.#{$prefix}--grid {
|
|
296
|
+
@include -make-container($breakpoints);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@include largest-breakpoint($breakpoints) {
|
|
300
|
+
.#{$prefix}--grid--full-width {
|
|
301
|
+
max-width: 100%;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.#{$prefix}--row {
|
|
306
|
+
@include make-row();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.#{$prefix}--row-padding [class*='#{$prefix}--col'],
|
|
310
|
+
.#{$prefix}--col-padding {
|
|
311
|
+
padding-top: $grid-gutter / 2;
|
|
312
|
+
padding-bottom: $grid-gutter / 2;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
|
|
316
|
+
padding-top: $condensed-gutter / 2;
|
|
317
|
+
padding-bottom: $condensed-gutter / 2;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@include -make-grid-columns($breakpoints, $grid-gutter);
|
|
321
|
+
@include -no-gutter();
|
|
322
|
+
@include -hang($grid-gutter);
|
|
323
|
+
}
|
|
@@ -26,12 +26,12 @@ $fluid-spacing-03: 5vw !default;
|
|
|
26
26
|
/// @group @carbon/layout
|
|
27
27
|
$fluid-spacing-04: 10vw !default;
|
|
28
28
|
|
|
29
|
-
/// @type
|
|
29
|
+
/// @type Map
|
|
30
30
|
/// @access public
|
|
31
31
|
/// @group @carbon/layout
|
|
32
32
|
$fluid-spacing: (
|
|
33
|
-
$fluid-spacing-01,
|
|
34
|
-
$fluid-spacing-02,
|
|
35
|
-
$fluid-spacing-03,
|
|
36
|
-
$fluid-spacing-04
|
|
33
|
+
fluid-spacing-01: $fluid-spacing-01,
|
|
34
|
+
fluid-spacing-02: $fluid-spacing-02,
|
|
35
|
+
fluid-spacing-03: $fluid-spacing-03,
|
|
36
|
+
fluid-spacing-04: $fluid-spacing-04,
|
|
37
37
|
);
|
|
@@ -66,20 +66,20 @@ $spacing-11: 5rem !default;
|
|
|
66
66
|
/// @group @carbon/layout
|
|
67
67
|
$spacing-12: 6rem !default;
|
|
68
68
|
|
|
69
|
-
/// @type
|
|
69
|
+
/// @type Map
|
|
70
70
|
/// @access public
|
|
71
71
|
/// @group @carbon/layout
|
|
72
72
|
$spacing: (
|
|
73
|
-
$spacing-01,
|
|
74
|
-
$spacing-02,
|
|
75
|
-
$spacing-03,
|
|
76
|
-
$spacing-04,
|
|
77
|
-
$spacing-05,
|
|
78
|
-
$spacing-06,
|
|
79
|
-
$spacing-07,
|
|
80
|
-
$spacing-08,
|
|
81
|
-
$spacing-09,
|
|
82
|
-
$spacing-10,
|
|
83
|
-
$spacing-11,
|
|
84
|
-
$spacing-12
|
|
73
|
+
spacing-01: $spacing-01,
|
|
74
|
+
spacing-02: $spacing-02,
|
|
75
|
+
spacing-03: $spacing-03,
|
|
76
|
+
spacing-04: $spacing-04,
|
|
77
|
+
spacing-05: $spacing-05,
|
|
78
|
+
spacing-06: $spacing-06,
|
|
79
|
+
spacing-07: $spacing-07,
|
|
80
|
+
spacing-08: $spacing-08,
|
|
81
|
+
spacing-09: $spacing-09,
|
|
82
|
+
spacing-10: $spacing-10,
|
|
83
|
+
spacing-11: $spacing-11,
|
|
84
|
+
spacing-12: $spacing-12,
|
|
85
85
|
);
|
|
@@ -26,12 +26,12 @@ $fluid-spacing-03: 5vw !default;
|
|
|
26
26
|
/// @group @carbon/layout
|
|
27
27
|
$fluid-spacing-04: 10vw !default;
|
|
28
28
|
|
|
29
|
-
/// @type
|
|
29
|
+
/// @type Map
|
|
30
30
|
/// @access public
|
|
31
31
|
/// @group @carbon/layout
|
|
32
32
|
$fluid-spacing: (
|
|
33
|
-
$fluid-spacing-01,
|
|
34
|
-
$fluid-spacing-02,
|
|
35
|
-
$fluid-spacing-03,
|
|
36
|
-
$fluid-spacing-04
|
|
33
|
+
fluid-spacing-01: $fluid-spacing-01,
|
|
34
|
+
fluid-spacing-02: $fluid-spacing-02,
|
|
35
|
+
fluid-spacing-03: $fluid-spacing-03,
|
|
36
|
+
fluid-spacing-04: $fluid-spacing-04,
|
|
37
37
|
);
|
|
@@ -66,20 +66,20 @@ $spacing-11: 5rem !default;
|
|
|
66
66
|
/// @group @carbon/layout
|
|
67
67
|
$spacing-12: 6rem !default;
|
|
68
68
|
|
|
69
|
-
/// @type
|
|
69
|
+
/// @type Map
|
|
70
70
|
/// @access public
|
|
71
71
|
/// @group @carbon/layout
|
|
72
72
|
$spacing: (
|
|
73
|
-
$spacing-01,
|
|
74
|
-
$spacing-02,
|
|
75
|
-
$spacing-03,
|
|
76
|
-
$spacing-04,
|
|
77
|
-
$spacing-05,
|
|
78
|
-
$spacing-06,
|
|
79
|
-
$spacing-07,
|
|
80
|
-
$spacing-08,
|
|
81
|
-
$spacing-09,
|
|
82
|
-
$spacing-10,
|
|
83
|
-
$spacing-11,
|
|
84
|
-
$spacing-12
|
|
73
|
+
spacing-01: $spacing-01,
|
|
74
|
+
spacing-02: $spacing-02,
|
|
75
|
+
spacing-03: $spacing-03,
|
|
76
|
+
spacing-04: $spacing-04,
|
|
77
|
+
spacing-05: $spacing-05,
|
|
78
|
+
spacing-06: $spacing-06,
|
|
79
|
+
spacing-07: $spacing-07,
|
|
80
|
+
spacing-08: $spacing-08,
|
|
81
|
+
spacing-09: $spacing-09,
|
|
82
|
+
spacing-10: $spacing-10,
|
|
83
|
+
spacing-11: $spacing-11,
|
|
84
|
+
spacing-12: $spacing-12,
|
|
85
85
|
);
|
package/scss/motion/motion.scss
CHANGED
|
@@ -5,6 +5,30 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
/// @access public
|
|
9
|
+
/// @group @carbon/motion
|
|
10
|
+
$fast-01: 70ms !default;
|
|
11
|
+
|
|
12
|
+
/// @access public
|
|
13
|
+
/// @group @carbon/motion
|
|
14
|
+
$fast-02: 110ms !default;
|
|
15
|
+
|
|
16
|
+
/// @access public
|
|
17
|
+
/// @group @carbon/motion
|
|
18
|
+
$moderate-01: 150ms !default;
|
|
19
|
+
|
|
20
|
+
/// @access public
|
|
21
|
+
/// @group @carbon/motion
|
|
22
|
+
$moderate-02: 240ms !default;
|
|
23
|
+
|
|
24
|
+
/// @access public
|
|
25
|
+
/// @group @carbon/motion
|
|
26
|
+
$slow-01: 400ms !default;
|
|
27
|
+
|
|
28
|
+
/// @access public
|
|
29
|
+
/// @group @carbon/motion
|
|
30
|
+
$slow-02: 700ms !default;
|
|
31
|
+
|
|
8
32
|
/// Common component easings
|
|
9
33
|
/// @type Map
|
|
10
34
|
/// @access public
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
$icon-02: map-get($theme, 'icon-02') !global;
|
|
59
59
|
$icon-03: map-get($theme, 'icon-03') !global;
|
|
60
60
|
$link-01: map-get($theme, 'link-01') !global;
|
|
61
|
+
$link-02: map-get($theme, 'link-02') !global;
|
|
61
62
|
$inverse-link: map-get($theme, 'inverse-link') !global;
|
|
62
63
|
$field-01: map-get($theme, 'field-01') !global;
|
|
63
64
|
$field-02: map-get($theme, 'field-02') !global;
|
|
@@ -254,6 +255,10 @@
|
|
|
254
255
|
--#{$custom-property-prefix}-link-01,
|
|
255
256
|
map-get($theme, 'link-01')
|
|
256
257
|
) !global;
|
|
258
|
+
$link-02: var(
|
|
259
|
+
--#{$custom-property-prefix}-link-02,
|
|
260
|
+
map-get($theme, 'link-02')
|
|
261
|
+
) !global;
|
|
257
262
|
$inverse-link: var(
|
|
258
263
|
--#{$custom-property-prefix}-inverse-link,
|
|
259
264
|
map-get($theme, 'inverse-link')
|
|
@@ -711,6 +716,10 @@
|
|
|
711
716
|
@include custom-property('link-01', map-get($theme, 'link-01'));
|
|
712
717
|
}
|
|
713
718
|
|
|
719
|
+
@if should-emit($theme, $parent-carbon-theme, 'link-02', $emit-difference) {
|
|
720
|
+
@include custom-property('link-02', map-get($theme, 'link-02'));
|
|
721
|
+
}
|
|
722
|
+
|
|
714
723
|
@if should-emit(
|
|
715
724
|
$theme,
|
|
716
725
|
$parent-carbon-theme,
|
|
@@ -27,6 +27,7 @@ $carbon--theme--white: (
|
|
|
27
27
|
icon-02: #525252,
|
|
28
28
|
icon-03: #ffffff,
|
|
29
29
|
link-01: #0f62fe,
|
|
30
|
+
link-02: #0043ce,
|
|
30
31
|
inverse-link: #78a9ff,
|
|
31
32
|
field-01: #f4f4f4,
|
|
32
33
|
field-02: #ffffff,
|
|
@@ -303,13 +304,15 @@ $carbon--theme--white: (
|
|
|
303
304
|
font-weight: 300,
|
|
304
305
|
line-height: 1.334,
|
|
305
306
|
letter-spacing: 0,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
307
|
+
breakpoints: (
|
|
308
|
+
lg: (
|
|
309
|
+
font-size: 1.75rem,
|
|
310
|
+
line-height: 1.29,
|
|
311
|
+
),
|
|
312
|
+
max: (
|
|
313
|
+
font-size: 2rem,
|
|
314
|
+
line-height: 1.25,
|
|
315
|
+
),
|
|
313
316
|
),
|
|
314
317
|
),
|
|
315
318
|
quotation-01: (
|
|
@@ -535,6 +538,7 @@ $carbon--theme--g90: map-merge(
|
|
|
535
538
|
icon-01: #f4f4f4,
|
|
536
539
|
icon-02: #c6c6c6,
|
|
537
540
|
link-01: #78a9ff,
|
|
541
|
+
link-02: #a6c8ff,
|
|
538
542
|
inverse-link: #0f62fe,
|
|
539
543
|
field-01: #393939,
|
|
540
544
|
field-02: #525252,
|
|
@@ -604,6 +608,7 @@ $carbon--theme--g100: map-merge(
|
|
|
604
608
|
icon-01: #f4f4f4,
|
|
605
609
|
icon-02: #c6c6c6,
|
|
606
610
|
link-01: #78a9ff,
|
|
611
|
+
link-02: #a6c8ff,
|
|
607
612
|
inverse-link: #0f62fe,
|
|
608
613
|
field-01: #262626,
|
|
609
614
|
field-02: #393939,
|
|
@@ -640,7 +645,7 @@ $carbon--theme--g100: map-merge(
|
|
|
640
645
|
decorative-01: #525252,
|
|
641
646
|
button-separator: #161616,
|
|
642
647
|
skeleton-01: #353535,
|
|
643
|
-
skeleton-02: #
|
|
648
|
+
skeleton-02: #525252,
|
|
644
649
|
brand-02: #6f6f6f,
|
|
645
650
|
brand-03: #ffffff,
|
|
646
651
|
active-01: #525252,
|
|
@@ -673,6 +678,7 @@ $carbon--theme--v9: map-merge(
|
|
|
673
678
|
icon-01: #3d70b2,
|
|
674
679
|
icon-02: #5a6872,
|
|
675
680
|
link-01: #3d70b2,
|
|
681
|
+
link-02: #3d70b2,
|
|
676
682
|
inverse-link: #5596e6,
|
|
677
683
|
field-01: #ffffff,
|
|
678
684
|
field-02: #f4f7fb,
|
|
@@ -847,6 +853,12 @@ $carbon--theme: (
|
|
|
847
853
|
$link-01,
|
|
848
854
|
map-get($carbon--theme--white, 'link-01')
|
|
849
855
|
),
|
|
856
|
+
link-02:
|
|
857
|
+
if(
|
|
858
|
+
global-variable-exists('link-02'),
|
|
859
|
+
$link-02,
|
|
860
|
+
map-get($carbon--theme--white, 'link-02')
|
|
861
|
+
),
|
|
850
862
|
inverse-link:
|
|
851
863
|
if(
|
|
852
864
|
global-variable-exists('inverse-link'),
|
|
@@ -224,6 +224,17 @@ $link-01: if(
|
|
|
224
224
|
#0f62fe
|
|
225
225
|
) !default;
|
|
226
226
|
|
|
227
|
+
/// Secondary link color for lower contrast backgrounds
|
|
228
|
+
/// @type {undefined}
|
|
229
|
+
/// @access public
|
|
230
|
+
/// @group @carbon/themes
|
|
231
|
+
$link-02: if(
|
|
232
|
+
global-variable-exists('carbon--theme') and
|
|
233
|
+
map-has-key($carbon--theme, 'link-02'),
|
|
234
|
+
map-get($carbon--theme, 'link-02'),
|
|
235
|
+
#0043ce
|
|
236
|
+
) !default;
|
|
237
|
+
|
|
227
238
|
/// @type {undefined}
|
|
228
239
|
/// @access public
|
|
229
240
|
/// @group @carbon/themes
|
|
@@ -1227,13 +1238,15 @@ $expressive-paragraph-01: if(
|
|
|
1227
1238
|
font-weight: 300,
|
|
1228
1239
|
line-height: 1.334,
|
|
1229
1240
|
letter-spacing: 0,
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1241
|
+
breakpoints: (
|
|
1242
|
+
lg: (
|
|
1243
|
+
font-size: 1.75rem,
|
|
1244
|
+
line-height: 1.29,
|
|
1245
|
+
),
|
|
1246
|
+
max: (
|
|
1247
|
+
font-size: 2rem,
|
|
1248
|
+
line-height: 1.25,
|
|
1249
|
+
),
|
|
1237
1250
|
),
|
|
1238
1251
|
)
|
|
1239
1252
|
) !default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2018, 2018
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use 'sass:meta';
|
|
10
|
+
@use 'themes';
|
|
11
|
+
|
|
12
|
+
$theme: themes.$white !default;
|
|
13
|
+
$-custom-property-prefix: 'cds';
|
|
14
|
+
|
|
15
|
+
/// @access public
|
|
16
|
+
/// @group @carbon/themes
|
|
17
|
+
@mixin theme($active-theme: $theme) {
|
|
18
|
+
$parent-theme: $theme;
|
|
19
|
+
$theme: $active-theme !global;
|
|
20
|
+
|
|
21
|
+
@each $token, $value in $theme {
|
|
22
|
+
@include -custom-property($token, $value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@content;
|
|
26
|
+
|
|
27
|
+
$theme: $parent-theme !global;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// @access public
|
|
31
|
+
/// @group @carbon/themes
|
|
32
|
+
@mixin set($active-theme) {
|
|
33
|
+
$theme: $active-theme !global;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// @access private
|
|
37
|
+
/// @group @carbon/themes
|
|
38
|
+
@mixin -custom-property($name, $value, $prefix: $-custom-property-prefix) {
|
|
39
|
+
@if meta.type-of($value) == map {
|
|
40
|
+
@each $property, $property-value in $value {
|
|
41
|
+
// Only support one-level of depth for values that are maps. This is to
|
|
42
|
+
// avoid bringing properties like `breakpoints` on type tokens
|
|
43
|
+
@if type-of($property-value) != map {
|
|
44
|
+
@include -custom-property('#{$name}-#{$property}', $property-value);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
} @else {
|
|
48
|
+
--#{$prefix}-#{$name}: #{$value};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright IBM Corp. 2018, 2018
|
|
3
|
+
//
|
|
4
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
// LICENSE file in the root directory of this source tree.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
|
|
10
|
+
/// @access private
|
|
11
|
+
/// @group @carbon/themes
|
|
12
|
+
@function merge($map, $maps...) {
|
|
13
|
+
$result: $map;
|
|
14
|
+
@each $map in $maps {
|
|
15
|
+
$result: map.merge($result, $map);
|
|
16
|
+
}
|
|
17
|
+
@return $result;
|
|
18
|
+
}
|