@primer/brand-css 0.67.0-rc.aeae84f6 → 0.67.0-rc.eb80fcc4

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.
@@ -1,22 +1,28 @@
1
1
  .Card {
2
+ /* Keeps the dynamic height row on the description slot in the default layout so variable-height content fills the card body. */
3
+ --Card-grid-template-rows: auto auto auto auto auto auto 1fr auto;
4
+
2
5
  text-decoration: none;
3
6
  color: var(--brand-color-text-default);
4
- border-radius: var(--brand-borderRadius-xlarge);
7
+
5
8
  transition: transform var(--brand-Card-animation-duration) var(--brand-Card-animation-easing);
6
9
  padding: var(--base-size-32);
7
10
  display: grid;
8
11
  grid-template-columns: 1fr 1fr;
9
12
  grid-template-areas:
10
13
  'image image'
14
+ 'leadingVisual leadingVisual'
11
15
  'icon icon'
16
+ 'tokens tokens'
12
17
  'label label'
13
18
  'heading heading'
14
19
  'description description'
15
20
  'action action';
16
21
  flex: auto;
17
- grid-template-rows: auto auto auto auto 1fr;
22
+ grid-template-rows: var(--Card-grid-template-rows);
18
23
  position: relative;
19
24
  height: 100%;
25
+ border-radius: var(--brand-borderRadius-medium);
20
26
  }
21
27
 
22
28
  .Card--align-center .Card {
@@ -34,7 +40,9 @@
34
40
  grid-template-columns: 1fr;
35
41
  grid-template-areas:
36
42
  'image'
43
+ 'leadingVisual'
37
44
  'icon'
45
+ 'tokens'
38
46
  'label'
39
47
  'heading'
40
48
  'description'
@@ -42,10 +50,54 @@
42
50
  justify-items: center;
43
51
  }
44
52
 
53
+ .Card--backgroundColor-default {
54
+ background-color: var(--brand-Card-background-default);
55
+ }
56
+
57
+ .Card--backgroundColor-subtle {
58
+ background-color: var(--brand-color-canvas-subtle);
59
+ }
60
+
61
+ .Card--backgroundColor-none {
62
+ background-color: transparent;
63
+ }
64
+
65
+ .Card--tokensPosition-block-end {
66
+ /* Moves the dynamic height row from tokens back to description because the block-end layout places tokens below the body copy. */
67
+ --Card-grid-template-rows: auto auto auto auto auto 1fr auto auto;
68
+
69
+ grid-template-areas:
70
+ 'image image'
71
+ 'leadingVisual leadingVisual'
72
+ 'icon icon'
73
+ 'label label'
74
+ 'heading heading'
75
+ 'description description'
76
+ 'tokens tokens'
77
+ 'action action';
78
+ }
79
+
80
+ .Card--align-center .Card--tokensPosition-block-end {
81
+ grid-template-areas:
82
+ 'image'
83
+ 'leadingVisual'
84
+ 'icon'
85
+ 'label'
86
+ 'heading'
87
+ 'description'
88
+ 'tokens'
89
+ 'action';
90
+ }
91
+
45
92
  /** Block end image position option */
