@carbon/grid 10.12.0 → 10.14.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/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.12.0",
4
+ "version": "10.14.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/carbon-design-system/carbon/tree/master/packages/grid",
7
7
  "bugs": "https://github.com/carbon-design-system/carbon/issues",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@carbon/import-once": "^10.3.0",
31
- "@carbon/layout": "^10.11.0"
31
+ "@carbon/layout": "^10.12.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@carbon/bundler": "^10.9.0",
@@ -40,5 +40,5 @@
40
40
  "sassDir": "scss",
41
41
  "needs": "^1.3.0"
42
42
  },
43
- "gitHead": "ff543b3d3dbbf51170a185c0ecff62b7dca253c7"
43
+ "gitHead": "213cbde854a4958334cff9914b91863ce6debb9d"
44
44
  }
@@ -41,6 +41,13 @@
41
41
  padding-right: ($condensed-gutter / 2);
42
42
  padding-left: ($condensed-gutter / 2);
43
43
  }
44
+
45
+ // For our narrow use-case, our container hangs 16px into the gutter
46
+ .#{$prefix}--row--narrow &,
47
+ .#{$prefix}--grid--narrow & {
48
+ padding-right: ($gutter / 2);
49
+ padding-left: 0;
50
+ }
44
51
  }
45
52
 
46
53
  /// Define the width of the column for a given span and column count.
@@ -159,17 +166,28 @@
159
166
  // No gutter
160
167
  // -----------------------------------------------------------------------------
161
168
 
162
- /// Add `no-gutter` and `no-gutter--{left,right}` classes to the output CSS. These
169
+ /// Add `no-gutter` and `no-gutter--{start,end}` classes to the output CSS. These
163
170
  /// classes are useful for dropping the gutter in fluid situations.
164
171
  /// @access private
165
172
  /// @group @carbon/grid
166
173
  @mixin carbon--no-gutter {
167
174
  .#{$prefix}--no-gutter,
168
175
  .#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
176
+ padding-right: 0;
177
+ padding-left: 0;
178
+ }
179
+
180
+ .#{$prefix}--no-gutter--start,
181
+ .#{$prefix}--row.#{$prefix}--no-gutter--start [class*='#{$prefix}--col'] {
169
182
  padding-left: 0;
183
+ }
184
+
185
+ .#{$prefix}--no-gutter--end,
186
+ .#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
170
187
  padding-right: 0;
171
188
  }
172
189
 
190
+ // Deprecated ☠️
173
191
  .#{$prefix}--no-gutter--left,
174
192
  .#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
175
193
  padding-left: 0;
@@ -185,12 +203,21 @@
185
203
  // Hang
186
204
  // -----------------------------------------------------------------------------
187
205
 
188
- /// Add `hang--left` and `hang--right` classes for a given gutter. These classes are
189
- /// used alongside `no-gutter--left` and `no-gutter--right` to "hang" type.
206
+ /// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
207
+ /// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
190
208
  /// @param {Number} $gutter [$carbon--grid-gutter] - The gutter in the grid system
191
209
  /// @access private
192
210
  /// @group @carbon/grid
193
211
  @mixin carbon--hang($gutter: $carbon--grid-gutter) {
212
+ .#{$prefix}--hang--start {
213
+ padding-left: ($gutter / 2);
214
+ }
215
+
216
+ .#{$prefix}--hang--end {
217
+ padding-right: ($gutter / 2);
218
+ }
219
+
220
+ // Deprecated ☠️
194
221
  .#{$prefix}--hang--left {
195
222
  padding-left: ($gutter / 2);
196
223
  }
@@ -237,17 +264,17 @@ $carbon--aspect-ratios: (
237
264
  }
238
265
 
239
266
  .#{$prefix}--aspect-ratio::before {
240
- content: '';
241
- width: 1px;
242
- margin-left: -1px;
243
267
  float: left;
268
+ width: 1px;
244
269
  height: 0;
270
+ margin-left: -1px;
271
+ content: '';
245
272
  }
246
273
 
247
274
  .#{$prefix}--aspect-ratio::after {
248
- content: '';
249
275
  display: table;
250
276
  clear: both;
277
+ content: '';
251
278
  }
252
279
 
253
280
  @each $aspect-ratio in $aspect-ratios {
@@ -292,14 +319,14 @@ $carbon--aspect-ratios: (
292
319
  $prev-margin: map-get($prev-breakpoint, margin);
293
320
  @if $prev-margin != $margin {
294
321
  @include carbon--breakpoint($name) {
295
- padding-left: #{($carbon--grid-gutter / 2) + $margin};
296
322
  padding-right: #{($carbon--grid-gutter / 2) + $margin};
323
+ padding-left: #{($carbon--grid-gutter / 2) + $margin};
297
324
  }
298
325
  }
299
326
  } @else {
300
327
  @include carbon--breakpoint($name) {
301
- padding-left: #{($carbon--grid-gutter / 2) + $margin};
302
328
  padding-right: #{($carbon--grid-gutter / 2) + $margin};
329
+ padding-left: #{($carbon--grid-gutter / 2) + $margin};
303
330
  }
304
331
  }
305
332
  }
package/scss/_mixins.scss CHANGED
@@ -41,6 +41,13 @@
41
41
  padding-right: ($condensed-gutter / 2);
42
42
  padding-left: ($condensed-gutter / 2);
