@carbon/ibmdotcom-styles 2.14.0-rc.1 → 2.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/ibmdotcom-styles",
3
3
  "description": "Carbon for IBM.com Styles",
4
- "version": "2.14.0-rc.1",
4
+ "version": "2.14.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/ibm-dotcom-styles.min.css",
7
7
  "module": "src/scss",
@@ -48,5 +48,5 @@
48
48
  "sass": "~1.79.0",
49
49
  "sass-loader": "^13.0.0"
50
50
  },
51
- "gitHead": "f43d0d1f569111571d55e423a7837ebf2c1f9db0"
51
+ "gitHead": "fae42ec3ddfea3ce3833188ea18d879949a6cc7a"
52
52
  }
@@ -14,6 +14,7 @@
14
14
  @use '@carbon/styles/scss/components/tag/index' as *;
15
15
  @use '@carbon/styles/scss/components/tile/index' as *;
16
16
  @use '@carbon/styles/scss/theme' as *;
17
+ @use '@carbon/styles/scss/utilities/convert' as *;
17
18
  @use '../../globals/vars' as *;
18
19
  @use '../../globals/utils/content-width' as *;
19
20
  @use '../../globals/utils/ratio-base' as *;
@@ -22,58 +22,15 @@
22
22
  @use '../../globals/utils/aspect-ratio' as *;
23
23
  @use '../../globals/utils/hang' as *;
24
24
 
25
- $fcb-large-custom-bp-copy: 992px;
26
- $fcb-large-custom-bp-nocopy: 752px;
27
- $fcb-breakpoint-up--lg: map.get(map.get($grid-breakpoints, 'lg'), 'width') -
28
- to-rem(1px);
29
-
30
25
  $feature-flags: (
31
26
  enable-experimental-tile-contrast: true,
32
27
  );
33
28
 
