@carbon/grid 10.43.1 → 11.1.0-rc.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 +4 -4
- package/package.json +4 -5
- package/scss/{modules/_breakpoint.scss → _breakpoint.scss} +1 -1
- package/scss/{modules/_config.scss → _config.scss} +1 -1
- package/scss/{modules/_css-grid.scss → _css-grid.scss} +0 -0
- package/scss/{modules/_flex-grid.scss → _flex-grid.scss} +0 -20
- package/scss/_inlined/_breakpoint.scss +198 -0
- package/scss/_inlined/_config.scss +94 -0
- package/scss/_inlined/_css-grid.scss +470 -0
- package/scss/{modules/_mixins.scss → _inlined/_flex-grid.scss} +45 -38
- package/scss/_inlined/_mixins.scss +89 -188
- package/scss/_mixins.scss +89 -188
- package/scss/vendor/@carbon/layout/_convert.import.scss +2 -4
- package/scss/vendor/@carbon/layout/_convert.scss +18 -23
- package/scss/vendor/@carbon/layout/_spacing.scss +2 -5
- package/scss/vendor/@carbon/layout/_utilities.scss +4 -4
- package/scss/vendor/@carbon/layout/generated/_container.scss +13 -43
- package/scss/vendor/@carbon/layout/generated/_fluid-spacing.scss +11 -35
- package/scss/vendor/@carbon/layout/generated/_icon-size.scss +8 -17
- package/scss/vendor/@carbon/layout/generated/_size.scss +1 -1
- package/scss/vendor/@carbon/layout/generated/_spacing.scss +29 -107
- package/scss/vendor/@carbon/layout/modules/_convert.scss +2 -4
- package/scss/12.scss +0 -41
- package/scss/_inlined/12.scss +0 -41
- package/scss/_inlined/_mixins.import.scss +0 -431
- package/scss/_inlined/_prefix.scss +0 -12
- package/scss/_mixins.import.scss +0 -431
- package/scss/_prefix.scss +0 -12
- package/scss/grid.scss +0 -10
- package/scss/index.scss +0 -10
- package/scss/vendor/@carbon/import-once/import-once.scss +0 -27
- package/scss/vendor/@carbon/import-once/index.scss +0 -8
- package/scss/vendor/@carbon/layout/_breakpoint.scss +0 -246
- package/scss/vendor/@carbon/layout/_key-height.import.scss +0 -117
- package/scss/vendor/@carbon/layout/_key-height.scss +0 -111
- package/scss/vendor/@carbon/layout/_mini-unit.scss +0 -23
- package/scss/vendor/@carbon/layout/generated/_layout.scss +0 -97
- package/scss/vendor/@carbon/layout/index.scss +0 -8
- package/scss/vendor/@carbon/layout/layout.scss +0 -12
- package/scss/vendor/@carbon/layout/modules/_spacing.scss +0 -9
- package/scss/vendor/@carbon/layout/modules/_utilities.scss +0 -41
- package/scss/vendor/@carbon/layout/modules/generated/_fluid-spacing.scss +0 -37
- package/scss/vendor/@carbon/layout/modules/generated/_spacing.scss +0 -91
|
@@ -4,27 +4,12 @@
|
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
|
-
//-------------------------------------------
|
|
8
|
-
// Compatibility notes
|
|
9
|
-
// ------------------------------------------
|
|
10
|
-
//
|
|
11
|
-
// This file is intended to be consumed and processed with node-sass/libsass.
|
|
12
|
-
// Sass language features only available in dart-sass, such as `math.div`,
|
|
13
|
-
// should not be used.
|
|
14
|
-
//
|
|
15
|
-
// The `.import` suffixed version of this file eg. `_filename.import.scss`
|
|
16
|
-
// is intended to be compatible with dart-sass.
|
|
17
|
-
//
|
|
18
|
-
// Styles authored within this file must be duplicated to the corresponding
|
|
19
|
-
// compatibility file to ensure we continue to support node-sass and dart-sass
|
|
20
|
-
// in v10.
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/mixins/_grid.scss
|
|
8
|
+
@use 'sass:meta';
|
|
9
|
+
@use "sass:math";
|
|
25
10
|
|
|
26
|
-
@
|
|
27
|
-
@
|
|
11
|
+
@use 'config' as *;
|
|
12
|
+
@use 'breakpoint' as *;
|
|
28
13
|
|
|
29
14
|
// -----------------------------------------------------------------------------
|
|
30
15
|
// Columns
|
|
@@ -33,33 +18,33 @@
|
|
|
33
18
|
/// Used to initialize the default properties for a column class, most notably
|
|
34
19
|
/// for setting width and default gutters when a column's breakpoint has not been
|
|
35
20
|
/// hit yet.
|
|
36
|
-
/// @param {Number} $gutter [$
|
|
37
|
-
/// @param {Number} $collapsed-gutter [$
|
|
21
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
|
|
22
|
+
/// @param {Number} $collapsed-gutter [$grid-gutter--condensed] - The condensed mode gutter
|
|
38
23
|
/// @access private
|
|
39
24
|
/// @group @carbon/grid
|
|
40
|
-
@mixin
|
|
41
|
-
$gutter: $
|
|
42
|
-
$condensed-gutter: $
|
|
25
|
+
@mixin -make-col-ready(
|
|
26
|
+
$gutter: $grid-gutter,
|
|
27
|
+
$condensed-gutter: $grid-gutter--condensed
|
|
43
28
|
) {
|
|
44
29
|
// Prevent columns from becoming too narrow when at smaller grid tiers by
|
|
45
30
|
// always setting `width: 100%;`. This works because we use `flex` values
|
|
46
31
|
// later on to override this initial width.
|
|
47
32
|
width: 100%;
|
|
48
|
-
padding-right: ($gutter
|
|
49
|
-
padding-left: ($gutter
|
|
33
|
+
padding-right: ($gutter * 0.5);
|
|
34
|
+
padding-left: ($gutter * 0.5);
|
|
50
35
|
|
|
51
36
|
// For our condensed use-case, our gutters collapse to 2px solid, 1px on each
|
|
52
37
|
// side.
|
|
53
38
|
.#{$prefix}--row--condensed &,
|
|
54
39
|
.#{$prefix}--grid--condensed & {
|
|
55
|
-
padding-right: ($condensed-gutter
|
|
56
|
-
padding-left: ($condensed-gutter
|
|
40
|
+
padding-right: ($condensed-gutter * 0.5);
|
|
41
|
+
padding-left: ($condensed-gutter * 0.5);
|
|
57
42
|
}
|
|
58
43
|
|
|
59
44
|
// For our narrow use-case, our container hangs 16px into the gutter
|
|
60
45
|
.#{$prefix}--row--narrow &,
|
|
61
46
|
.#{$prefix}--grid--narrow & {
|
|
62
|
-
padding-right: ($gutter
|
|
47
|
+
padding-right: ($gutter * 0.5);
|
|
63
48
|
padding-left: 0;
|
|
64
49
|
}
|
|
65
50
|
}
|
|
@@ -70,7 +55,7 @@
|
|
|
70
55
|
/// @param {Number} $columns - The total number of columns available
|
|
71
56
|
/// @access private
|
|
72
57
|
/// @group @carbon/grid
|
|
73
|
-
@mixin
|
|
58
|
+
@mixin -make-col($span, $columns) {
|
|
74
59
|
@if $span == 0 {
|
|
75
60
|
display: none;
|
|
76
61
|
} @else {
|
|
@@ -79,8 +64,13 @@
|
|
|
79
64
|
// Add a `max-width` to ensure content within each column does not blow out
|
|
80
65
|
// the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
|
|
81
66
|
// do not appear to require this.
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
@if meta.function-exists('div', 'math') {
|
|
68
|
+
max-width: math.percentage(math.div($span, $columns));
|
|
69
|
+
flex: 0 0 math.percentage(math.div($span, $columns));
|
|
70
|
+
} @else {
|
|
71
|
+
max-width: math.percentage(($span / $columns));
|
|
72
|
+
flex: 0 0 math.percentage(($span / $columns));
|
|
73
|
+
}
|
|
84
74
|
}
|
|
85
75
|
}
|
|
86
76
|
|
|
@@ -89,45 +79,50 @@
|
|
|
89
79
|
/// @param {Number} $columns - The total number of columns available
|
|
90
80
|
/// @access private
|
|
91
81
|
/// @group @carbon/grid
|
|
92
|
-
@mixin
|
|
93
|
-
$offset:
|
|
82
|
+
@mixin -make-col-offset($span, $columns) {
|
|
83
|
+
$offset: 0;
|
|
84
|
+
@if meta.function-exists('div', 'math') {
|
|
85
|
+
$offset: math.div($span, $columns);
|
|
86
|
+
} @else {
|
|
87
|
+
$offset: ($span / $columns);
|
|
88
|
+
}
|
|
94
89
|
@if $offset == 0 {
|
|
95
90
|
margin-left: 0;
|
|
96
91
|
} @else {
|
|
97
|
-
margin-left: percentage($offset);
|
|
92
|
+
margin-left: math.percentage($offset);
|
|
98
93
|
}
|
|
99
94
|
}
|
|
100
95
|
|
|
101
96
|
/// Output the CSS required for all the columns in a given grid system.
|
|
102
|
-
/// @param {Map} $breakpoints [$
|
|
103
|
-
/// @param {Number} $gutter [$
|
|
97
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints in the grid system
|
|
98
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
|
|
104
99
|
/// @access private
|
|
105
100
|
/// @group @carbon/grid
|
|
106
|
-
@mixin
|
|
107
|
-
$breakpoints: $
|
|
108
|
-
$gutter: $
|
|
101
|
+
@mixin -make-grid-columns(
|
|
102
|
+
$breakpoints: $grid-breakpoints,
|
|
103
|
+
$gutter: $grid-gutter
|
|
109
104
|
) {
|
|
110
105
|
.#{$prefix}--col {
|
|
111
|
-
@include
|
|
106
|
+
@include -make-col-ready($gutter);
|
|
112
107
|
}
|
|
113
108
|
|
|
114
109
|
@each $breakpoint in map-keys($breakpoints) {
|
|
115
|
-
$infix:
|
|
116
|
-
$columns: map
|
|
110
|
+
$infix: breakpoint-infix($breakpoint);
|
|
111
|
+
$columns: map.get(map.get($breakpoints, $breakpoint), columns);
|
|
117
112
|
|
|
118
113
|
// Allow columns to stretch full width below their breakpoints
|
|
119
114
|
@for $i from 0 through $columns {
|
|
120
115
|
.#{$prefix}--col#{$infix}-#{$i} {
|
|
121
|
-
@include
|
|
116
|
+
@include -make-col-ready($gutter);
|
|
122
117
|
}
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
.#{$prefix}--col#{$infix},
|
|
126
121
|
.#{$prefix}--col#{$infix}--auto {
|
|
127
|
-
@include
|
|
122
|
+
@include -make-col-ready($gutter);
|
|
128
123
|
}
|
|
129
124
|
|
|
130
|
-
@include
|
|
125
|
+
@include breakpoint($breakpoint, $breakpoints) {
|
|
131
126
|
// Provide basic `.col-{bp}` classes for equal-width flexbox columns
|
|
132
127
|
.#{$prefix}--col,
|
|
133
128
|
.#{$prefix}--col#{$infix} {
|
|
@@ -146,14 +141,14 @@
|
|
|
146
141
|
|
|
147
142
|
@for $i from 0 through $columns {
|
|
148
143
|
.#{$prefix}--col#{$infix}-#{$i} {
|
|
149
|
-
@include
|
|
144
|
+
@include -make-col($i, $columns);
|
|
150
145
|
}
|
|
151
146
|
}
|
|
152
147
|
|
|
153
148
|
@for $i from 0 through ($columns - 1) {
|
|
154
149
|
@if not($infix == '') {
|
|
155
150
|
.#{$prefix}--offset#{$infix}-#{$i} {
|
|
156
|
-
@include
|
|
151
|
+
@include -make-col-offset($i, $columns);
|
|
157
152
|
}
|
|
158
153
|
}
|
|
159
154
|
}
|
|
@@ -166,14 +161,14 @@
|
|
|
166
161
|
// -----------------------------------------------------------------------------
|
|
167
162
|
|
|
168
163
|
/// Define the properties for a selector assigned to a row in the grid system.
|
|
169
|
-
/// @param {Number} $gutter [$
|
|
164
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
|
|
170
165
|
/// @access private
|
|
171
166
|
/// @group @carbon/grid
|
|
172
|
-
@mixin
|
|
167
|
+
@mixin make-row($gutter: $grid-gutter) {
|
|
173
168
|
display: flex;
|
|
174
169
|
flex-wrap: wrap;
|
|
175
|
-
margin-right: -1 * $gutter
|
|
176
|
-
margin-left: -1 * $gutter
|
|
170
|
+
margin-right: -1 * $gutter * 0.5;
|
|
171
|
+
margin-left: -1 * $gutter * 0.5;
|
|
177
172
|
}
|
|
178
173
|
|
|
179
174
|
// -----------------------------------------------------------------------------
|
|
@@ -184,7 +179,7 @@
|
|
|
184
179
|
/// classes are useful for dropping the gutter in fluid situations.
|
|
185
180
|
/// @access private
|
|
186
181
|
/// @group @carbon/grid
|
|
187
|
-
@mixin
|
|
182
|
+
@mixin -no-gutter {
|
|
188
183
|
.#{$prefix}--no-gutter,
|
|
189
184
|
.#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
|
|
190
185
|
padding-right: 0;
|
|
@@ -200,17 +195,6 @@
|
|
|
200
195
|
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
|
|
201
196
|
padding-right: 0;
|
|
202
197
|
}
|
|
203
|
-
|
|
204
|
-
// Deprecated ☠️
|
|
205
|
-
.#{$prefix}--no-gutter--left,
|
|
206
|
-
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
|
|
207
|
-
padding-left: 0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.#{$prefix}--no-gutter--right,
|
|
211
|
-
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
|
|
212
|
-
padding-right: 0;
|
|
213
|
-
}
|
|
214
198
|
}
|
|
215
199
|
|
|
216
200
|
// -----------------------------------------------------------------------------
|
|
@@ -219,96 +203,16 @@
|
|
|
219
203
|
|
|
220
204
|
/// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
|
|
221
205
|
/// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
|
|
222
|
-
/// @param {Number} $gutter [$
|
|
206
|
+
/// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
|
|
223
207
|
/// @access private
|
|
224
208
|
/// @group @carbon/grid
|
|
225
|
-
@mixin
|
|
209
|
+
@mixin -hang($gutter: $grid-gutter) {
|
|
226
210
|
.#{$prefix}--hang--start {
|
|
227
|
-
padding-left: ($gutter
|
|
211
|
+
padding-left: ($gutter * 0.5);
|
|
228
212
|
}
|
|
229
213
|
|
|
230
214
|
.#{$prefix}--hang--end {
|
|
231
|
-
padding-right: ($gutter
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Deprecated ☠️
|
|
235
|
-
.#{$prefix}--hang--left {
|
|
236
|
-
padding-left: ($gutter / 2);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.#{$prefix}--hang--right {
|
|
240
|
-
padding-right: ($gutter / 2);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// -----------------------------------------------------------------------------
|
|
245
|
-
// Aspect ratio
|
|
246
|
-
// -----------------------------------------------------------------------------
|
|
247
|
-
|
|
248
|
-
/// The aspect ratios that are used to generate corresponding aspect ratio
|
|
249
|
-
/// classes in code
|
|
250
|
-
/// @type List
|
|
251
|
-
/// @access public
|
|
252
|
-
/// @group @carbon/grid
|
|
253
|
-
$carbon--aspect-ratios: (
|
|
254
|
-
(16, 9),
|
|
255
|
-
(9, 16),
|
|
256
|
-
(2, 1),
|
|
257
|
-
(1, 2),
|
|
258
|
-
(4, 3),
|
|
259
|
-
(3, 4),
|
|
260
|
-
(3, 2),
|
|
261
|
-
(2, 3),
|
|
262
|
-
(1, 1)
|
|
263
|
-
);
|
|
264
|
-
|
|
265
|
-
/// Generates the CSS classname utilities for the aspect ratios
|
|
266
|
-
///
|
|
267
|
-
/// CSS Tricks article on aspect ratios and all the different ways it can be done.
|
|
268
|
-
/// https://css-tricks.com/aspect-ratio-boxes/#article-header-id-6
|
|
269
|
-
///
|
|
270
|
-
/// That article references an earlier article on the topic.
|
|
271
|
-
/// https://keithjgrant.com/posts/2017/03/aspect-ratios/
|
|
272
|
-
///
|
|
273
|
-
/// @param {Number} $width width from an aspect ratio
|
|
274
|
-
/// @param {Number} $height height from an aspect ratio
|
|
275
|
-
/// @access private
|
|
276
|
-
/// @group @carbon/grid
|
|
277
|
-
@mixin carbon--aspect-ratio($aspect-ratios: $carbon--aspect-ratios) {
|
|
278
|
-
.#{$prefix}--aspect-ratio {
|
|
279
|
-
position: relative;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.#{$prefix}--aspect-ratio::before {
|
|
283
|
-
width: 1px;
|
|
284
|
-
height: 0;
|
|
285
|
-
margin-left: -1px;
|
|
286
|
-
content: '';
|
|
287
|
-
float: left;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.#{$prefix}--aspect-ratio::after {
|
|
291
|
-
display: table;
|
|
292
|
-
clear: both;
|
|
293
|
-
content: '';
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
@each $aspect-ratio in $aspect-ratios {
|
|
297
|
-
$width: nth($aspect-ratio, 1);
|
|
298
|
-
$height: nth($aspect-ratio, 2);
|
|
299
|
-
|
|
300
|
-
.#{$prefix}--aspect-ratio--#{$width}x#{$height}::before {
|
|
301
|
-
padding-top: percentage($height / $width);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// leaving here for legacy support
|
|
306
|
-
.#{$prefix}--aspect-ratio--object {
|
|
307
|
-
position: absolute;
|
|
308
|
-
top: 0;
|
|
309
|
-
left: 0;
|
|
310
|
-
width: 100%;
|
|
311
|
-
height: 100%;
|
|
215
|
+
padding-right: ($gutter * 0.5);
|
|
312
216
|
}
|
|
313
217
|
}
|
|
314
218
|
|
|
@@ -317,99 +221,96 @@ $carbon--aspect-ratios: (
|
|
|
317
221
|
// -----------------------------------------------------------------------------
|
|
318
222
|
|
|
319
223
|
/// Create the container for a grid. Will cause full-bleed for the grid unless
|
|
320
|
-
/// max-width properties are added with
|
|
321
|
-
/// @param {Map} $breakpoints [$
|
|
224
|
+
/// max-width properties are added with `-make-container-max-widths`
|
|
225
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
322
226
|
/// @access private
|
|
323
227
|
/// @group @carbon/grid
|
|
324
|
-
@mixin
|
|
228
|
+
@mixin -make-container($breakpoints: $grid-breakpoints) {
|
|
325
229
|
margin-right: auto;
|
|
326
230
|
margin-left: auto;
|
|
327
231
|
|
|
328
|
-
@include
|
|
232
|
+
@include -set-largest-breakpoint();
|
|
329
233
|
|
|
330
234
|
@each $name, $value in $breakpoints {
|
|
331
|
-
$prev-breakpoint: map
|
|
332
|
-
$margin: map
|
|
235
|
+
$prev-breakpoint: map.get($breakpoints, breakpoint-prev($name));
|
|
236
|
+
$margin: map.get($value, margin);
|
|
333
237
|
|
|
334
238
|
@if $prev-breakpoint {
|
|
335
|
-
$prev-margin: map
|
|
239
|
+
$prev-margin: map.get($prev-breakpoint, margin);
|
|
336
240
|
@if $prev-margin != $margin {
|
|
337
|
-
@include
|
|
338
|
-
padding-right: #{($
|
|
339
|
-
padding-left: #{($
|
|
241
|
+
@include breakpoint($name) {
|
|
242
|
+
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
243
|
+
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
340
244
|
}
|
|
341
245
|
}
|
|
342
246
|
} @else {
|
|
343
|
-
@include
|
|
344
|
-
padding-right: #{($
|
|
345
|
-
padding-left: #{($
|
|
247
|
+
@include breakpoint($name) {
|
|
248
|
+
padding-right: #{($grid-gutter * 0.5) + $margin};
|
|
249
|
+
padding-left: #{($grid-gutter * 0.5) + $margin};
|
|
346
250
|
}
|
|
347
251
|
}
|
|
348
252
|
}
|
|
349
253
|
}
|
|
350
254
|
|
|
351
255
|
/// Get the last breakpoint width and set max-width to its value
|
|
352
|
-
/// @param {Map} $breakpoints [$
|
|
256
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
353
257
|
/// @access private
|
|
354
258
|
/// @group @carbon/grid
|
|
355
|
-
@mixin
|
|
259
|
+
@mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
|
|
356
260
|
$largest-breakpoint: last-map-item($breakpoints);
|
|
357
261
|
|
|
358
|
-
max-width: map
|
|
262
|
+
max-width: map.get($largest-breakpoint, 'width');
|
|
359
263
|
}
|
|
360
264
|
|
|
361
265
|
/// Add in the max-widths for each breakpoint to the container
|
|
362
|
-
/// @param {Map} $breakpoints [$
|
|
266
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
|
|
363
267
|
/// @access private
|
|
364
268
|
/// @group @carbon/grid
|
|
365
|
-
@mixin
|
|
366
|
-
$breakpoints: $carbon--grid-breakpoints
|
|
367
|
-
) {
|
|
269
|
+
@mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
|
|
368
270
|
@each $name, $value in $breakpoints {
|
|
369
|
-
@include
|
|
370
|
-
max-width: map
|
|
271
|
+
@include breakpoint($name) {
|
|
272
|
+
max-width: map.get($value, width);
|
|
371
273
|
}
|
|
372
274
|
}
|
|
373
275
|
}
|
|
374
276
|
|
|
375
277
|
/// Generate the CSS for a grid for the given breakpoints and gutters
|
|
376
|
-
/// @param {Map} $breakpoints [$
|
|
377
|
-
/// @param {Number} $grid-gutter [$
|
|
378
|
-
/// @param {Number} $condensed-gutter [$
|
|
278
|
+
/// @param {Map} $breakpoints [$grid-breakpoints] - The default breakpoints
|
|
279
|
+
/// @param {Number} $grid-gutter [$grid-gutter] - The default gutters
|
|
280
|
+
/// @param {Number} $condensed-gutter [$grid-gutter--condensed] - The condensed mode gutter
|
|
379
281
|
/// @access public
|
|
380
282
|
/// @group @carbon/grid
|
|
381
|
-
@mixin
|
|
382
|
-
$breakpoints: $
|
|
383
|
-
$grid-gutter: $
|
|
384
|
-
$condensed-gutter: $
|
|
283
|
+
@mixin grid(
|
|
284
|
+
$breakpoints: $grid-breakpoints,
|
|
285
|
+
$grid-gutter: $grid-gutter,
|
|
286
|
+
$condensed-gutter: $grid-gutter--condensed
|
|
385
287
|
) {
|
|
386
288
|
.#{$prefix}--grid {
|
|
387
|
-
@include
|
|
289
|
+
@include -make-container($breakpoints);
|
|
388
290
|
}
|
|
389
291
|
|
|
390
|
-
@include
|
|
292
|
+
@include largest-breakpoint($breakpoints) {
|
|
391
293
|
.#{$prefix}--grid--full-width {
|
|
392
294
|
max-width: 100%;
|
|
393
295
|
}
|
|
394
296
|
}
|
|
395
297
|
|
|
396
298
|
.#{$prefix}--row {
|
|
397
|
-
@include
|
|
299
|
+
@include make-row();
|
|
398
300
|
}
|
|
399
301
|
|
|
400
302
|
.#{$prefix}--row-padding [class*='#{$prefix}--col'],
|
|
401
303
|
.#{$prefix}--col-padding {
|
|
402
|
-
padding-top: $grid-gutter
|
|
403
|
-
padding-bottom: $grid-gutter
|
|
304
|
+
padding-top: $grid-gutter * 0.5;
|
|
305
|
+
padding-bottom: $grid-gutter * 0.5;
|
|
404
306
|
}
|
|
405
307
|
|
|
406
308
|
.#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
|
|
407
|
-
padding-top: $condensed-gutter
|
|
408
|
-
padding-bottom: $condensed-gutter
|
|
309
|
+
padding-top: $condensed-gutter * 0.5;
|
|
310
|
+
padding-bottom: $condensed-gutter * 0.5;
|
|
409
311
|
}
|
|
410
312
|
|
|
411
|
-
@include
|
|
412
|
-
@include
|
|
413
|
-
@include
|
|
414
|
-
@include carbon--aspect-ratio();
|
|
313
|
+
@include -make-grid-columns($breakpoints, $grid-gutter);
|
|
314
|
+
@include -no-gutter();
|
|
315
|
+
@include -hang($grid-gutter);
|
|
415
316
|
}
|