@primer/brand-css 0.67.0-rc.f47a3983 → 0.68.0-rc.01cf5f7c

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.
@@ -19,21 +19,6 @@
19
19
  );
20
20
  }
21
21
 
22
- /* Heading size overrides for balanced and minimal variants */
23
- .CTABanner--variant-balanced .CTABanner-heading {
24
- font-weight: var(--brand-heading-weight-700);
25
- font-size: var(--brand-text-size-700);
26
- line-height: var(--brand-heading-lineHeight-700);
27
- letter-spacing: var(--brand-heading-letterSpacing-700);
28
- }
29
-
30
- .CTABanner--variant-minimal .CTABanner-heading {
31
- font-weight: var(--brand-heading-weight-400);
32
- font-size: var(--brand-text-size-400);
33
- line-height: var(--brand-text-lineHeight-400);
34
- letter-spacing: var(--brand-heading-letterSpacing-400);
35
- }
36
-
37
22
  .CTABanner-grid {
38
23
  row-gap: 0;
39
24
  --brand-Grid-spacing-row: 0;
@@ -189,7 +174,7 @@
189
174
  gap: var(--base-size-24);
190
175
  }
191
176
  .CTABanner--variant-balanced .CTABanner-content {
192
- gap: var(--base-size-16);
177
+ gap: var(--base-size-32);
193
178
  }
194
179
  .CTABanner-container {
195
180
  padding: var(--base-size-96) var(--base-size-64);
@@ -230,6 +215,64 @@
230
215
  height: auto;
231
216
  }
232
217
 
218
+ @media screen and (min-width: 63.25rem) {
219
+ .CTABanner--variant-balanced .CTABanner-image {
220
+ max-width: 100%;
221
+ height: auto;
222
+ }
223
+
224
+ .CTABanner--variant-balanced .CTABanner-grid-column--primary:has(.CTABanner-logo) {
225
+ align-items: stretch;
226
+ }
227
+
228
+ .CTABanner--variant-balanced .CTABanner-grid-column--primary:has(.CTABanner-logo) > .CTABanner-content {
229
+ flex: 1;
230
+ }
231
+
232
+ .CTABanner--variant-balanced .CTABanner-content:has(> .CTABanner-logo) > .CTABanner-logo + * {
233
+ margin-block-start: auto;
234
+ }
235
+ }
236
+
237
+ .CTABanner-logo {
238
+ display: flex;
239
+ align-items: center;
240
+ gap: var(--base-size-8);
241
+ width: 100%;
242
+ padding-block-end: var(--base-size-32);
243
+ border-block-end: var(--brand-borderWidth-thin) solid var(--brand-color-border-muted);
244
+ }
245
+
246
+ .CTABanner-logo > svg,
247
+ .CTABanner-logo > img {
248
+ height: var(--base-size-40);
249
+ width: auto;
250
+ display: block;
251
+ }
252
+
253
+ .CTABanner--variant-default .CTABanner-logo {
254
+ width: auto;
255
+ padding-block-end: 0;
256
+ border-block-end: none;
257
+ }
258
+
259
+ .CTABanner--variant-minimal .CTABanner-logo {
260
+ margin-block-end: var(--base-size-24);
261
+ }
262
+
263
+ .CTABanner-link {
264
+ align-self: auto;
265
+ }
266
+
267
+ /*
268
+ * We use a custom token here because text-emphasized doesn't reach 4.5 contrast
269
+ * against the default banner bgColor in light mode.
270
+ */
271
+ .CTABanner-heading b {
272
+ color: var(--brand-CTABanner-color-heading-emphasis);
273
+ font-weight: inherit;
274
+ }
275
+
233
276
  .CTABanner-heading code,
234
277
  .CTABanner-description code {
235
278
  font-size: inherit;
@@ -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,162 @@
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;
307
+ inline-size: -moz-fit-content;
308
+ inline-size: fit-content;
309
+ max-inline-size: 100%;
209
310
  }
210
311
 
211
312
  .Card__heading {
212
- margin-bottom: var(--base-size-20);
313
+ margin-block-end: var(--base-size-20);
213
314
  grid-area: heading;
214
315
  }
