@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,316 +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:meta';
9
- @use "sass:math";
10
-
11
- @use 'config' as *;
12
- @use 'breakpoint' as *;
13
-
14
- // -----------------------------------------------------------------------------
15
- // Columns
16
- // -----------------------------------------------------------------------------
17
-
18
- /// Used to initialize the default properties for a column class, most notably
19
- /// for setting width and default gutters when a column's breakpoint has not been
20
- /// hit yet.
21
- /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
22
- /// @param {Number} $collapsed-gutter [$grid-gutter--condensed] - The condensed mode gutter
23
- /// @access private
24
- /// @group @carbon/grid
25
- @mixin -make-col-ready(
26
- $gutter: $grid-gutter,
27
- $condensed-gutter: $grid-gutter--condensed
28
- ) {
29
- // Prevent columns from becoming too narrow when at smaller grid tiers by
30
- // always setting `width: 100%;`. This works because we use `flex` values
31
- // later on to override this initial width.
32
- width: 100%;
33
- padding-right: ($gutter * 0.5);
34
- padding-left: ($gutter * 0.5);
35
-
36
- // For our condensed use-case, our gutters collapse to 2px solid, 1px on each
37
- // side.
38
- .#{$prefix}--row--condensed &,
39
- .#{$prefix}--grid--condensed & {
40
- padding-right: ($condensed-gutter * 0.5);
41
- padding-left: ($condensed-gutter * 0.5);
42
- }
43
-
44
- // For our narrow use-case, our container hangs 16px into the gutter
45
- .#{$prefix}--row--narrow &,
46
- .#{$prefix}--grid--narrow & {
47
- padding-right: ($gutter * 0.5);
48
- padding-left: 0;
49
- }
50
- }
51
-
52
- /// Define the width of the column for a given span and column count.
53
- /// A width of 0 will hide the column entirely.
54
- /// @param {Number} $span - The number of columns covered
55
- /// @param {Number} $columns - The total number of columns available
56
- /// @access private
57
- /// @group @carbon/grid
58
- @mixin -make-col($span, $columns) {
59
- @if $span == 0 {
60
- display: none;
61
- } @else {
62
- // Explicitly include `display: block` to override
63
- display: block;
64
- // Add a `max-width` to ensure content within each column does not blow out
65
- // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
66
- // do not appear to require this.
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
- }
74
- }
75
- }
76
-
77
- /// Create a column offset for a given span and column count.
78
- /// @param {Number} $span - The number of columns the offset should cover
79
- /// @param {Number} $columns - The total number of columns available
80
- /// @access private
81
- /// @group @carbon/grid
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
- }
89
- @if $offset == 0 {
90
- margin-left: 0;
91
- } @else {
92
- margin-left: math.percentage($offset);
93
- }
94
- }
95
-
96
- /// Output the CSS required for all the columns in a given grid system.
97
- /// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints in the grid system
98
- /// @param {Number} $gutter [$grid-gutter] - The gutter for the grid system
99
- /// @access private
100
- /// @group @carbon/grid
101
- @mixin -make-grid-columns(
102
- $breakpoints: $grid-breakpoints,
103
- $gutter: $grid-gutter
104
- ) {
105
- .#{$prefix}--col {
106
- @include -make-col-ready($gutter);
107
- }
108
-
109
- @each $breakpoint in map-keys($breakpoints) {
110
- $infix: breakpoint-infix($breakpoint);
111
- $columns: map.get(map.get($breakpoints, $breakpoint), columns);
112
-
113
- // Allow columns to stretch full width below their breakpoints
114
- @for $i from 0 through $columns {
115
- .#{$prefix}--col#{$infix}-#{$i} {
116
- @include -make-col-ready($gutter);
117
- }
118
- }
119
-
120
- .#{$prefix}--col#{$infix},
121
- .#{$prefix}--col#{$infix}--auto {
122
- @include -make-col-ready($gutter);
123
- }
124
-
125
- @include breakpoint($breakpoint, $breakpoints) {
126
- // Provide basic `.col-{bp}` classes for equal-width flexbox columns
127
- .#{$prefix}--col,
128
- .#{$prefix}--col#{$infix} {
129
- max-width: 100%;
130
- flex-basis: 0;
131
- flex-grow: 1;
132
- }
133
-
134
- .#{$prefix}--col--auto,
135
- .#{$prefix}--col#{$infix}--auto {
136
- width: auto;
137
- // Reset earlier grid tiers
138
- max-width: 100%;
139
- flex: 1 0 0%;
140
- }
141
-
142
- @for $i from 0 through $columns {
143
- .#{$prefix}--col#{$infix}-#{$i} {
144
- @include -make-col($i, $columns);
145
- }
146
- }
147
-
148
- @for $i from 0 through ($columns - 1) {
149
- @if not($infix == '') {
150
- .#{$prefix}--offset#{$infix}-#{$i} {
151
- @include -make-col-offset($i, $columns);
152
- }
153
- }
154
- }
155
- }
156
- }
157
- }
158
-
159
- // -----------------------------------------------------------------------------
160
- // Rows
161
- // -----------------------------------------------------------------------------
162
-
163
- /// Define the properties for a selector assigned to a row in the grid system.
164
- /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
165
- /// @access private
166
- /// @group @carbon/grid
167
- @mixin make-row($gutter: $grid-gutter) {
168
- display: flex;
169
- flex-wrap: wrap;
170
- margin-right: -1 * $gutter * 0.5;
171
- margin-left: -1 * $gutter * 0.5;
172
- }
173
-
174
- // -----------------------------------------------------------------------------
175
- // No gutter
176
- // -----------------------------------------------------------------------------
177
-
178
- /// Add `no-gutter` and `no-gutter--{start,end}` classes to the output CSS. These
179
- /// classes are useful for dropping the gutter in fluid situations.
180
- /// @access private
181
- /// @group @carbon/grid
182
- @mixin -no-gutter {
183
- .#{$prefix}--no-gutter,
184
- .#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
185
- padding-right: 0;
186
- padding-left: 0;
187
- }
188
-
189
- .#{$prefix}--no-gutter--start,
190
- .#{$prefix}--row.#{$prefix}--no-gutter--start [class*='#{$prefix}--col'] {
191
- padding-left: 0;
192
- }
193
-
194
- .#{$prefix}--no-gutter--end,
195
- .#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
196
- padding-right: 0;
197
- }
198
- }
199
-
200
- // -----------------------------------------------------------------------------
201
- // Hang
202
- // -----------------------------------------------------------------------------
203
-
204
- /// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
205
- /// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
206
- /// @param {Number} $gutter [$grid-gutter] - The gutter in the grid system
207
- /// @access private
208
- /// @group @carbon/grid
209
- @mixin -hang($gutter: $grid-gutter) {
210
- .#{$prefix}--hang--start {
211
- padding-left: ($gutter * 0.5);
212
- }
213
-
214
- .#{$prefix}--hang--end {
215
- padding-right: ($gutter * 0.5);
216
- }
217
- }
218
-
219
- // -----------------------------------------------------------------------------
220
- // Grid
221
- // -----------------------------------------------------------------------------
222
-
223
- /// Create the container for a grid. Will cause full-bleed for the grid unless
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
226
- /// @access private
227
- /// @group @carbon/grid
228
- @mixin -make-container($breakpoints: $grid-breakpoints) {
229
- margin-right: auto;
230
- margin-left: auto;
231
-
232
- @include -set-largest-breakpoint();
233
-
234
- @each $name, $value in $breakpoints {
235
- $prev-breakpoint: map.get($breakpoints, breakpoint-prev($name));
236
- $margin: map.get($value, margin);
237
-
238
- @if $prev-breakpoint {
239
- $prev-margin: map.get($prev-breakpoint, margin);
240
- @if $prev-margin != $margin {
241
- @include breakpoint($name) {
242
- padding-right: #{($grid-gutter * 0.5) + $margin};
243
- padding-left: #{($grid-gutter * 0.5) + $margin};
244
- }
245
- }
246
- } @else {
247
- @include breakpoint($name) {
248
- padding-right: #{($grid-gutter * 0.5) + $margin};
249
- padding-left: #{($grid-gutter * 0.5) + $margin};
250
- }
251
- }
252
- }
253
- }
254
-
255
- /// Get the last breakpoint width and set max-width to its value
256
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
257
- /// @access private
258
- /// @group @carbon/grid
259
- @mixin -set-largest-breakpoint($breakpoints: $grid-breakpoints) {
260
- $largest-breakpoint: last-map-item($breakpoints);
261
-
262
- max-width: map.get($largest-breakpoint, 'width');
263
- }
264
-
265
- /// Add in the max-widths for each breakpoint to the container
266
- /// @param {Map} $breakpoints [$grid-breakpoints] - A map of breakpoints where the key is the name
267
- /// @access private
268
- /// @group @carbon/grid
269
- @mixin -make-container-max-widths($breakpoints: $grid-breakpoints) {
270
- @each $name, $value in $breakpoints {
271
- @include breakpoint($name) {
272
- max-width: map.get($value, width);
273
- }
274
- }
275
- }
276
-
277
- /// Generate the CSS for a grid for the given breakpoints and gutters
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
281
- /// @access public
282
- /// @group @carbon/grid
283
- @mixin grid(
284
- $breakpoints: $grid-breakpoints,
285
- $grid-gutter: $grid-gutter,
286
- $condensed-gutter: $grid-gutter--condensed
287
- ) {
288
- .#{$prefix}--grid {
289
- @include -make-container($breakpoints);
290
- }
291
-
292
- @include largest-breakpoint($breakpoints) {
293
- .#{$prefix}--grid--full-width {
294
- max-width: 100%;
295
- }
296
- }
297
-
298
- .#{$prefix}--row {
299
- @include make-row();
300
- }
301
-
302
- .#{$prefix}--row-padding [class*='#{$prefix}--col'],
303
- .#{$prefix}--col-padding {
304
- padding-top: $grid-gutter * 0.5;
305
- padding-bottom: $grid-gutter * 0.5;
306
- }
307
-
308
- .#{$prefix}--grid--condensed [class*='#{$prefix}--col'] {
309
- padding-top: $condensed-gutter * 0.5;
310
- padding-bottom: $condensed-gutter * 0.5;
311
- }
312
-
313
- @include -make-grid-columns($breakpoints, $grid-gutter);
314
- @include -no-gutter();
315
- @include -hang($grid-gutter);
316
- }