46
93
  .Card--imagePos-block-end {
94
+ /* Moves the dynamic height row from action back to description because the image is rendered after the content in this layout. */
95
+ --Card-grid-template-rows: auto auto auto auto auto 1fr auto auto;
96
+
47
97
  grid-template-areas:
98
+ 'leadingVisual leadingVisual'
48
99
  'icon icon'
100
+ 'tokens tokens'
49
101
  'label label'
50
102
  'heading heading'
51
103
  'description description'
@@ -55,14 +107,47 @@
55
107
 
56
108
  .Card--align-center .Card--imagePos-block-end {
57
109
  grid-template-areas:
110
+ 'leadingVisual'
111
+ 'icon'
112
+ 'tokens'
113
+ 'label'
114
+ 'heading'
115
+ 'description'
116
+ 'action'
117
+ 'image';
118
+ }
119
+
120
+ .Card--imagePos-block-end.Card--tokensPosition-block-end {
121
+ /* Moves the dynamic height row from tokens back to description because both the tokens and image are rendered after the body copy here. */
122
+ --Card-grid-template-rows: auto auto auto auto 1fr auto auto auto;
123
+
124
+ grid-template-areas:
125
+ 'leadingVisual leadingVisual'
126
+ 'icon icon'
127
+ 'label label'
128
+ 'heading heading'
129
+ 'description description'
130
+ 'tokens tokens'
131
+ 'action action'
132
+ 'image image';
133
+ }
134
+
135
+ .Card--align-center .Card--imagePos-block-end.Card--tokensPosition-block-end {
136
+ grid-template-areas:
137
+ 'leadingVisual'
58
138
  'icon'
59
139
  'label'
60
140
  'heading'
61
141
  'description'
142
+ 'tokens'
62
143
  'action'
63
144
  'image';
64
145
  }
65
146
 
147
+ .Card--hasLeadingVisual {
148
+ padding: var(--base-size-64) var(--base-size-40);
149
+ }
150
+
66
151
  .Card--imagePos-block-end .Card__image {
67
152
  margin-bottom: 0;
68
153
  margin-top: var(--base-size-28);
@@ -84,9 +169,8 @@
84
169
  padding: 0;
85
170
  }
86
171
 
87
- .Card--variant-default,
88
- .Card--variant-torchlight.Card--colorMode-light {
89
- background-color: var(--brand-Card-background-default);
172
+ .Card--ctaVariant-arrow {
173
+ --Card-arrowAction-endInset: var(--base-size-40);
90
174
  }
91
175
 
92
176
  .Card:hover {
@@ -138,11 +222,11 @@
138
222
 
139
223
  .Card--border {
140
224
  border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);
225
+ border-radius: var(--brand-borderRadius-medium);
141
226
  }
142
227
 
143
228
  .Card__outer {
144
229
  height: 100%;
145
- border-radius: var(--brand-borderRadius-xlarge);
146
230
  }
147
231
 
148
232
  .Card__outer:has(.Card--variant-minimal) {
@@ -151,6 +235,7 @@
151
235
 
152
236
  .Card__outer:focus-within {
153
237
  outline: var(--brand-borderWidth-thick) solid var(--brand-color-focus);
238
+ border-radius: var(--brand-borderRadius-medium);
154
239
  }
155
240
 
156
241
  .Card__outer:has(.Card--variant-minimal):focus-within {
@@ -159,34 +244,12 @@
159
244
  ); /* This value is adjusted so that, when combined with the container's border radius, the total border radius equals `var(--brand-borderRadius-medium)` */
160
245
  }
161
246
 
162
- .Card--icon {
163
- grid-template-areas:
164
- 'image image'
165
- 'icon label'
166
- 'heading heading'
167
- 'description description'
168
- 'action action';
169
- }
170
-
171
- .Card--icon .Card__label {
172
- justify-self: flex-end;
173
- }
174
-
175
- .Card--align-center .Card--icon .Card__label {
176
- justify-self: center;
177
- }
178
-
179
- .Card--icon .Card__label,
180
- .Card--icon .Card__icon {
181
- align-self: center;
182
- }
183
-
184
- .Card:not(.Card--disableAnimation, .Card--variant-torchlight.Card--colorMode-dark):hover {
247
+ .Card:not(.Card--disableAnimation):hover {
185
248
  transform: scale3d(1.025, 1.025, 1);
186
249
  }
187
250
 
188
251
  .Card__image {
189
- margin-bottom: var(--base-size-28);
252
+ margin-block-end: var(--base-size-28);
190
253
  border-radius: var(--brand-borderRadius-medium);
191
254
  overflow: hidden;
192
255
  grid-area: image;
@@ -198,31 +261,159 @@
198
261
  display: block;
199
262
  }
200
263
 
264
+ .Card__leadingVisual {
265
+ margin-block-end: var(--base-size-36);
266
+ display: flex;
267
+ align-items: center;
268
+ grid-area: leadingVisual;
269
+ }
270
+
271
+ .Card--align-center .Card__leadingVisual {
272
+ justify-content: center;
273
+ }
274
+
275
+ .Card__leadingVisualItem {
276
+ display: block;
277
+ max-width: 100%;
278
+ height: var(--base-size-40);
279
+ width: auto;
280
+ }
281
+
201
282
  .Card__icon {
202
283
  margin-bottom: var(--base-size-24);
203
284
  grid-area: icon;
204
285
  }
205
286
 
287
+ .Card__tokens {
288
+ display: flex;
289
+ flex-wrap: wrap;
290
+ gap: var(--base-size-8);
291
+ grid-area: tokens;
292
+ margin-bottom: var(--base-size-20);
293
+ }
294
+
295
+ .Card--align-center .Card__tokens {
296
+ justify-content: center;
297
+ }
298
+
299
+ .Card__tokens--position-block-end {
300
+ margin-block-start: var(--base-size-20);
301
+ margin-block-end: 0;
302
+ }
303
+
206
304
  .Card__label {
207
- margin-bottom: var(--base-size-24);
305
+ margin-block-end: var(--base-size-20);
208
306
  grid-area: label;
209
307
  }
210
308
 
211
309
  .Card__heading {
212
- margin-bottom: var(--base-size-20);
310
+ margin-block-end: var(--base-size-20);
213
311
  grid-area: heading;
214
312
  }
215
313
 
216
314
  .Card__description {
217
- margin-bottom: var(--base-size-32);
315
+ margin-block-end: var(--base-size-32);
218
316
  grid-area: description;
219
317
  }
220
318
 
221
319
  .Card__action {
222
320
  grid-area: action;
223
- margin-top: auto;
321
+ margin-block-start: auto;
224
322
  display: inline-flex;
225
323
  align-items: center;
324
+ max-inline-size: 100%;
325
+ pointer-events: none;
326
+ }
327
+
328
+ .Card__actionIcon {
329
+ display: inline-flex;
330
+ align-items: center;
331
+ justify-content: center;
332
+ flex-shrink: 0;
333
+ }
334
+
335
+ .Card__actionLabel {
336
+ display: block;
337
+ min-inline-size: 0;
338
+ overflow: hidden;
339
+ text-overflow: ellipsis;
340
+ white-space: nowrap;
341
+ }
342
+
343
+ .Card:not(.Card--ctaVariant-arrow) .Card__action {
344
+ inline-size: 100%;
345
+ min-inline-size: 0;
346
+ }
347
+
348
+ .Card:not(.Card--ctaVariant-arrow) .Card__action > span:first-child {
349
+ min-inline-size: 0;
350
+ }
351
+
352
+ .Card:not(.Card--ctaVariant-arrow) .Card__actionLabel {
353
+ overflow: visible;
354
+ text-overflow: clip;
355
+ white-space: normal;
356
+ overflow-wrap: anywhere;
357
+ }
358
+
359
+ .Card--align-center:not(.Card--ctaVariant-arrow) .Card__actionLabel {
360
+ text-align: center;
361
+ }
362
+
363
+ .Card__actionLabelClip {
364
+ --actionLabelClip-duration: 400ms;
365
+ display: inline-flex;
366
+ flex: 1 1 auto;
367
+ align-items: center;
368
+ align-self: stretch;
369
+ min-inline-size: 0;
370
+ overflow: hidden;
371
+ max-inline-size: 0;
372
+ background-color: transparent;
373
+ opacity: 0;
374
+ transform: translateX(calc(var(--base-size-12) * -1));
375
+ transition: max-inline-size var(--actionLabelClip-duration) var(--brand-Card-animation-easing),
376
+ opacity var(--actionLabelClip-duration) ease-out, transform var(--actionLabelClip-duration) ease-out,
377
+ margin-inline var(--actionLabelClip-duration) ease-out, padding-inline var(--actionLabelClip-duration) ease-out;
378
+ }
379
+
380
+ .Card--tokensPosition-block-end .Card__action {
381
+ margin-block-start: var(--base-size-20);
382
+ }
383
+
384
+ .Card__action--arrowOnly {
385
+ --actionArrow-duration: 300ms;
386
+
387
+ margin-block-start: var(--base-size-20);
388
+ min-height: var(--base-size-40);
389
+ width: -moz-fit-content;
390
+ width: fit-content;
391
+ min-inline-size: 0;
392
+ max-inline-size: calc(100% - var(--Card-arrowAction-endInset));
393
+ justify-content: flex-start;
394
+ -moz-column-gap: 0;
395
+ column-gap: 0;
396
+ padding-block: var(--base-size-4);
397
+ padding-inline: 0;
398
+ border: var(--brand-borderWidth-thin) solid transparent;
399
+ border-radius: var(--brand-borderRadius-full);
400
+ background-color: transparent;
401
+ flex-shrink: 0;
402
+ overflow: hidden;
403
+ transition: border-color var(--actionArrow-duration) ease-out, background-color var(--actionArrow-duration) ease-out,
404
+ column-gap var(--actionArrow-duration) ease-out, padding-inline var(--actionArrow-duration) ease-out;
405
+ transition: border-color var(--actionArrow-duration) ease-out, background-color var(--actionArrow-duration) ease-out,
406
+ column-gap var(--actionArrow-duration) ease-out, padding-inline var(--actionArrow-duration) ease-out, -moz-column-gap var(--actionArrow-duration) ease-out;
407
+ }
408
+
409
+ .Card__actionIcon--arrowOnly {
410
+ width: var(--base-size-32);
411
+ min-width: var(--base-size-32);
412
+ height: var(--base-size-32);
413
+ min-height: var(--base-size-32);
414
+ border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);
415
+ border-radius: var(--brand-borderRadius-full);
416
+ background-color: var(--brand-color-canvas-default);
226
417
  }
227
418
 
228
419
  .Card--align-center .Card__action {
@@ -234,10 +425,9 @@
234
425
  color: var(--brand-Link-color-accent);
235
426
  }
236
427
 
237
- .Card--skew {
238
- height: 100%;
239
- border-radius: var(--brand-borderRadius-xlarge);
240
- overflow: hidden;
428
+ .Card__action,
429
+ .Card__action * {
430
+ cursor: inherit;
241
431
  }
242
432
 
243
433
  .Card--skew:focus-within {
@@ -249,7 +439,7 @@
249
439
  }
250
440
 
251
441
  .Card__skew-bounding {
252
- border-radius: var(--brand-borderRadius-xlarge);
442
+ border-radius: var(--brand-borderRadius-medium);
253
443
  position: relative;
254
444
  overflow: hidden;
255
445
  z-index: 1;
@@ -278,11 +468,56 @@
278
468
  margin-inline-start: var(--base-size-4);
279
469
  }
280
470
 
281
- .Card:has(.Card__link:hover) .Card--expandableArrow {
282
- transform: translateX(var(--base-size-4));
471
+ .Card--ctaVariant-arrow .Card--expandableArrow {
472
+ --ExpandableArrow-duration: var(--brand-Card-animation-duration);
473
+ --ExpandableArrow-easing: var(--brand-Card-animation-easing);
474
+ }
475
+
476
+ .Card__actionIcon--arrowOnly .Card--expandableArrow {
477
+ margin-inline-start: 0;
478
+ }
479
+
480
+ .Card--ctaVariant-arrow .Card__description {
481
+ margin-bottom: var(--base-size-12);
482
+ }
483
+
484
+ .Card--ctaVariant-arrow:not(.Card--disableAnimation):hover {
485
+ transform: none;
486
+ }
487
+
488
+ .Card--ctaVariant-arrow .Card__action {
489
+ min-inline-size: 0;
490
+ justify-self: start;
491
+ }
492
+
493
+ .Card--align-center .Card--ctaVariant-arrow .Card__action {
494
+ justify-self: center;
495
+ }
496
+
497
+ .Card--ctaVariant-arrow:is(:hover, :focus-within) .Card__action--arrowOnly {
498
+ -moz-column-gap: var(--base-size-8);
499
+ column-gap: var(--base-size-8);
500
+ padding-inline-start: var(--base-size-12);
501
+ padding-inline-end: var(--base-size-4);
502
+ border-color: var(--brand-color-border-default);
503
+ background-color: var(--brand-Card-background-overlay);
504
+ }
505
+
506
+ .Card--ctaVariant-arrow:is(:hover, :focus-within) .Card__actionLabelClip {
507
+ max-inline-size: 100%;
508
+ opacity: 1;
509
+ transform: translateX(0);
510
+ margin-inline-start: calc(var(--base-size-12) * -1);
511
+ margin-inline-end: 0;
512
+ padding-inline-start: var(--base-size-12);
513
+ padding-inline-end: var(--base-size-4);
514
+ }
515
+
516
+ .Card:is(:hover, :focus-within) .Card--expandableArrow {
517
+ transform: translateX(var(--base-size-2));
283
518
  }
284
519
 
285
- .Card:has(.Card__link:hover) .Card--expandableArrow path:nth-of-type(2) {
520
+ .Card:is(:hover, :focus-within) .Card--expandableArrow path:nth-of-type(2) {
286
521
  stroke-dashoffset: 20;
287
522
  }
288
523
 
@@ -1,5 +1,8 @@
1
1
  .ExpandableArrow {
2
- transition: transform 200ms;
2
+ --ExpandableArrow-duration: 200ms;
3
+ --ExpandableArrow-easing: ease;
4
+
5
+ transition: transform var(--ExpandableArrow-duration) var(--ExpandableArrow-easing);
3
6
  transform: translateX(0);
4
7
  }
5
8
 
@@ -10,7 +13,7 @@
10
13
  .ExpandableArrow-stem {
11
14
  stroke-dasharray: 10;
12
15
  stroke-dashoffset: 10;
13
- transition: stroke-dashoffset 200ms;
16
+ transition: stroke-dashoffset var(--ExpandableArrow-duration) var(--ExpandableArrow-easing);
14
17
  }
15
18
 
16
19
  .ExpandableArrow-stem--expanded {
@@ -2,3 +2,7 @@
2
2
  text-transform: uppercase;
3
3
  letter-spacing: var(--brand-text-letterSpacing-100);
4
4
  }
5
+
6
+ .EyebrowText--variant-accent {
7
+ color: var(--brand-color-accent-primary);
8
+ }
@@ -44,7 +44,7 @@
44
44
 
45
45
  .Icon--background {
46
46
  padding: var(--base-size-12);
47
- border-radius: var(--brand-borderRadius-full);
47
+ border-radius: var(--brand-borderRadius-medium);
48
48
  }
49
49
 
50
50
  .Icon--color-default {
@@ -78,6 +78,7 @@
78
78
  }
79
79
 
80
80
  .Link--label {
81
+ color: inherit !important; /* Some components like Accordion override all children color. We need to force this. */
81
82
  font-weight: var(--base-text-weight-medium);
82
83
  }
83
84
 
@@ -127,7 +127,7 @@
127
127
  align-items: center;
128
128
  gap: var(--base-size-24);
129
129
  margin: auto;
130
- max-width: 100dvw;
130
+ max-width: 100vw;
131
131
  }
132
132
 
133
133
  .LogoSuite__logobar-marqueeGroup {