215
316
 
216
317
  .Card__description {
217
- margin-bottom: var(--base-size-32);
318
+ margin-block-end: var(--base-size-32);
218
319
  grid-area: description;
219
320
  }
220
321
 
221
322
  .Card__action {
222
323
  grid-area: action;
223
- margin-top: auto;
324
+ margin-block-start: auto;
224
325
  display: inline-flex;
225
326
  align-items: center;
327
+ max-inline-size: 100%;
328
+ pointer-events: none;
329
+ }
330
+
331
+ .Card__actionIcon {
332
+ display: inline-flex;
333
+ align-items: center;
334
+ justify-content: center;
335
+ flex-shrink: 0;
336
+ }
337
+
338
+ .Card__actionLabel {
339
+ display: block;
340
+ min-inline-size: 0;
341
+ overflow: hidden;
342
+ text-overflow: ellipsis;
343
+ white-space: nowrap;
344
+ }
345
+
346
+ .Card:not(.Card--ctaVariant-arrow) .Card__action {
347
+ inline-size: 100%;
348
+ min-inline-size: 0;
349
+ }
350
+
351
+ .Card:not(.Card--ctaVariant-arrow) .Card__action > span:first-child {
352
+ min-inline-size: 0;
353
+ }
354
+
355
+ .Card:not(.Card--ctaVariant-arrow) .Card__actionLabel {
356
+ overflow: visible;
357
+ text-overflow: clip;
358
+ white-space: normal;
359
+ overflow-wrap: anywhere;
360
+ }
361
+
362
+ .Card--align-center:not(.Card--ctaVariant-arrow) .Card__actionLabel {
363
+ text-align: center;
364
+ }
365
+
366
+ .Card__actionLabelClip {
367
+ --actionLabelClip-duration: 400ms;
368
+ display: inline-flex;
369
+ flex: 1 1 auto;
370
+ align-items: center;
371
+ align-self: stretch;
372
+ min-inline-size: 0;
373
+ overflow: hidden;
374
+ max-inline-size: 0;
375
+ background-color: transparent;
376
+ opacity: 0;
377
+ transform: translateX(calc(var(--base-size-12) * -1));
378
+ transition: max-inline-size var(--actionLabelClip-duration) var(--brand-Card-animation-easing),
379
+ opacity var(--actionLabelClip-duration) ease-out, transform var(--actionLabelClip-duration) ease-out,
380
+ margin-inline var(--actionLabelClip-duration) ease-out, padding-inline var(--actionLabelClip-duration) ease-out;
381
+ }
382
+
383
+ .Card--tokensPosition-block-end .Card__action {
384
+ margin-block-start: var(--base-size-20);
385
+ }
386
+
387
+ .Card__action--arrowOnly {
388
+ --actionArrow-duration: 300ms;
389
+
390
+ margin-block-start: var(--base-size-20);
391
+ min-height: var(--base-size-40);
392
+ width: -moz-fit-content;
393
+ width: fit-content;
394
+ min-inline-size: 0;
395
+ max-inline-size: calc(100% - var(--Card-arrowAction-endInset));
396
+ justify-content: flex-start;
397
+ -moz-column-gap: 0;
398
+ column-gap: 0;
399
+ padding-block: var(--base-size-4);
400
+ padding-inline: 0;
401
+ border: var(--brand-borderWidth-thin) solid transparent;
402
+ border-radius: var(--brand-borderRadius-full);
403
+ background-color: transparent;
404
+ flex-shrink: 0;
405
+ overflow: hidden;
406
+ transition: border-color var(--actionArrow-duration) ease-out, background-color var(--actionArrow-duration) ease-out,
407
+ column-gap var(--actionArrow-duration) ease-out, padding-inline var(--actionArrow-duration) ease-out;
408
+ transition: border-color var(--actionArrow-duration) ease-out, background-color var(--actionArrow-duration) ease-out,
409
+ column-gap var(--actionArrow-duration) ease-out, padding-inline var(--actionArrow-duration) ease-out, -moz-column-gap var(--actionArrow-duration) ease-out;
410
+ }
411
+
412
+ .Card__actionIcon--arrowOnly {
413
+ width: var(--base-size-32);
414
+ min-width: var(--base-size-32);
415
+ height: var(--base-size-32);
416
+ min-height: var(--base-size-32);
417
+ border: var(--brand-borderWidth-thin) solid var(--brand-color-border-default);
418
+ border-radius: var(--brand-borderRadius-full);
419
+ background-color: var(--brand-color-canvas-default);
226
420
  }
