@carbon/grid 10.41.0 → 10.43.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 +1 -4
- package/package.json +5 -5
- package/scss/_inlined/_mixins.import.scss +2 -2
- package/scss/_mixins.import.scss +2 -2
- package/scss/modules/_breakpoint.scss +4 -72
- package/scss/modules/_config.scss +77 -1
- package/scss/modules/_css-grid.scss +379 -256
- package/scss/modules/_flex-grid.scss +39 -50
- package/scss/modules/_mixins.scss +11 -11
- package/scss/vendor/@carbon/import-once/import-once.scss +1 -1
- package/scss/vendor/@carbon/layout/_key-height.import.scss +2 -2
- package/scss/vendor/@carbon/layout/modules/_utilities.scss +3 -3
- package/scss/vendor/@carbon/layout/modules/_breakpoint.scss +0 -232
package/index.scss
CHANGED
|
@@ -5,10 +5,7 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
@forward 'scss/modules/config'
|
|
9
|
-
$prefix: 'bx' !default,
|
|
10
|
-
$flex-grid-columns: 16 !default,
|
|
11
|
-
);
|
|
8
|
+
@forward 'scss/modules/config';
|
|
12
9
|
@forward 'scss/modules/breakpoint';
|
|
13
10
|
@forward 'scss/modules/css-grid';
|
|
14
11
|
@forward 'scss/modules/flex-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.43.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"clean": "rimraf scss/_inlined scss/vendor"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@carbon/import-once": "^10.
|
|
36
|
-
"@carbon/layout": "^10.
|
|
35
|
+
"@carbon/import-once": "^10.7.0",
|
|
36
|
+
"@carbon/layout": "^10.37.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@carbon/cli": "^10.
|
|
39
|
+
"@carbon/cli": "^10.34.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": "05b57e9181903cb87173d48a0635691a2e942e30"
|
|
49
49
|
}
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
@use 'sass:meta';
|
|
27
27
|
@use 'sass:math';
|
|
28
|
-
@import '../vendor/@carbon/layout/breakpoint';
|
|
29
|
-
@import 'prefix';
|
|
28
|
+
@import '../vendor/@carbon/layout/breakpoint';
|
|
29
|
+
@import 'prefix';
|
|
30
30
|
|
|
31
31
|
// -----------------------------------------------------------------------------
|
|
32
32
|
// Columns
|
package/scss/_mixins.import.scss
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
@use 'sass:meta';
|
|
27
27
|
@use 'sass:math';
|
|
28
|
-
@import '@carbon/layout/scss/breakpoint';
|
|
29
|
-
@import 'prefix';
|
|
28
|
+
@import '@carbon/layout/scss/breakpoint';
|
|
29
|
+
@import 'prefix';
|
|
30
30
|
|
|
31
31
|
// -----------------------------------------------------------------------------
|
|
32
32
|
// Columns
|
|
@@ -5,25 +5,11 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_breakpoints.scss
|
|
9
8
|
@use 'sass:list';
|
|
10
9
|
@use 'sass:map';
|
|
11
10
|
@use 'sass:meta';
|
|
12
11
|
@use '@carbon/layout/scss/modules/convert';
|
|
13
|
-
|
|
14
|
-
/// Map deep get
|
|
15
|
-
/// @author Hugo Giraudel
|
|
16
|
-
/// @access public
|
|
17
|
-
/// @param {Map} $map - Map
|
|
18
|
-
/// @param {Arglist} $keys - Key chain
|
|
19
|
-
/// @return {*} Desired value
|
|
20
|
-
/// @group @carbon/layout
|
|
21
|
-
@function map-deep-get($map, $keys...) {
|
|
22
|
-
@each $key in $keys {
|
|
23
|
-
$map: map-get($map, $key);
|
|
24
|
-
}
|
|
25
|
-
@return $map;
|
|
26
|
-
}
|
|
12
|
+
@use 'config' as *;
|
|
27
13
|
|
|
28
14
|
/// Provide a map and index, and get back the relevant key value
|
|
29
15
|
/// @access public
|
|
@@ -31,65 +17,11 @@
|
|
|
31
17
|
/// @param {Integer} $index - Key chain
|
|
32
18
|
/// @return {String} Desired value
|
|
33
19
|
/// @group @carbon/layout
|
|
34
|
-
@function key-by-index($map, $index) {
|
|
35
|
-
$keys: map
|
|
20
|
+
@function -key-by-index($map, $index) {
|
|
21
|
+
$keys: map.keys($map);
|
|
36
22
|
@return nth($keys, $index);
|
|
37
23
|
}
|
|
38
24
|
|
|
39
|
-
/// Pass in a map, and get the last one in the list back
|
|
40
|
-
/// @access public
|
|
41
|
-
/// @param {Map} $map - Map
|
|
42
|
-
/// @return {*} Desired value
|
|
43
|
-
/// @group @carbon/layout
|
|
44
|
-
@function last-map-item($map) {
|
|
45
|
-
$total-length: length($map);
|
|
46
|
-
@return map-get($map, key-by-index($map, $total-length));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/// Carbon gutter size in rem
|
|
50
|
-
/// @type Number
|
|
51
|
-
/// @access public
|
|
52
|
-
/// @group @carbon/layout
|
|
53
|
-
$grid-gutter: convert.rem(32px);
|
|
54
|
-
|
|
55
|
-
/// Carbon condensed gutter size in rem
|
|
56
|
-
/// @type Number
|
|
57
|
-
/// @access public
|
|
58
|
-
/// @group @carbon/layout
|
|
59
|
-
$grid-gutter--condensed: convert.rem(1px);
|
|
60
|
-
|
|
61
|
-
// Initial map of our breakpoints and their values
|
|
62
|
-
/// @type Map
|
|
63
|
-
/// @access public
|
|
64
|
-
/// @group @carbon/layout
|
|
65
|
-
$grid-breakpoints: (
|
|
66
|
-
sm: (
|
|
67
|
-
columns: 4,
|
|
68
|
-
margin: 0,
|
|
69
|
-
width: convert.rem(320px),
|
|
70
|
-
),
|
|
71
|
-
md: (
|
|
72
|
-
columns: 8,
|
|
73
|
-
margin: convert.rem(16px),
|
|
74
|
-
width: convert.rem(672px),
|
|
75
|
-
),
|
|
76
|
-
lg: (
|
|
77
|
-
columns: 16,
|
|
78
|
-
margin: convert.rem(16px),
|
|
79
|
-
width: convert.rem(1056px),
|
|
80
|
-
),
|
|
81
|
-
xlg: (
|
|
82
|
-
columns: 16,
|
|
83
|
-
margin: convert.rem(16px),
|
|
84
|
-
width: convert.rem(1312px),
|
|
85
|
-
),
|
|
86
|
-
max: (
|
|
87
|
-
columns: 16,
|
|
88
|
-
margin: convert.rem(24px),
|
|
89
|
-
width: convert.rem(1584px),
|
|
90
|
-
),
|
|
91
|
-
) !default;
|
|
92
|
-
|
|
93
25
|
/// Get the value of the next breakpoint, or null for the last breakpoint
|
|
94
26
|
/// @param {String} $name - The name of the breakpoint
|
|
95
27
|
/// @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
|
|
@@ -145,7 +77,7 @@ $grid-breakpoints: (
|
|
|
145
77
|
/// @group @carbon/layout
|
|
146
78
|
@function largest-breakpoint-name($breakpoints: $grid-breakpoints) {
|
|
147
79
|
$total-breakpoints: list.length($breakpoints);
|
|
148
|
-
@return key-by-index($breakpoints, $total-breakpoints);
|
|
80
|
+
@return -key-by-index($breakpoints, $total-breakpoints);
|
|
149
81
|
}
|
|
150
82
|
|
|
151
83
|
/// 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`.
|
|
@@ -5,14 +5,90 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use '@carbon/layout/scss/modules/convert';
|
|
10
|
+
|
|
8
11
|
/// Namespace prefix
|
|
9
12
|
/// @type String
|
|
10
13
|
/// @access public
|
|
11
14
|
/// @group @carbon/grid
|
|
12
|
-
$prefix: '
|
|
15
|
+
$prefix: 'cds' !default;
|
|
13
16
|
|
|
14
17
|
/// Total columns used in the flex grid
|
|
15
18
|
/// @type Number
|
|
16
19
|
/// @access public
|
|
17
20
|
/// @group @carbon/grid
|
|
18
21
|
$flex-grid-columns: 16 !default;
|
|
22
|
+
|
|
23
|
+
/// Carbon gutter size in rem
|
|
24
|
+
/// @type Number
|
|
25
|
+
/// @access public
|
|
26
|
+
/// @group @carbon/layout
|
|
27
|
+
$grid-gutter: convert.rem(32px) !default;
|
|
28
|
+
|
|
29
|
+
/// Carbon condensed gutter size in rem
|
|
30
|
+
/// @type Number
|
|
31
|
+
/// @access public
|
|
32
|
+
/// @group @carbon/layout
|
|
33
|
+
$grid-gutter-condensed: convert.rem(1px) !default;
|
|
34
|
+
|
|
35
|
+
// Initial map of our breakpoints and their values
|
|
36
|
+
/// @type Map
|
|
37
|
+
/// @access public
|
|
38
|
+
/// @group @carbon/layout
|
|
39
|
+
$grid-breakpoints: (
|
|
40
|
+
sm: (
|
|
41
|
+
columns: 4,
|
|
42
|
+
margin: 0,
|
|
43
|
+
width: convert.rem(320px),
|
|
44
|
+
),
|
|
45
|
+
md: (
|
|
46
|
+
columns: 8,
|
|
47
|
+
margin: convert.rem(16px),
|
|
48
|
+
width: convert.rem(672px),
|
|
49
|
+
),
|
|
50
|
+
lg: (
|
|
51
|
+
columns: 16,
|
|
52
|
+
margin: convert.rem(16px),
|
|
53
|
+
width: convert.rem(1056px),
|
|
54
|
+
),
|
|
55
|
+
xlg: (
|
|
56
|
+
columns: 16,
|
|
57
|
+
margin: convert.rem(16px),
|
|
58
|
+
width: convert.rem(1312px),
|
|
59
|
+
),
|
|
60
|
+
max: (
|
|
61
|
+
columns: 16,
|
|
62
|
+
margin: convert.rem(24px),
|
|
63
|
+
width: convert.rem(1584px),
|
|
64
|
+
),
|
|
65
|
+
) !default;
|
|
66
|
+
|
|
67
|
+
@if $flex-grid-columns == 12 {
|
|
68
|
+
$grid-breakpoints: map.merge(
|
|
69
|
+
$grid-breakpoints,
|
|
70
|
+
(
|
|
71
|
+
lg:
|
|
72
|
+
map.merge(
|
|
73
|
+
map.get($grid-breakpoints, lg),
|
|
74
|
+
(
|
|
75
|
+
columns: 12,
|
|
76
|
+
)
|
|
77
|
+
),
|
|
78
|
+
xlg:
|
|
79
|
+
map.merge(
|
|
80
|
+
map.get($grid-breakpoints, xlg),
|
|
81
|
+
(
|
|
82
|
+
columns: 12,
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
max:
|
|
86
|
+
map.merge(
|
|
87
|
+
map.get($grid-breakpoints, max),
|
|
88
|
+
(
|
|
89
|
+
columns: 12,
|
|
90
|
+
)
|
|
91
|
+
),
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|