34
- @mixin card {
35
- @include breakpoint-down(md) {
36
- inset: 0;
37
- padding-block-start: 0;
38
- }
39
-
40
- @include breakpoint(md) {
41
- flex-direction: row;
42
- }
43
-
44
- .#{$prefix}--card__heading,
45
- ::slotted(#{$c4d-prefix}-card-heading) {
46
- margin-block-end: $spacing-07;
47
- }
48
-
49
- &:focus-within {
50
- outline: none;
51
- outline-offset: 0;
52
-
53
- &::before {
54
- position: absolute;
55
- z-index: 1;
56
- display: block;
57
- border: $spacing-01 solid $focus;
58
- content: '';
59
- inset: -1px;
60
- outline: 1px solid $focus-inset;
61
- outline-offset: -3px;
62
-
63
- @include breakpoint-down(md) {
64
- min-block-size: 292px;
65
- }
66
- }
67
- }
68
- }
69
-
70
29
  @mixin feature-card {
71
- // all feature cards
30
+ // All feature cards.
72
31
  :host(#{$c4d-prefix}-feature-card),
73
- :host(#{$c4d-prefix}-feature-cta),
74
- .#{$prefix}--feature-card-large,
75
- .#{$prefix}--feature-card {
76
- position: relative;
32
+ :host(#{$c4d-prefix}-feature-cta) {
33
+ display: block;
77
34
  // breaks on Firefox with `rem` function
78
35
  border-width: 1px;
79
36
  border-style: solid;
@@ -94,203 +51,15 @@ $feature-flags: (
94
51
  border-color: transparent;
95
52
  }
96
53
 
97
- @include breakpoint-down(md) {
98
- @include make-row;
99
- }
100
-
101
- .#{$prefix}--card__content {
102
- transition: background-color $duration-moderate-01
103
- motion(standard, productive);
104
- }
105
-
106
- ::slotted([slot='image']),
107
- #{$c4d-prefix}-image,
108
- .#{$prefix}--image {
109
- block-size: aspect-ratio(2, 1);
110
- inline-size: 100%;
111
- @media screen and (prefers-reduced-motion: reduce) {
112
- &::before {
113
- position: absolute;
114
- z-index: 1;
115
- block-size: 100%;
116
- content: '';
117
- inline-size: 100%;
118
- inset-block-start: 0;
119
- inset-inline-start: 0;
120
- opacity: 0;
121
- transition: none;
122
- }
123
- }
124
-
125
- &::before {
126
- position: absolute;
127
- z-index: 1;
128
- block-size: 100%;
129
- content: '';
130
- inline-size: 100%;
131
- inset-block-start: 0;
132
- inset-inline-start: 0;
133
- opacity: 0;
134
- transition: opacity $duration-moderate-01 motion(standard, productive);
135
- }
136
- }
137
- }
138
-
139
- :host(#{$c4d-prefix}-feature-card),
140
- :host(#{$c4d-prefix}-feature-cta) {
141
- display: block;
142
- outline: none;
143
-
144
- @include breakpoint-down(md) {
145
- display: flex;
146
-
147
- .#{$prefix}--card__wrapper {
148
- display: flex;
149
- block-size: auto;
150
- min-block-size: 0;
151
-
152
- .#{$prefix}--card__content {
153
- padding: $spacing-05;
154
- block-size: 100%;
155
- }
156
- }
157
-
158
- .#{$prefix}--card--link {
159
- display: block;
160
- }
161
- }
162
- }
163
-
164
- // feature cards that are not size large
165
- .#{$prefix}--feature-card,
166
- :host(#{$c4d-prefix}-feature-card:not([size='large'])),
167
- :host(#{$c4d-prefix}-feature-cta:not([size='large'])) {
168
- @include breakpoint-down(md) {
169
- .#{$prefix}--card__content {
170
- justify-content: space-between;
171
- padding: $spacing-05;
172
- block-size: 100%;
173
- }
174
-
175
- #{$prefix}--card__heading {
176
- padding: $spacing-05;
177
- margin: 0;
178
- inline-size: 100%;
179
- padding-block-end: $spacing-07;
180
- padding-inline-end: 10%;
181
- }
182
-
183
- .#{$prefix}--card__footer {
184
- margin-block-start: -1 * $spacing-07;
185
- padding-block-start: 0;
186
- }
187
-
188
- .#{$prefix}--card__wrapper {
189
- display: flex;
190
- block-size: auto;
191
- min-block-size: 0;
192
- }
193
- .#{$prefix}--card {
194
- display: block;
195
- }
196
- }
197
-
198
54
  .#{$prefix}--card {
199
- @include card;
200
-
201
- margin: 0;
202
- }
203
-
204
- .#{$prefix}--card__heading {
205
- margin-block-end: $spacing-07;
206
- }
207
-
208
- .#{$prefix}--card__wrapper {
209
- block-size: aspect-ratio(2, 1);
210
- inline-size: 100%;
211
-
212
- @include breakpoint(md) {
213
- block-size: auto;
214
- inline-size: 50%;
215
- }
216
-
217
- .#{$prefix}--card__content {
218
- block-size: auto;
219
- min-block-size: 100%;
55
+ @include breakpoint-down(md) {
56
+ display: block;
220
57
  }
221
- }
222
-
223
- // image
224
-
225
- ::slotted([slot='image']),
226
- #{$c4d-prefix}-image,
227
- .#{$prefix}--image {
228
- z-index: 0;
229
58
 
230
59
  @include breakpoint(md) {
231
- block-size: 100%;
232
- inline-size: 50%;
233
- padding-block-start: aspect-ratio(2, 1);
234
- }
235
- }
236
-
237
- // footer
238
-
239
- .#{$prefix}--feature-card__card .#{$prefix}--card__footer {
240
- flex-direction: row-reverse;
241
- @include breakpoint-down(md) {
242
60
  flex-direction: row;
243
61
  }
244
62
 
