@carbon/grid 10.32.1 → 10.34.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/grid",
|
|
3
3
|
"description": "Grid for digital and software products using the Carbon Design System",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.34.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@carbon/import-once": "^10.6.0",
|
|
36
|
-
"@carbon/layout": "^10.
|
|
36
|
+
"@carbon/layout": "^10.30.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@carbon/cli": "^10.
|
|
39
|
+
"@carbon/cli": "^10.28.0",
|
|
40
40
|
"rimraf": "^3.0.0"
|
|
41
41
|
},
|
|
42
42
|
"eyeglass": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"sassDir": "scss",
|
|
46
46
|
"needs": "^1.3.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "1b4811e1ef0be1d058e63a90242d9d48f0bff445"
|
|
49
49
|
}
|
|
@@ -91,7 +91,7 @@ $grid-breakpoints: (
|
|
|
91
91
|
) !default;
|
|
92
92
|
|
|
93
93
|
/// Get the value of the next breakpoint, or null for the last breakpoint
|
|
94
|
-
/// @param {String} $name - The name of the
|
|
94
|
+
/// @param {String} $name - The name of the breakpoint
|
|
95
95
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
96
96
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
97
97
|
/// @return {String}
|
|
@@ -110,7 +110,7 @@ $grid-breakpoints: (
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/// Get the value of the previous breakpoint, or null for the first breakpoint
|
|
113
|
-
/// @param {String} $name - The name of the
|
|
113
|
+
/// @param {String} $name - The name of the breakpoint
|
|
114
114
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
115
115
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
116
116
|
/// @return {String}
|
|
@@ -129,7 +129,7 @@ $grid-breakpoints: (
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/// Check to see if the given breakpoint name
|
|
132
|
-
/// @param {String} $name - The name of the
|
|
132
|
+
/// @param {String} $name - The name of the breakpoint
|
|
133
133
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
134
134
|
/// @return {Bool}
|
|
135
135
|
/// @access public
|
|
@@ -148,7 +148,7 @@ $grid-breakpoints: (
|
|
|
148
148
|
@return key-by-index($breakpoints, $total-breakpoints);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
/// Get the infix for a given breakpoint in a list of breakpoints.
|
|
151
|
+
/// Get the infix for a given breakpoint in a list of breakpoints. Useful for generating the size part in a selector, for example: `.prefix--col-sm-2`.
|
|
152
152
|
/// @param {String} $name - The name of the breakpoint
|
|
153
153
|
/// @return {String}
|
|
154
154
|
/// @access public
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use "sass:math";
|
|
9
|
+
|
|
8
10
|
@use 'sass:map';
|
|
9
11
|
@use 'config' as *;
|
|
10
12
|
@use 'breakpoint' as *;
|
|
@@ -110,7 +112,7 @@
|
|
|
110
112
|
// Condensed
|
|
111
113
|
// -----------------------------------------------------------------------------
|
|
112
114
|
.#{$prefix}--css-grid--condensed {
|
|
113
|
-
--cds-grid-gutter:
|
|
115
|
+
--cds-grid-gutter: 1px;
|
|
114
116
|
|
|
115
117
|
column-gap: var(--cds-grid-gutter);
|
|
116
118
|
row-gap: var(--cds-grid-gutter);
|
|
@@ -128,7 +130,7 @@
|
|
|
128
130
|
// -----------------------------------------------------------------------------
|
|
129
131
|
.#{$prefix}--css-grid--no-gutter {
|
|
130
132
|
// This is set to 0px (versus 0) so that the calc expression for padding for
|
|
131
|
-
// a grid container works as
|
|
133
|
+
// a grid container works as expected. Without the unit, the calc() will
|
|
132
134
|
// result in a value of 0.
|
|
133
135
|
// stylelint-disable-next-line length-zero-no-unit
|
|
134
136
|
--cds-grid-gutter: 0px;
|
|
@@ -270,7 +272,7 @@
|
|
|
270
272
|
$columns: map.get($value, columns);
|
|
271
273
|
|
|
272
274
|
@include breakpoint($name) {
|
|
273
|
-
// The `grid-column-end` and `grid-column-start`
|
|
275
|
+
// The `grid-column-end` and `grid-column-start` properties are *not* inclusive.
|
|
274
276
|
// It starts/ends the column *at* the column, not *on* the column. We must
|
|
275
277
|
// ensure that there is one additional class available for each breakpoint.
|
|
276
278
|
@for $i from 1 through $columns + 1 {
|
|
@@ -411,7 +413,7 @@ $carbon--aspect-ratios: (
|
|
|
411
413
|
$height: nth($aspect-ratio, 2);
|
|
412
414
|
|
|
413
415
|
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
414
|
-
padding-top: percentage($height
|
|
416
|
+
padding-top: percentage(math.div($height, $width));
|
|
415
417
|
}
|
|
416
418
|
}
|
|
417
419
|
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use "sass:math";
|
|
9
|
+
|
|
8
10
|
@use 'config' as *;
|
|
9
11
|
@use 'breakpoint' as *;
|
|
10
12
|
|
|
@@ -27,21 +29,21 @@
|
|
|
27
29
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
28
30
|
// later on to override this initial width.
|
|
29
31
|
width: 100%;
|
|
30
|
-
padding-right: ($gutter
|
|
31
|
-
padding-left: ($gutter
|
|
32
|
+
padding-right: ($gutter * 0.5);
|
|
33
|
+
padding-left: ($gutter * 0.5);
|
|
32
34
|
|
|
33
35
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each
|
|
34
36
|
// side.
|
|
35
37
|
.#{$prefix}--row--condensed &,
|
|
36
38
|
.#{$prefix}--grid--condensed & {
|
|
37
|
-
padding-right: ($condensed-gutter
|
|
38
|
-
padding-left: ($condensed-gutter
|
|
39
|
+
padding-right: ($condensed-gutter * 0.5);
|
|
40
|
+
padding-left: ($condensed-gutter * 0.5);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
42
44
|
.#{$prefix}--row--narrow &,
|
|
43
45
|
.#{$prefix}--grid--narrow & {
|
|
44
|
-
padding-right: ($gutter
|
|
46
|
+
padding-right: ($gutter * 0.5);
|
|
45
47
|
padding-left: 0;
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -61,8 +63,8 @@
|
|
|
61
63
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
62
64
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
63
65
|
// do not appear to require this.
|
|
64
|
-
max-width: percentage($span
|
|
65
|
-
flex: 0 0 percentage($span
|
|
66
|
+
max-width: percentage(math.div($span, $columns));
|
|
67
|
+
flex: 0 0 percentage(math.div($span, $columns));
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
/// @access private
|
|
73
75
|
/// @group @carbon/grid
|
|
74
76
|
@mixin -make-col-offset($span, $columns) {
|
|
75
|
-
$offset: $span
|
|
77
|
+
$offset: math.div($span, $columns);
|
|
76
78
|
@if $offset == 0 {
|
|
77
79
|
margin-left: 0;
|
|
78
80
|
} @else {
|
|
@@ -154,8 +156,8 @@
|
|
|
154
156
|
@mixin make-row($gutter: $grid-gutter) {
|
|
155
157
|
display: flex;
|
|
156
158
|
flex-wrap: wrap;
|
|
157
|
-
margin-right: -1 * $gutter
|
|
158
|
-
margin-left: -1 * $gutter
|
|
159
|
+
margin-right: -1 * $gutter * 0.5;
|
|
160
|
+
margin-left: -1 * $gutter * 0.5;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
// -----------------------------------------------------------------------------
|
|
@@ -206,20 +208,20 @@
|
|
|
206
208
|
/// @group @carbon/grid
|
|
207
209
|
@mixin -hang($gutter: $grid-gutter) {
|
|
208
210
|
.#{$prefix}--hang--start {
|
|
209
|
-
padding-left: ($gutter
|
|
211
|
+
padding-left: ($gutter * 0.5);
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
.#{$prefix}--hang--end {
|
|
213
|
-
padding-right: ($gutter
|
|
215
|
+
padding-right: ($gutter * 0.5);
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
// Deprecated ☠️
|
|
217
219
|
.#{$prefix}--hang--left {
|
|
218
|
-
padding-left: ($gutter
|
|
220
|
+
padding-left: ($gutter * 0.5);
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
.#{$prefix}--hang--right {
|
|
222
|
-
padding-right: ($gutter
|
|
224
|
+
padding-right: ($gutter * 0.5);
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
|
|
@@ -246,14 +248,14 @@
|
|
|
246
248
|
$prev-margin: map-get($prev-breakpoint, margin);
|
|
247
249
|
@if $prev-margin != $margin {
|
|
248
250
|
@include breakpoint($name) {
|
|
249
|
-
padding-right: #{($grid-gutter
|
|
250
|
-
padding-left: #{($grid-gutter
|
|
251
|
+
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
252
|
+
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
251
253
|
}
|
|
252
254
|
}
|
|
253
255
|
} @else {
|
|
254
256
|
@include breakpoint($name) {
|
|
255
|
-
padding-right: #{($grid-gutter
|
|
256
|
-
padding-left: #{($grid-gutter
|
|
257
|
+
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
258
|
+
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
257
259
|
}
|
|
258
260
|
}
|
|
259
261
|
}
|
|
@@ -308,13 +310,13 @@
|
|
|
308
310
|
|
|
309
311
|
.#{$prefix}--row-padding [class*='#{$prefix}--col'],
|
|
310
312
|
.#{$prefix}--col-padding {
|
|
311
|
-
padding-top: $grid-gutter
|
|
312
|
-
padding-bottom: $grid-gutter
|
|
313
|
+
padding-top: $grid-gutter * 0.5;
|
|
314
|
+
padding-bottom: $grid-gutter * 0.5;
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
|
|
316
|
-
padding-top: $condensed-gutter
|
|
317
|
-
padding-bottom: $condensed-gutter
|
|
318
|
+
padding-top: $condensed-gutter * 0.5;
|
|
319
|
+
padding-bottom: $condensed-gutter * 0.5;
|
|
318
320
|
}
|
|
319
321
|
|
|
320
322
|
@include -make-grid-columns($breakpoints, $grid-gutter);
|
|
@@ -54,7 +54,7 @@ $carbon--grid-breakpoints: (
|
|
|
54
54
|
) !default;
|
|
55
55
|
|
|
56
56
|
/// Get the value of the next breakpoint, or null for the last breakpoint
|
|
57
|
-
/// @param {String} $name - The name of the
|
|
57
|
+
/// @param {String} $name - The name of the breakpoint
|
|
58
58
|
/// @param {Map} $breakpoints [$carbon--grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
59
59
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
60
60
|
/// @return {String}
|
|
@@ -73,7 +73,7 @@ $carbon--grid-breakpoints: (
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/// Get the value of the previous breakpoint, or null for the first breakpoint
|
|
76
|
-
/// @param {String} $name - The name of the
|
|
76
|
+
/// @param {String} $name - The name of the breakpoint
|
|
77
77
|
/// @param {Map} $breakpoints [$carbon--grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
78
78
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
79
79
|
/// @return {String}
|
|
@@ -92,7 +92,7 @@ $carbon--grid-breakpoints: (
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/// Check to see if the given breakpoint name
|
|
95
|
-
/// @param {String} $name - The name of the
|
|
95
|
+
/// @param {String} $name - The name of the breakpoint
|
|
96
96
|
/// @param {Map} $breakpoints [$carbon--grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
97
97
|
/// @return {Bool}
|
|
98
98
|
/// @access public
|
|
@@ -116,7 +116,7 @@ $carbon--grid-breakpoints: (
|
|
|
116
116
|
@return carbon--key-by-index($breakpoints, $total-breakpoints);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
/// Get the infix for a given breakpoint in a list of breakpoints.
|
|
119
|
+
/// Get the infix for a given breakpoint in a list of breakpoints. Useful for generating the size part in a selector, for example: `.prefix--col-sm-2`.
|
|
120
120
|
/// @param {String} $name - The name of the breakpoint
|
|
121
121
|
/// @return {String}
|
|
122
122
|
/// @access public
|
|
@@ -57,7 +57,7 @@ $grid-breakpoints: (
|
|
|
57
57
|
) !default;
|
|
58
58
|
|
|
59
59
|
/// Get the value of the next breakpoint, or null for the last breakpoint
|
|
60
|
-
/// @param {String} $name - The name of the
|
|
60
|
+
/// @param {String} $name - The name of the breakpoint
|
|
61
61
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
62
62
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
63
63
|
/// @return {String}
|
|
@@ -76,7 +76,7 @@ $grid-breakpoints: (
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/// Get the value of the previous breakpoint, or null for the first breakpoint
|
|
79
|
-
/// @param {String} $name - The name of the
|
|
79
|
+
/// @param {String} $name - The name of the breakpoint
|
|
80
80
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
81
81
|
/// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
|
|
82
82
|
/// @return {String}
|
|
@@ -95,7 +95,7 @@ $grid-breakpoints: (
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/// Check to see if the given breakpoint name
|
|
98
|
-
/// @param {String} $name - The name of the
|
|
98
|
+
/// @param {String} $name - The name of the breakpoint
|
|
99
99
|
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name of the breakpoint and the value is the values for the breakpoint
|
|
100
100
|
/// @return {Bool}
|
|
101
101
|
/// @access public
|
|
@@ -114,7 +114,7 @@ $grid-breakpoints: (
|
|
|
114
114
|
@return key-by-index($breakpoints, $total-breakpoints);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/// Get the infix for a given breakpoint in a list of breakpoints.
|
|
117
|
+
/// Get the infix for a given breakpoint in a list of breakpoints. Useful for generating the size part in a selector, for example: `.prefix--col-sm-2`.
|
|
118
118
|
/// @param {String} $name - The name of the breakpoint
|
|
119
119
|
/// @return {String}
|
|
120
120
|
/// @access public
|