@carbon/grid 10.32.0-rc.0 → 10.33.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/index.scss +12 -0
- package/package.json +6 -5
- package/scss/modules/_css-grid.scss +4 -2
- package/scss/modules/_mixins.scss +24 -22
package/index.scss
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
@forward 'scss/modules/config' with (
|
|
9
|
+
$prefix: 'bx' !default,
|
|
10
|
+
);
|
|
11
|
+
@forward 'scss/modules/breakpoint';
|
|
12
|
+
@forward 'scss/modules/css-grid';
|
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.33.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"bugs": "https://github.com/carbon-design-system/carbon/issues",
|
|
12
12
|
"files": [
|
|
13
13
|
"css",
|
|
14
|
-
"scss"
|
|
14
|
+
"scss",
|
|
15
|
+
"index.scss"
|
|
15
16
|
],
|
|
16
17
|
"keywords": [
|
|
17
18
|
"eyeglass-module",
|
|
@@ -32,10 +33,10 @@
|
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"@carbon/import-once": "^10.6.0",
|
|
35
|
-
"@carbon/layout": "^10.
|
|
36
|
+
"@carbon/layout": "^10.29.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@carbon/cli": "^10.
|
|
39
|
+
"@carbon/cli": "^10.27.0",
|
|
39
40
|
"rimraf": "^3.0.0"
|
|
40
41
|
},
|
|
41
42
|
"eyeglass": {
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"sassDir": "scss",
|
|
45
46
|
"needs": "^1.3.0"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "9c2eb1cfa0e5b2c4dc0142b98cd8828e84640af8"
|
|
48
49
|
}
|
|
@@ -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);
|
|
@@ -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);
|