245
- svg {
246
- @include breakpoint(sm) {
247
- block-size: to-rem(20px);
248
- inline-size: to-rem(20px);
249
- }
250
-
251
- @include breakpoint(md) {
252
- block-size: $spacing-06;
253
- inline-size: $spacing-06;
254
- }
255
-
256
- @include breakpoint(max) {
257
- block-size: $spacing-07;
258
- inline-size: $spacing-07;
259
- }
260
- }
261
- }
262
-
263
- ::slotted(svg[slot='footer']) {
264
- margin-block-start: auto;
265
- margin-inline-start: auto;
266
- }
267
- }
268
-
269
- // feature cards that are size large
270
- :host(#{$c4d-prefix}-feature-card[size='large']),
271
- :host(#{$c4d-prefix}-feature-cta[size='large']) {
272
- position: relative;
273
- background-color: $layer-01;
274
- color: $text-primary;
275
- margin-block-end: $spacing-07;
276
- @include hang;
277
-
278
- @include breakpoint(md) {
279
- margin-block-end: $spacing-10;
280
- padding-block-start: aspect-ratio(2, 1);
281
- }
282
-
283
- @include breakpoint(lg) {
284
- margin-block-end: $spacing-12;
285
- }
286
-
287
- @include breakpoint(xlg) {
288
- padding-block-start: aspect-ratio(2, 1);
289
- }
290
-
291
- .#{$prefix}--card {
292
- block-size: 100%;
293
-
294
63
  &:focus-within {
295
64
  outline: none;
296
65
  outline-offset: 0;
@@ -310,189 +79,112 @@ $feature-flags: (
310
79
  }
311
80
  }
312
81
  }
313
-
314
- @include breakpoint(md) {
315
- position: absolute;
316
- flex-direction: row;
317
- inset: 0;
318
- }
319
-
320
- ::slotted([slot='image']),
321
- #{$c4d-prefix}-image,
322
- .#{$prefix}--image {
323
- z-index: 0;
324
-
325
- @include breakpoint(md) {
326
- block-size: 100%;
327
- inline-size: 50%;
328
- padding-block-start: aspect-ratio(2, 1);
329
- }
330
-
331
- @include breakpoint(xlg) {
332
- block-size: 100%;
333
- }
334
- }
335
-
336
- .#{$prefix}--image {
337
- overflow-y: hidden;
338
- }
339
82
  }
340
83
 
84
+ .#{$prefix}--card__image-wrapper,
341
85
  .#{$prefix}--card__wrapper {
342
- block-size: auto;
343
- min-block-size: 50%;
344
-
345
- &::before {
346
- padding-block-start: 0;
86
+ flex: 1 0 50%;
87
+ }
347
88
 
348
- @include breakpoint(md) {
349
- padding-block-start: 50%;
350
- }
89
+ .#{$prefix}--card__wrapper {
90
+ &::before,
91
+ &::after {
92
+ display: none;
351
93
  }
94
+ }
352
95
 
353
- .#{$prefix}--card__eyebrow,
354
- .#{$prefix}--card__heading,
355
- .#{$prefix}--card__copy,
356
- ::slotted(#{$c4d-prefix}-card-eyebrow),
357
- ::slotted(#{$c4d-prefix}-card-heading) {
358
- inline-size: 100%;
359
- max-inline-size: to-rem(480px);
96
+ .#{$prefix}--card__content {
97
+ justify-content: space-between;
98
+ padding: $spacing-05;
99
+ aspect-ratio: 2 / 1;
100
+ transition: background-color $duration-moderate-01
101
+ motion(standard, productive);
360
102
 
361
- @include breakpoint(md) {
362
- inline-size: 90%;
363
- }
103
+ @include breakpoint(md) {
104
+ aspect-ratio: auto;
364
105
  }
106
+ }
365
107
 
366
- .#{$prefix}--card__content {
367
- padding: $spacing-07 $spacing-05 $spacing-05;
108
+ .#{$prefix}--card__eyebrow-wrapper--empty,
109
+ .#{$prefix}--card__pictogram-wrapper--empty {
110
+ display: none;
111
+ }
368
112
 
369
- @include breakpoint(md) {
370
- padding: $spacing-05;
371
- }
113
+ .#{$prefix}--card__copy {
114
+ @include type-style('body-02');
372
115
 
373
- @include breakpoint(xlg) {
374
- padding: $spacing-07;
375
- }
116
+ @include breakpoint(md) {
117
+ @include type-style('body-01');
376
118
  }
377
119
 
