@carbon/type 11.1.0-rc.0 → 11.2.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.
Files changed (32) hide show
  1. package/index.scss +3 -5
  2. package/package.json +6 -6
  3. package/scss/_default-type.scss +7 -7
  4. package/scss/_prefix.scss +18 -1
  5. package/scss/_styles.scss +1 -4
  6. package/scss/_inlined/_classes.scss +0 -42
  7. package/scss/_inlined/_default-type.scss +0 -49
  8. package/scss/_inlined/_font-family.scss +0 -104
  9. package/scss/_inlined/_prefix.scss +0 -11
  10. package/scss/_inlined/_reset.scss +0 -42
  11. package/scss/_inlined/_scale.scss +0 -57
  12. package/scss/_inlined/_styles.scss +0 -856
  13. package/scss/vendor/@carbon/grid/_breakpoint.scss +0 -198
  14. package/scss/vendor/@carbon/grid/_config.scss +0 -94
  15. package/scss/vendor/@carbon/grid/_css-grid.scss +0 -470
  16. package/scss/vendor/@carbon/grid/_flex-grid.scss +0 -343
  17. package/scss/vendor/@carbon/grid/_inlined/_breakpoint.scss +0 -198
  18. package/scss/vendor/@carbon/grid/_inlined/_config.scss +0 -94
  19. package/scss/vendor/@carbon/grid/_inlined/_css-grid.scss +0 -470
  20. package/scss/vendor/@carbon/grid/_inlined/_flex-grid.scss +0 -343
  21. package/scss/vendor/@carbon/grid/_inlined/_mixins.scss +0 -316
  22. package/scss/vendor/@carbon/grid/_mixins.scss +0 -316
  23. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.import.scss +0 -63
  24. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_convert.scss +0 -49
  25. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_spacing.scss +0 -9
  26. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/_utilities.scss +0 -41
  27. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_container.scss +0 -43
  28. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_fluid-spacing.scss +0 -37
  29. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_icon-size.scss +0 -25
  30. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_size.scss +0 -17
  31. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/generated/_spacing.scss +0 -91
  32. package/scss/vendor/@carbon/grid/vendor/@carbon/layout/modules/_convert.scss +0 -49