227
421
 
228
422
  .Card--align-center .Card__action {
@@ -234,10 +428,9 @@
234
428
  color: var(--brand-Link-color-accent);
235
429
  }
236
430
 
237
- .Card--skew {
238
- height: 100%;
239
- border-radius: var(--brand-borderRadius-xlarge);
240
- overflow: hidden;
431
+ .Card__action,
432
+ .Card__action * {
433
+ cursor: inherit;
241
434
  }
242
435
 
243
436
  .Card--skew:focus-within {
@@ -249,7 +442,7 @@
249
442
  }
250
443
 
251
444
  .Card__skew-bounding {
252
- border-radius: var(--brand-borderRadius-xlarge);
445
+ border-radius: var(--brand-borderRadius-medium);
253
446
  position: relative;
254
447
  overflow: hidden;
255
448
  z-index: 1;
@@ -278,11 +471,56 @@
278
471
  margin-inline-start: var(--base-size-4);
279
472
  }
280
473
 
281
- .Card:has(.Card__link:hover) .Card--expandableArrow {
282
- transform: translateX(var(--base-size-4));
474
+ .Card--ctaVariant-arrow .Card--expandableArrow {
475
+ --ExpandableArrow-duration: var(--brand-Card-animation-duration);
476
+ --ExpandableArrow-easing: var(--brand-Card-animation-easing);
477
+ }
478
+
479
+ .Card__actionIcon--arrowOnly .Card--expandableArrow {
480
+ margin-inline-start: 0;
481
+ }
482
+
483
+ .Card--ctaVariant-arrow .Card__description {
484
+ margin-bottom: var(--base-size-12);
485
+ }
486
+
487
+ .Card--ctaVariant-arrow:not(.Card--disableAnimation):hover {
488
+ transform: none;
489
+ }
490
+
491
+ .Card--ctaVariant-arrow .Card__action {
492
+ min-inline-size: 0;
493
+ justify-self: start;
494
+ }
495
+
496
+ .Card--align-center .Card--ctaVariant-arrow .Card__action {
497
+ justify-self: center;
498
+ }
499
+
500
+ .Card--ctaVariant-arrow:is(:hover, :focus-within) .Card__action--arrowOnly {
501
+ -moz-column-gap: var(--base-size-8);
502
+ column-gap: var(--base-size-8);
503
+ padding-inline-start: var(--base-size-12);
504
+ padding-inline-end: var(--base-size-4);
505
+ border-color: var(--brand-color-border-default);
506
+ background-color: var(--brand-Card-background-overlay);
507
+ }
508
+
509
+ .Card--ctaVariant-arrow:is(:hover, :focus-within) .Card__actionLabelClip {
510
+ max-inline-size: 100%;
511
+ opacity: 1;
512
+ transform: translateX(0);
513
+ margin-inline-start: calc(var(--base-size-12) * -1);
514
+ margin-inline-end: 0;
515
+ padding-inline-start: var(--base-size-12);
516
+ padding-inline-end: var(--base-size-4);
517
+ }
518
+
519
+ .Card:is(:hover, :focus-within) .Card--expandableArrow {
520
+ transform: translateX(var(--base-size-2));
283
521
  }
284
522
 
285
- .Card:has(.Card__link:hover) .Card--expandableArrow path:nth-of-type(2) {
523
+ .Card:is(:hover, :focus-within) .Card--expandableArrow path:nth-of-type(2) {
286
524
  stroke-dashoffset: 20;
287
525
  }
288
526
 
@@ -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 {