378
- .#{$prefix}--card__eyebrow,
379
- ::slotted(#{$c4d-prefix}-card-eyebrow) {
380
- margin: 0 0 $spacing-03 0;
120
+ @include breakpoint(lg) {
121
+ @include type-style('body-02');
381
122
  }
123
+ }
382
124
 
383
- .#{$prefix}--card__heading,
384
- ::slotted(#{$c4d-prefix}-card-heading) {
385
- margin-block-end: $spacing-07;
386
-
387
- @include breakpoint(sm) {
388
- @include type-style('heading-03');
389
- }
125
+ ::slotted([slot='image']),
126
+ #{$c4d-prefix}-image {
127
+ z-index: 0;
390
128
 
391
- @include breakpoint(lg) {
392
- @include type-style('heading-04');
393
- }
129
+ // Opacity is adjusted on hover. See above.
130
+ &::before {
131
+ position: absolute;
132
+ z-index: 1;
133
+ block-size: 100%;
134
+ content: '';
135
+ inline-size: 100%;
136
+ inset-block-start: 0;
137
+ inset-inline-start: 0;
138
+ opacity: 0;
139
+ transition: opacity $duration-moderate-01 motion(standard, productive);
394
140
  }
395
141
 
396
- .#{$prefix}--card__copy {
397
- @include type-style('body-02');
398
-
399
- @include breakpoint(md) {
400
- @include type-style('body-01');
401
- }
402
-
403
- @include breakpoint(lg) {
404
- @include type-style('body-02');
405
- }
406
-
407
- @include breakpoint-down(md) {
408
- margin-block-end: $spacing-07;
409
- }
410
-
411
- /* stylelint-disable value-no-vendor-prefix, property-no-vendor-prefix */
412
- @include breakpoint-between(md, lg) {
413
- ::slotted(*) {
414
- display: -webkit-box;
415
- block-size: 100%;
416
- -webkit-box-orient: vertical;
417
- -webkit-line-clamp: 8;
418
- white-space: normal;
419
- word-break: break-word;
420
- }
142
+ @media screen and (prefers-reduced-motion: reduce) {
143
+ &::before {
144
+ transition: none;
421
145
  }
422
- /* stylelint-enable value-no-vendor-prefix, property-no-vendor-prefix */
423
146
  }
424
147
  }
425
148
 
426
- .#{$prefix}--card__footer {
427
- flex-direction: row;
149
+ ::slotted(#{$c4d-prefix}-card-eyebrow),
150
+ ::slotted(#{$c4d-prefix}-card-heading) {
151
+ inline-size: 100%;
428
152
 
429
- @include breakpoint(xlg) {
430
- flex-direction: row-reverse;
153
+ @include breakpoint(md) {
154
+ inline-size: 90%;
431
155
  }
432
156
  }
433
157
 
434
- // special breakpoint for no copy present
435
- &.#{$prefix}--feature-card-large_no-copy-text {
436
- @include breakpoint($fcb-large-custom-bp-nocopy) {
437
- padding-block-start: aspect-ratio(2, 1);
438
- }
439
-
440
- .#{$prefix}--card {
441
- @include breakpoint($fcb-large-custom-bp-nocopy) {
442
- position: absolute;
443
- flex-direction: row;
444
- inset: 0;
445
-
446
- &__wrapper,
447
- .#{$prefix}--image {
448
- block-size: 100%;
449
- inline-size: 50%;
450
- }
451
- }
452
- }
158
+ ::slotted(#{$c4d-prefix}-card-heading) {
159
+ margin-block-end: $spacing-07;
453
160
  }
454
- }
455
161
 