@@ -1,343 +0,0 @@
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
- // Helpers for defining columns, rows, and containers are heavily inspired by,
9
- // and often derived from, bootstrap:
10
- // https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_grid.scss
11
-
12
- @use 'sass:list';
13
- @use 'sass:meta';
14
- @use 'sass:math';
15
- @use 'sass:map';
16
-
17
- @use 'config' as *;
18
- @use 'breakpoint' as *;
19
-
20
- // -----------------------------------------------------------------------------
21
- // Columns
22
- // -----------------------------------------------------------------------------
23
-
24
- /// Used to initialize the default properties for a column class, most notably
25
- /// for setting width and default gutters when a column's breakpoint has not been
26
- /// hit yet.
27
- /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
28
- /// @param {Number} $collapsed-gutter [$grid-gutter-condensed] - The condensed mode gutter
29
- /// @access private
30
- /// @group @carbon/grid
31
- @mixin -make-col-ready(
32
- $gutter: $grid-gutter,
33
- $condensed-gutter: $grid-gutter-condensed
34
- ) {
35
- // Prevent columns from becoming too narrow when at smaller grid tiers by
36
- // always setting `width: 100%;`. This works because we use `flex` values
37
- // later on to override this initial width.
38
- width: 100%;
39
- padding-right: $gutter * 0.5;
40
- padding-left: $gutter * 0.5;
41
-
42
- // For our condensed use-case, our gutters collapse to 2px solid, 1px on each
43
- // side.
44
- .#{$prefix}--row--condensed &,
45
- .#{$prefix}--grid--condensed & {
46
- padding-right: $condensed-gutter * 0.5;
47
- padding-left: $condensed-gutter * 0.5;
48
- }
49
-
50
- // For our narrow use-case, our container hangs 16px into the gutter
51
- .#{$prefix}--row--narrow &,
52
- .#{$prefix}--grid--narrow & {
53
- padding-right: $gutter * 0.5;
54
- padding-left: 0;
55
- }
56
- }
57
-
58
- /// Define the width of the column for a given span and column count.
59
- /// A width of 0 will hide the column entirely.
60
- /// @param {Number} $span - The number of columns covered
61
- /// @param {Number} $columns - The total number of columns available
62
- /// @access private
63
- /// @group @carbon/grid
64
- @mixin -make-col($span, $columns) {
65
- @if $span == 0 {
66
- display: none;
67
- } @else {
68
- // Explicitly include `display: block` to override
69
- display: block;
70
- // Add a `max-width` to ensure content within each column does not blow out
71
- // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
72
- // do not appear to require this.
73
- @if meta.function-exists('div', 'math') {
74
- max-width: math.percentage(math.div($span, $columns));
75
- flex: 0 0 math.percentage(math.div($span, $columns));
76
- } @else {
77
- max-width: math.percentage(($span / $columns));
78
- flex: 0 0 math.percentage(($span / $columns));
79
- }
80
- }
81
- }
82
-
83
- /// Create a column offset for a given span and column count.
84
- /// @param {Number} $span - The number of columns the offset should cover
85
- /// @param {Number} $columns - The total number of columns available
86
- /// @access private
87
- /// @group @carbon/grid
88
- @mixin -make-col-offset($span, $columns) {
89
- $offset: 0;
90
- @if meta.function-exists('div', 'math') {
91
- $offset: math.div($span, $columns);
92
- } @else {
93
- $offset: ($span / $columns);
94
- }
95
- @if $offset == 0 {
96
- margin-left: 0;
97
- } @else {
98
- margin-left: math.percentage($offset);
99
- }
100
- }
101
-
102
- /// Output the CSS required for all the columns in a given grid system.
103
- /// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints in the grid system
104
- /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
105
- /// @access private
106
- /// @group @carbon/grid
107
- @mixin -make-grid-columns(
108
- $breakpoints: $grid-breakpoints,
109
- $gutter: $grid-gutter
110
- ) {
111
- .#{$prefix}--col {
112
- @include -make-col-ready($gutter);
113
- }
114
-
115
- @each $breakpoint in map-keys($breakpoints) {
116
- $infix: breakpoint-infix($breakpoint);
117
- $columns: map.get(map.get($breakpoints, $breakpoint), columns);
118
-
119
- // Allow columns to stretch full width below their breakpoints
120
- @for $i from 0 through $columns {
121
- .#{$prefix}--col#{$infix}-#{$i} {
122
- @include -make-col-ready($gutter);
123
- }
124
- }
125
-
126
- .#{$prefix}--col#{$infix},
127
- .#{$prefix}--col#{$infix}--auto {
128
- @include -make-col-ready($gutter);
129
- }
130
-
131
- @include breakpoint($breakpoint, $breakpoints) {
132
- // Provide basic `.col-{bp}` classes for equal-width flexbox columns
133
- .#{$prefix}--col,
134
- .#{$prefix}--col#{$infix} {
135
- max-width: 100%;
136
- flex-basis: 0;
137
- flex-grow: 1;
138
- }
139
-
140
- .#{$prefix}--col--auto,
141
- .#{$prefix}--col#{$infix}--auto {
142
- width: auto;
143
- // Reset earlier grid tiers
144
- max-width: 100%;
145
- flex: 1 0 0%;
146
- }
147
-
148
- @for $i from 0 through $columns {
149
- .#{$prefix}--col#{$infix}-#{$i} {
150
- @include -make-col($i, $columns);
151
- }
152
- }
153
-
154
- @for $i from 0 through ($columns - 1) {
155
- @if not($infix == '') {
156
- .#{$prefix}--offset#{$infix}-#{$i} {
157
- @include -make-col-offset($i, $columns);
158
- }
159
- }
160
- }
161
- }
162
- }
163
- }
164
-
165
- // -----------------------------------------------------------------------------
166
- // Rows
167
- // -----------------------------------------------------------------------------
168
-
169
- /// Define the properties for a selector assigned to a row in the grid system.
170
- /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
171
- /// @access private
172
- /// @group @carbon/grid
173
- @mixin -make-row($gutter: $grid-gutter) {
174
- display: flex;
175
- flex-wrap: wrap;
176
- margin-right: -1 * $gutter * 0.5;
177
- margin-left: -1 * $gutter * 0.5;
178
- }
179
-
180
- // -----------------------------------------------------------------------------
181
- // No gutter
182
- // -----------------------------------------------------------------------------
183
-
184
- /// Add `no-gutter` and `no-gutter--{start,end}` classes to the output CSS. These
185
- /// classes are useful for dropping the gutter in fluid situations.
186
- /// @access private
187
- /// @group @carbon/grid
188
- @mixin -no-gutter {
189
- .#{$prefix}--no-gutter,
190
- .#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
191
- padding-right: 0;
192
- padding-left: 0;
193
- }
194
-
195
- .#{$prefix}--no-gutter--start,
196
- .#{$prefix}--row.#{$prefix}--no-gutter--start [class*='#{$prefix}--col'] {
197
- padding-left: 0;
198
- }
199
-
200
- .#{$prefix}--no-gutter--end,
201
- .#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
202
- padding-right: 0;
203
- }
204
- }
205
-
206
- // -----------------------------------------------------------------------------
207
- // Hang
208
- // -----------------------------------------------------------------------------
209
-
210
- /// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
211
- /// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
212
- /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
213
- /// @access private
214
- /// @group @carbon/grid
215
- @mixin -hang($gutter: $grid-gutter) {
216
- .#{$prefix}--hang--start {
217
- padding-left: $gutter * 0.5;
218
- }
219
-
220
- .#{$prefix}--hang--end {
221
- padding-right: $gutter * 0.5;
222
- }
223
- }
224
-
225
- // -----------------------------------------------------------------------------
226
- // Grid
227
- // -----------------------------------------------------------------------------
228
-
229
- /// Create the container for a grid. Will cause full-bleed for the grid unless
230
- /// max-width properties are added with `make-container-max-widths`
231
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
232
- /// @access private
233
- /// @group @carbon/grid
234
- @mixin -make-container($breakpoints: $grid-breakpoints) {
235
- margin-right: auto;
236
- margin-left: auto;
237
-
238
- @include -set-largest-breakpoint($breakpoints);
239
-
240
- @each $name, $value in $breakpoints {
241
- $prev-breakpoint: map.get($breakpoints, breakpoint-prev($name));
242
- $margin: map.get($value, margin);
243
-
244
- @if $prev-breakpoint {
245
- $prev-margin: map.get($prev-breakpoint, margin);
246
- @if $prev-margin != $margin {
247
- @include breakpoint($name) {
248
- padding-right: #{($grid-gutter * 0.5) + $margin};
249
- padding-left: #{($grid-gutter * 0.5) + $margin};
250
- }
251
- }
252
- } @else {
253
- @include breakpoint($name) {
254
- padding-right: #{($grid-gutter * 0.5) + $margin};
255
- padding-left: #{($grid-gutter * 0.5) + $margin};
256
- }
257
- }
258
- }
259
- }
260
-
261
- /// Get the last breakpoint width and set max-width to its value
262
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
263
- /// @access private
264
- /// @group @carbon/grid
265
- @mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
266
- $largest-breakpoint: -last-map-item($breakpoints);
267
-
268
- max-width: map.get($largest-breakpoint, 'width');
269
- }
270
-
271
- /// Add in the max-widths for each breakpoint to the container
272
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
273
- /// @access private
274
- /// @group @carbon/grid
275
- @mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
276
- @each $name, $value in $breakpoints {
277
- @include breakpoint($name) {
278
- max-width: map.get($value, width);
279
- }
280
- }
281
- }
282
-
283
- /// Pass in a map, and get the last one in the list back
284
- /// @access public
285
- /// @param {Map} $map - Map
286
- /// @return {*} Desired value
287
- /// @group @carbon/layout
288
- @function -last-map-item($map) {
289
- $total-length: list.length($map);
290
- @return map-get($map, -key-by-index($map, $total-length));
291
- }
292
-
293
- /// Provide a map and index, and get back the relevant key value
294
- /// @access public
295
- /// @param {Map} $map - Map
296
- /// @param {Integer} $index - Key chain
297
- /// @return {String} Desired value
298
- /// @group @carbon/layout
299
- @function -key-by-index($map, $index) {
300
- $keys: map.keys($map);
301
- @return nth($keys, $index);
302
- }
303
-
304
- /// Generate the CSS for a grid for the given breakpoints and gutters
305
- /// @param {Map} $breakpoints [$grid-breakpoints] - The default breakpoints
306
- /// @param {Number} $grid-gutter [$grid-gutter] - The default gutters
307
- /// @param {Number} $condensed-gutter [$grid-gutter-condensed] - The condensed mode gutter
308
- /// @access public
309
- /// @group @carbon/grid
310
- @mixin flex-grid(
311
- $breakpoints: $grid-breakpoints,
312
- $grid-gutter: $grid-gutter,
313
- $condensed-gutter: $grid-gutter-condensed
314
- ) {
315
- .#{$prefix}--grid {
316
- @include -make-container($breakpoints);
317
- }
318
-
319
- @include largest-breakpoint($breakpoints) {
320
- .#{$prefix}--grid--full-width {
321
- max-width: 100%;
322
- }
323
- }
324
-
325
- .#{$prefix}--row {
326
- @include -make-row();
327
- }
328
-
329
- .#{$prefix}--row-padding [class*='#{$prefix}--col'],
330
- .#{$prefix}--col-padding {
331
- padding-top: $grid-gutter * 0.5;
332
- padding-bottom: $grid-gutter * 0.5;
333
- }
334
-
335
- .#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
336
- padding-top: $condensed-gutter * 0.5;
337
- padding-bottom: $condensed-gutter * 0.5;
338
- }
339
-
340
- @include -make-grid-columns($breakpoints, $grid-gutter);
341
- @include -no-gutter();
342
- @include -hang($grid-gutter);
343
- }
@@ -1,198 +0,0 @@
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:list';
9
- @use 'sass:map';
10
- @use 'sass:meta';
11
- @use '@carbon/layout/scss/convert';
12
- @use 'config' as *;
13
-
14
- /// Provide a map and index, and get back the relevant key value
15
- /// @access public
16
- /// @param {Map} $map - Map
17
- /// @param {Integer} $index - Key chain
18
- /// @return {String} Desired value
19
- /// @group @carbon/layout
20
- @function -key-by-index($map, $index) {
21
- $keys: map.keys($map);
22
- @return nth($keys, $index);
23
- }
24
-
25
- /// Get the value of the next breakpoint, or null for the last breakpoint
26
- /// @param {String} $name - The name of the breakpoint
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
28
- /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
29
- /// @return {String}
30
- /// @access public
31
- /// @group @carbon/layout
32
- @function breakpoint-next(
33
- $name,
34
- $breakpoints: $grid-breakpoints,
35
- $breakpoint-names: map.keys($breakpoints)
36
- ) {
37
- $n: list.index($breakpoint-names, $name);
38
- @if $n != null and $n < list.length($breakpoint-names) {
39
- @return list.nth($breakpoint-names, $n + 1);
40
- }
41
- @return null;
42
- }
43
-
44
- /// Get the value of the previous breakpoint, or null for the first breakpoint
45
- /// @param {String} $name - The name of the breakpoint
46
- /// @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
47
- /// @param {List} $breakpoint-names [map-keys($breakpoints)] - A list of names from the `$breakpoints` map
48
- /// @return {String}
49
- /// @access public
50
- /// @group @carbon/layout
51
- @function breakpoint-prev(
52
- $name,
53
- $breakpoints: $grid-breakpoints,
54
- $breakpoint-names: map.keys($breakpoints)
55
- ) {
56
- $n: list.index($breakpoint-names, $name);
57
- @if $n != null and $n > 1 {
58
- @return list.nth($breakpoint-names, $n - 1);
59
- }
60
- @return null;
61
- }
62
-
63
- /// Check to see if the given breakpoint name
64
- /// @param {String} $name - The name of the breakpoint
65
- /// @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
66
- /// @return {Bool}
67
- /// @access public
68
- /// @group @carbon/layout
69
- @function is-smallest-breakpoint($name, $breakpoints: $grid-breakpoints) {
70
- @return list.index(map.keys($breakpoints), $name) == 1;
71
- }
72
-
73
- /// Returns the largest breakpoint name
74
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
75
- /// @return {String}
76
- /// @access public
77
- /// @group @carbon/layout
78
- @function largest-breakpoint-name($breakpoints: $grid-breakpoints) {
79
- $total-breakpoints: list.length($breakpoints);
80
- @return -key-by-index($breakpoints, $total-breakpoints);
81
- }
82
-
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`.
84
- /// @param {String} $name - The name of the breakpoint
85
- /// @return {String}
86
- /// @access public
87
- /// @group @carbon/layout
88
- @function breakpoint-infix($name) {
89
- @return '-#{$name}';
90
- }
91
-
92
- /// Generate a media query from the width of the given breakpoint to infinity
93
- /// @param {String | Number} $name
94
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
95
- /// @content
96
- /// @access public
97
- /// @group @carbon/layout
98
- @mixin breakpoint-up($name, $breakpoints: $grid-breakpoints) {
99
- @if meta.type-of($name) == 'number' {
100
- @media (min-width: $name) {
101
- @content;
102
- }
103
- } @else if map.has-key($breakpoints, $name) {
104
- $breakpoint: map.get($breakpoints, $name);
105
- $width: map.get($breakpoint, width);
106
- @if is-smallest-breakpoint($name, $breakpoints) {
107
- @content;
108
- } @else {
109
- @media (min-width: $width) {
110
- @content;
111
- }
112
- }
113
- } @else {
114
- @error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
115
- }
116
- }
117
-
118
- /// Generate a media query for the maximum width of the given styles
119
- /// @param {String | Number} $name
120
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
121
- /// @content
122
- /// @access public
123
- /// @group @carbon/layout
124
- @mixin breakpoint-down($name, $breakpoints: $grid-breakpoints) {
125
- @if meta.type-of($name) == 'number' {
126
- @media (max-width: $name) {
127
- @content;
128
- }
129
- } @else if map.has-key($breakpoints, $name) {
130
- // We borrow this logic from bootstrap for specifying the value of the
131
- // max-width. The maximum width is calculated by finding the breakpoint and
132
- // subtracting .02 from its value. This value is used instead of .01 to
133
- // avoid rounding issues in Safari
134
- // https://github.com/twbs/bootstrap/blob/c5b1919deaf5393fcca9e9b9d7ce9c338160d99d/scss/mixins/_breakpoints.scss#L34-L46
135
- $breakpoint: map.get($breakpoints, $name);
136
- $width: map.get($breakpoint, width) - 0.02;
137
- @media (max-width: $width) {
138
- @content;
139
- }
140
- } @else {
141
- @error 'Unable to find a breakpoint with name `#{$name}`. Expected one of: (#{map.keys($breakpoints)})';
142
- }
143
- }
144
-
145
- /// Generate a media query for the range between the lower and upper breakpoints
146
- /// @param {String | Number} $lower
147
- /// @param {String | Number} $upper
148
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
149
- /// @content
150
- /// @access public
151
- /// @group @carbon/layout
152
- @mixin breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
153
- $is-number-lower: meta.type-of($lower) == 'number';
154
- $is-number-upper: meta.type-of($upper) == 'number';
155
- $min: if($is-number-lower, $lower, map.get($breakpoints, $lower));
156
- $max: if($is-number-upper, $upper, map.get($breakpoints, $upper));
157
-
158
- @if $min and $max {
159
- $min-width: if(not $is-number-lower and $min, map.get($min, width), $min);
160
- $max-width: if(not $is-number-upper and $max, map.get($max, width), $max);
161
- @media (min-width: $min-width) and (max-width: $max-width) {
162
- @content;
163
- }
164
- } @else if $min != null and $max == null {
165
- @include breakpoint-up($lower) {
166
- @content;
167
- }
168
- } @else if $min == null and $max != null {
169
- @include breakpoint-down($upper) {
170
- @content;
171
- }
172
- } @else {
173
- @error 'Unable to find a breakpoint to satisfy: (#{$lower},#{$upper}). Expected both to be one of (#{map.keys($breakpoints)}).';
174
- }
175
- }
176
-
177
- /// Generate media query for the largest breakpoint
178
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
179
- /// @content
180
- /// @access public
181
- /// @group @carbon/layout
182
- @mixin largest-breakpoint($breakpoints: $grid-breakpoints) {
183
- @include breakpoint(largest-breakpoint-name()) {
184
- @content;
185
- }
186
- }
187
-
188
- /// Generate a media query for a given breakpoint
189
- /// @param {String | Number} $name
190
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
191
- /// @content
192
- /// @access public
193
- /// @group @carbon/layout
194
- @mixin breakpoint($name, $breakpoints: $grid-breakpoints) {
195
- @include breakpoint-up($name, $breakpoints) {
196
- @content;
197
- }
198
- }
@@ -1,94 +0,0 @@
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 '@carbon/layout/scss/convert';
10
-
11
- /// Namespace prefix
12
- /// @type String
13
- /// @access public
14
- /// @group @carbon/grid
15
- $prefix: 'cds' !default;
16
-
17
- /// Total columns used in the flex grid
18
- /// @type Number
19
- /// @access public
20
- /// @group @carbon/grid
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
- }