43
43
  }
44
+
45
+ // For our narrow use-case, our container hangs 16px into the gutter
46
+ .#{$prefix}--row--narrow &,
47
+ .#{$prefix}--grid--narrow & {
48
+ padding-right: ($gutter / 2);
49
+ padding-left: 0;
50
+ }
44
51
  }
45
52
 
46
53
  /// Define the width of the column for a given span and column count.
@@ -159,17 +166,28 @@
159
166
  // No gutter
160
167
  // -----------------------------------------------------------------------------
161
168
 
162
- /// Add `no-gutter` and `no-gutter--{left,right}` classes to the output CSS. These
169
+ /// Add `no-gutter` and `no-gutter--{start,end}` classes to the output CSS. These
163
170
  /// classes are useful for dropping the gutter in fluid situations.
164
171
  /// @access private
165
172
  /// @group @carbon/grid
166
173
  @mixin carbon--no-gutter {
167
174
  .#{$prefix}--no-gutter,
168
175
  .#{$prefix}--row.#{$prefix}--no-gutter [class*='#{$prefix}--col'] {
176
+ padding-right: 0;
177
+ padding-left: 0;
178
+ }
179
+
180
+ .#{$prefix}--no-gutter--start,
181
+ .#{$prefix}--row.#{$prefix}--no-gutter--start [class*='#{$prefix}--col'] {
169
182
  padding-left: 0;
183
+ }
184
+
185
+ .#{$prefix}--no-gutter--end,
186
+ .#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
170
187
  padding-right: 0;
171
188
  }
172
189
 
190
+ // Deprecated ☠️
173
191
  .#{$prefix}--no-gutter--left,
174
192
  .#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
175
193
  padding-left: 0;
@@ -185,12 +203,21 @@
185
203
  // Hang
186
204
  // -----------------------------------------------------------------------------
187
205
 
188
- /// Add `hang--left` and `hang--right` classes for a given gutter. These classes are
189
- /// used alongside `no-gutter--left` and `no-gutter--right` to "hang" type.
206
+ /// Add `hang--start` and `hang--end` classes for a given gutter. These classes are
207
+ /// used alongside `no-gutter--start` and `no-gutter--end` to "hang" type.
190
208
  /// @param {Number} $gutter [$carbon--grid-gutter] - The gutter in the grid system
191
209
  /// @access private
192
210
  /// @group @carbon/grid
193
211
  @mixin carbon--hang($gutter: $carbon--grid-gutter) {
212
+ .#{$prefix}--hang--start {
213
+ padding-left: ($gutter / 2);
214
+ }
215
+
216
+ .#{$prefix}--hang--end {
217
+ padding-right: ($gutter / 2);
218
+ }
219
+
220
+ // Deprecated ☠️
194
221
  .#{$prefix}--hang--left {
195
222
  padding-left: ($gutter / 2);
196
223
  }
@@ -237,17 +264,17 @@ $carbon--aspect-ratios: (
237
264
  }
238
265
 
239
266
  .#{$prefix}--aspect-ratio::before {
240
- content: '';
241
- width: 1px;
242
- margin-left: -1px;
243
267
  float: left;
268
+ width: 1px;
244
269
  height: 0;
270
+ margin-left: -1px;
271
+ content: '';
245
272
  }
246
273
 
247
274
  .#{$prefix}--aspect-ratio::after {
248
- content: '';
249
275
  display: table;
250
276
  clear: both;
277
+ content: '';
251
278
  }
252
279
 
253
280
  @each $aspect-ratio in $aspect-ratios {
@@ -292,14 +319,14 @@ $carbon--aspect-ratios: (
292
319
  $prev-margin: map-get($prev-breakpoint, margin);
293
320
  @if $prev-margin != $margin {
294
321
  @include carbon--breakpoint($name) {
295
- padding-left: #{($carbon--grid-gutter / 2) + $margin};
296
322
  padding-right: #{($carbon--grid-gutter / 2) + $margin};
323
+ padding-left: #{($carbon--grid-gutter / 2) + $margin};
297
324
  }
298
325
  }
299
326
  } @else {
300
327
  @include carbon--breakpoint($name) {
301
- padding-left: #{($carbon--grid-gutter / 2) + $margin};
302
328
  padding-right: #{($carbon--grid-gutter / 2) + $margin};
329
+ padding-left: #{($carbon--grid-gutter / 2) + $margin};
303
330
  }
304
331
  }
305
332
  }
@@ -19,7 +19,7 @@ $carbon--grid-gutter: carbon--rem(32px);
19
19
  /// @type Number
20
20
  /// @access public
21
21
  /// @group @carbon/layout
22
- $carbon--grid-gutter--condensed: carbon--rem(2px);
22
+ $carbon--grid-gutter--condensed: carbon--rem(1px);
23
23
 
24
24
  // Initial map of our breakpoints and their values
25
25
  /// @type Map
@@ -125,7 +125,7 @@ $carbon--grid-breakpoints: (
125
125
  @return '-#{$name}';
126
126
  }
127
127
 
128
- /// Generate a media query up to the width of the given breakpoint name
128
+ /// Generate a media query from the width of the given breakpoint to infinity
129
129
  /// @param {String | Number} $name
130
130
  /// @param {Map} $breakpoints [$carbon--grid-breakpoints] - A map of breakpoints where the key is the name
131
131
  /// @content