456
- :host(#{$c4d-prefix}-feature-card-footer)
457
- .#{$c4d-prefix}-ce--card__footer
458
- ::slotted(svg[slot='icon']),
459
- .#{$prefix}--feature-card-large
460
- .#{$prefix}--feature-card-large__card.#{$prefix}--tile
461
- .#{$prefix}--card__cta,
462
- .#{$prefix}--feature-card-large
463
- .#{$prefix}--feature-card-large__card.#{$prefix}--tile
464
- .#{$prefix}--card__cta:visited {
465
- float: none;
466
- margin-block-start: auto;
467
-
468
- @include breakpoint(sm) {
469
- block-size: to-rem(20px);
470
- inline-size: to-rem(20px);
162
+ ::slotted(#{$c4d-prefix}-card-eyebrow) {
163
+ margin-inline-end: $spacing-03;
471
164
  }
165
+ }
472
166
 
473
- @include breakpoint(md) {
474
- block-size: $spacing-06;
475
- inline-size: $spacing-06;
167
+ // All large feature cards.
168
+ :host(#{$c4d-prefix}-feature-card)[size='large'],
169
+ :host(#{$c4d-prefix}-feature-cta)[size='large'] {
170
+ .#{$prefix}--card__content {
171
+ @include breakpoint(xlg) {
172
+ padding: $spacing-07;
173
+ }
476
174
  }
477
175
 
478
- @include breakpoint(max) {
479
- block-size: $spacing-07;
480
- inline-size: $spacing-07;
176
+ ::slotted(#{$c4d-prefix}-card-heading) {
177
+ @include breakpoint(xlg) {
178
+ @include type-style('heading-04');
179
+ }
481
180
  }
482
-
483
- @include type-style('productive-heading-05');
484
181
  }
485
182
 
486
- // inverse color scheme
183
+ // Color changes for inverse color scheme.
487
184
  :host(#{$c4d-prefix}-feature-card)[color-scheme='inverse'],
488
185
  :host(#{$c4d-prefix}-feature-cta)[color-scheme='inverse'] {
489
186
  border-color: $border-inverse;
490
187
 
491
- .#{$prefix}--card__heading,
492
- ::slotted(#{$c4d-prefix}-card-heading) {
493
- color: $icon-inverse;
494
- }
495
-
496
188
  ::slotted(#{$c4d-prefix}-card-heading) {
497
189
  color: $focus-inset;
498
190
  }
@@ -510,17 +202,13 @@ $feature-flags: (
510
202
  }
511
203
  }
512
204
 
513
- // feature cards that are not size large
205
+ // Feature cards that are not size large. Color changes.
514
206
  :host(
515
207
  #{$c4d-prefix}-feature-card:not([size='large'])
516
208
  )[color-scheme='inverse'],
517
209
  :host(
518
210
  #{$c4d-prefix}-feature-cta:not([size='large'])
519
211
  )[color-scheme='inverse'] {
520
- .#{$prefix}--card__heading {
521
- color: $icon-inverse;
522
- }
523
-
524
212
  .#{$prefix}--card__wrapper {
525
213
  background-color: $background-inverse;
526
214
  }
@@ -535,14 +223,13 @@ $feature-flags: (
535
223
  }
536
224
  }
537
225
 
538
- // feature cards that are size large
226
+ // Feature cards that are size large. Color changes for inverse color scheme.
539
227
  :host(#{$c4d-prefix}-feature-card[size='large'])[color-scheme='inverse'],
540
228
  :host(#{$c4d-prefix}-feature-cta[size='large'])[color-scheme='inverse'] {
541
229
  .#{$prefix}--card__wrapper {
542
230
  background-color: $background-inverse;
543
231
 
544
232
  .#{$prefix}--card__eyebrow,
545
- .#{$prefix}--card__heading,
546
233
  .#{$prefix}--card__copy,
547
234
  ::slotted(#{$c4d-prefix}-card-eyebrow),
548
235
  ::slotted(#{$c4d-prefix}-card-heading) {
@@ -553,7 +240,6 @@ $feature-flags: (
553
240
  color: $icon-inverse;
554
241
  }
555
242
 
556
- .#{$prefix}--card__heading,
557
243
  ::slotted(#{$c4d-prefix}-card-heading) {
558
244
  color: $icon-inverse;
559
245
  }
@@ -59,6 +59,11 @@
59
59
 
60
60
  display: block;
61
61
  margin-block-end: $spacing-07;
62
+
63
+ ::slotted(h3) {
64
+ // stylelint-disable-next-line declaration-no-important
65
+ font-size: inherit !important;
66
+ }
62
67
  }
63
68
 
64
69
  :host(#{$c4d-prefix}-content-group-heading),