@primer/css 0.0.0-20219633235 → 0.0.0-2021986475

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.
@@ -18,43 +18,32 @@
18
18
 
19
19
  // Background
20
20
 
21
- .color-bg-default { background-color: var(--color-canvas-default) !important; }
22
- .color-bg-overlay { background-color: var(--color-canvas-overlay) !important; }
23
- .color-bg-inset { background-color: var(--color-canvas-inset) !important; }
24
- .color-bg-subtle { background-color: var(--color-canvas-subtle) !important; }
25
-
26
- .color-bg-neutral-emphasis-plus { background-color: var(--color-neutral-emphasis-plus) !important; }
27
- .color-bg-neutral-emphasis { background-color: var(--color-neutral-emphasis) !important; }
28
- .color-bg-neutral-muted { background-color: var(--color-neutral-muted) !important; }
29
- .color-bg-neutral-subtle { background-color: var(--color-neutral-subtle) !important; }
21
+ .color-bg-default { background-color: var(--color-canvas-default) !important; }
22
+ .color-bg-overlay { background-color: var(--color-canvas-overlay) !important; }
23
+ .color-bg-inset { background-color: var(--color-canvas-inset) !important; }
24
+ .color-bg-subtle { background-color: var(--color-canvas-subtle) !important; }
25
+ .color-bg-emphasis { background-color: var(--color-neutral-emphasis-plus) !important; }
30
26
 
27
+ .color-bg-accent { background-color: var(--color-accent-subtle) !important; }
31
28
  .color-bg-accent-emphasis { background-color: var(--color-accent-emphasis) !important; }
32
- .color-bg-accent-muted { background-color: var(--color-accent-muted) !important; }
33
- .color-bg-accent-subtle { background-color: var(--color-accent-subtle) !important; }
34
29
 
30
+ .color-bg-success { background-color: var(--color-success-subtle) !important; }
35
31
  .color-bg-success-emphasis { background-color: var(--color-success-emphasis) !important; }
36
- .color-bg-success-muted { background-color: var(--color-success-muted) !important; }
37
- .color-bg-success-subtle { background-color: var(--color-success-subtle) !important; }
38
32
 
33
+ .color-bg-attention { background-color: var(--color-attention-subtle) !important; }
39
34
  .color-bg-attention-emphasis { background-color: var(--color-attention-emphasis) !important; }
40
- .color-bg-attention-muted { background-color: var(--color-attention-muted) !important; }
41
- .color-bg-attention-subtle { background-color: var(--color-attention-subtle) !important; }
42
35
 
36
+ .color-bg-severe { background-color: var(--color-severe-subtle) !important; }
43
37
  .color-bg-severe-emphasis { background-color: var(--color-severe-emphasis) !important; }
44
- .color-bg-severe-muted { background-color: var(--color-severe-muted) !important; }
45
- .color-bg-severe-subtle { background-color: var(--color-severe-subtle) !important; }
46
38
 
39
+ .color-bg-danger { background-color: var(--color-danger-subtle) !important; }
47
40
  .color-bg-danger-emphasis { background-color: var(--color-danger-emphasis) !important; }
48
- .color-bg-danger-muted { background-color: var(--color-danger-muted) !important; }
49
- .color-bg-danger-subtle { background-color: var(--color-danger-subtle) !important; }
50
41
 
42
+ .color-bg-done { background-color: var(--color-done-subtle) !important; }
51
43
  .color-bg-done-emphasis { background-color: var(--color-done-emphasis) !important; }
52
- .color-bg-done-muted { background-color: var(--color-done-muted) !important; }
53
- .color-bg-done-subtle { background-color: var(--color-done-subtle) !important; }
54
44
 
45
+ .color-bg-sponsors { background-color: var(--color-sponsors-subtle) !important; }
55
46
  .color-bg-sponsors-emphasis { background-color: var(--color-sponsors-emphasis) !important; }
56
- .color-bg-sponsors-muted { background-color: var(--color-sponsors-muted) !important; }
57
- .color-bg-sponsors-subtle { background-color: var(--color-sponsors-subtle) !important; }
58
47
 
59
48
  // Border
60
49
 
@@ -62,13 +51,26 @@
62
51
  .color-border-muted { border-color: var(--color-border-muted) !important; }
63
52
  .color-border-subtle { border-color: var(--color-border-subtle) !important; }
64
53
 
65
- .color-border-accent { border-color: var(--color-accent-emphasis) !important; }
66
- .color-border-success { border-color: var(--color-success-emphasis) !important; }
67
- .color-border-attention { border-color: var(--color-attention-emphasis) !important; }
68
- .color-border-severe { border-color: var(--color-severe-emphasis) !important; }
69
- .color-border-danger { border-color: var(--color-danger-emphasis) !important; }
70
- .color-border-done { border-color: var(--color-done-emphasis) !important; }
71
- .color-border-sponsors { border-color: var(--color-sponsors-emphasis) !important; }
54
+ .color-border-accent { border-color: var(--color-accent-muted) !important; }
55
+ .color-border-accent-emphasis { border-color: var(--color-accent-emphasis) !important; }
56
+
57
+ .color-border-success { border-color: var(--color-success-muted) !important; }
58
+ .color-border-success-emphasis { border-color: var(--color-success-emphasis) !important; }
59
+
60
+ .color-border-attention { border-color: var(--color-attention-muted) !important; }
61
+ .color-border-attention-emphasis { border-color: var(--color-attention-emphasis) !important; }
62
+
63
+ .color-border-severe { border-color: var(--color-severe-muted) !important; }
64
+ .color-border-severe-emphasis { border-color: var(--color-severe-emphasis) !important; }
65
+
66
+ .color-border-danger { border-color: var(--color-danger-muted) !important; }
67
+ .color-border-danger-emphasis { border-color: var(--color-danger-emphasis) !important; }
68
+
69
+ .color-border-done { border-color: var(--color-done-muted) !important; }
70
+ .color-border-done-emphasis { border-color: var(--color-done-emphasis) !important; }
71
+
72
+ .color-border-sponsors { border-color: var(--color-sponsors-muted) !important; }
73
+ .color-border-sponsors-emphasis { border-color: var(--color-sponsors-emphasis) !important; }
72
74
 
73
75
  // Misc
74
76
 
@@ -1,553 +0,0 @@
1
- // Most of this file should be provided by primer/src/support already
2
-
3
- $actionList-item-hover-bg: #f0f3f5;
4
- $actionList-item-active-bg: #e8ebed;
5
- $actionList-item-selected-bg: #f0f3f5;
6
- $actionList-item-focus-bg: #e0e4e7;
7
- $actionList-item-divider: #e9e9ed;
8
-
9
- $actionList-item-danger-hover-bg: #fff0f2;
10
- $actionList-item-danger-active-bg: #ffebed;
11
- $actionList-item-danger-focus-bg: #ffdbe0;
12
-
13
- // expanded from src/support/variables/misc.scss
14
-
15
- $border-radius-1: 4px !default;
16
- $border-radius-2: 6px !default;
17
- $border-radius-3: 8px !default;
18
- $border-radius-4: 12px !default;
19
-
20
- $box-shadow-medium: 0 3px 6px rgba(#000, 0.12) !default;
21
- $box-shadow-large: 0 6px 18px rgba(#000, 0.16) !default;
22
- $box-shadow-extra-large: 0 12px 48px rgba(#000, 0.2) !default;
23
-
24
- $overlay-shadow-popover: 0px 1px 3px rgba(0, 0, 0, 0.12), 0px 8px 24px rgba(149, 157, 165, 0.2);
25
-
26
- // expanded from src/support/variables/layout.scss
27
- // adds 12px to the scale as of https://github.com/github/design-systems/issues/992
28
- //
29
- // https://github.com/github/design-systems/issues/1272
30
-
31
- $s-0: 0;
32
- $s-4: 4px;
33
- $s-8: 8px;
34
- $s-12: 12px;
35
- $s-16: 16px;
36
- $s-20: 20px;
37
- $s-24: 24px;
38
- $s-28: 28px;
39
- $s-32: 32px;
40
- $s-40: 40px;
41
- $s-48: 48px;
42
-
43
- // pulled from src/support/variables/color-system.scss
44
-
45
- // -------- Grays --------
46
- $gray-000: #fafbfc !default;
47
- $gray-100: #f6f8fa !default;
48
- $gray-200: #e1e4e8 !default;
49
- $gray-300: #d1d5da !default;
50
- $gray-400: #959da5 !default;
51
- $gray-500: #6a737d !default;
52
- $gray-600: #586069 !default;
53
- $gray-700: #444d56 !default;
54
- $gray-800: #2f363d !default;
55
- $gray-900: #24292e !default; // body font color
56
-
57
- // -------- Accent -------
58
- $blue-500: #0366d6;
59
-
60
- // Typographic colors, from some color mode file
61
-
62
- $text-primary: $gray-900;
63
- $text-secondary: $gray-500;
64
- $text-danger: #cb2431;
65
-
66
- // CSS Easing
67
-
68
- $ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
69
- $ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
70
- $ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
71
-
72
- .actionList {
73
- padding: $s-8;
74
- list-style: none;
75
-
76
- ul,
77
- li {
78
- list-style: none;
79
- }
80
- }
81
-
82
- .actionList-item {
83
- // :before pseudo-element is used for the inline divider
84
- // :after pseudo-element is used for selected accent line on the left
85
-
86
- // single select
87
-
88
- // maintain space on grid while check is hidden
89
- .actionList-item-content-singleSelect {
90
- .actionList-item-check {
91
- visibility: hidden;
92
- }
93
- }
94
-
95
- &[aria-checked='true'] {
96
- .actionList-item-content-singleSelect {
97
- .actionList-item-check {
98
- visibility: visible;
99
- }
100
- }
101
- }
102
-
103
- position: relative;
104
-
105
- // katie edit
106
- // we could also use [aria-current] selector, and/or just conditionally add this class
107
- &.actionList-item--active {
108
- &:before,
109
- + .actionList-item:before {
110
- visibility: hidden;
111
- }
112
-
113
- .actionList-item-content {
114
- background: $actionList-item-selected-bg;
115
-
116
- @media (hover: hover) and (pointer: fine) {
117
- &:hover {
118
- background: $actionList-item-active-bg;
119
- }
120
- }
121
- }
122
-
123
- // Blue accent for selected item.
124
-
125
- &:after {
126
- content: '';
127
- width: $s-4;
128
- height: $s-24;
129
- border-radius: 4px;
130
- position: absolute;
131
- left: -8px;
132
- top: calc(50% - (24px / 2));
133
- background: var(--color-accent-fg);
134
- }
135
- }
136
-
137
- // Hides sibling's divider if item is :hover or :active
138
-
139
- &:hover:before,
140
- &:hover + .actionList-item:before {
141
- visibility: hidden;
142
- }
143
-
144
- &:active:before,
145
- &:active + .actionList-item:before {
146
- visibility: hidden;
147
- }
148
- }
149
-
150
- .actionList-item-content {
151
- display: grid;
152
- // 32px total height considering 20px line-height
153
- // allow height to expand
154
- padding: (($s-32 - $s-20) / 2) $s-8;
155
- grid-template-rows: minmax(20px, max-content);
156
- // default one column
157
- grid-template-columns: minmax(min-content, 100%);
158
- column-gap: $s-8;
159
- align-items: center;
160
- position: relative;
161
- border-radius: $border-radius-2;
162
- font-weight: normal;
163
- color: inherit;
164
- text-decoration: none;
165
- border: none;
166
- background: none;
167
- // text-align: start;
168
- margin: 0;
169
- // width: 100%;
170
-
171
- // helper for grid alignment with multi-line content
172
- .actionList-item-visual {
173
- min-height: 20px;
174
- display: flex;
175
- align-items: center;
176
- fill: var(--color-fg-muted);
177
- }
178
-
179
- // do we want this?
180
- user-select: none;
181
-
182
- // since we're already using an :active bg
183
- -webkit-tap-highlight-color: transparent;
184
-
185
- // 2 frames on a 60hz monitor
186
- transition: background 33.333ms linear;
187
-
188
- // reset grid for children
189
-
190
- // has leading visual
191
- &.actionList-item--leadingVisual {
192
- grid-template-columns: min-content minmax(min-content, auto);
193
- }
194
-
195
- // has trailing visual
196
- &.actionList-item--trailingVisual {
197
- grid-template-columns: minmax(min-content, auto) min-content;
198
- }
199
-
200
- // has leading + trailing visuals
201
- &.actionList-item--leadingVisual.actionList-item--trailingVisual {
202
- grid-template-columns: min-content minmax(min-content, auto) min-content;
203
- }
204
-
205
- &.actionList-item-content-singleSelect {
206
- grid-template-columns: min-content minmax(min-content, auto);
207
-
208
- &.actionList-item--leadingVisual {
209
- grid-template-columns: min-content min-content minmax(min-content, auto);
210
- }
211
-
212
- &.actionList-item--trailingVisual {
213
- grid-template-columns: min-content minmax(min-content, auto) min-content;
214
- }
215
-
216
- &.actionList-item--leadingVisual.actionList-item--trailingVisual {
217
- grid-template-columns: min-content min-content minmax(min-content, auto) min-content;
218
- }
219
- }
220
-
221
- &.actionList-item-content-multiSelect {
222
- grid-template-columns: min-content minmax(min-content, auto);
223
-
224
- &.actionList-item--leadingVisual {
225
- grid-template-columns: min-content min-content minmax(min-content, auto);
226
- }
227
-
228
- &.actionList-item--trailingVisual {
229
- grid-template-columns: min-content minmax(min-content, auto) min-content;
230
- }
231
-
232
- &.actionList-item--leadingVisual.actionList-item--trailingVisual {
233
- grid-template-columns: min-content min-content minmax(min-content, auto) min-content;
234
- }
235
- }
236
-
237
- // handle font color and size here
238
- .actionList-item-label {
239
- font-weight: normal;
240
- color: inherit;
241
- }
242
-
243
- .actionList-item-label-primary {
244
- font-weight: bold;
245
- }
246
-
247
- .actionList-item-label--blockDescription {
248
- display: flex;
249
- flex-direction: column;
250
-
251
- .actionList-item-label-description {
252
- margin-top: $s-4;
253
- }
254
- }
255
-
256
- .actionList-item-label--inlineDescription {
257
- display: flex;
258
- flex-direction: row;
259
- align-items: baseline;
260
-
261
- .actionList-item-label-description {
262
- margin-left: $s-8;
263
- }
264
- }
265
-
266
- .actionList-item-label-description {
267
- font-size: 12px;
268
- line-height: 18px;
269
- color: var(--color-fg-muted);
270
- }
271
-
272
- &:hover {
273
- text-decoration: none;
274
- }
275
-
276
- &:focus-visible {
277
- outline: none;
278
- box-shadow: 0 0 0 2px var(--color-accent-fg); // var(--color-btn-focus-shadow)
279
- position: relative;
280
- z-index: 1;
281
- }
282
-
283
- @media (hover: hover) and (pointer: fine) {
284
- &:hover {
285
- background: $actionList-item-hover-bg;
286
- cursor: pointer;
287
- }
288
- }
289
-
290
- &:active {
291
- background: $actionList-item-active-bg;
292
-
293
- @media screen and (prefers-reduced-motion: no-preference) {
294
- animation: actionList-item-active-bg 4s forwards $ease-out-cubic;
295
- }
296
-
297
- @keyframes actionList-item-active-bg {
298
- 0% {
299
- }
300
- 50% {
301
- transform: scale(1);
302
- box-shadow: inset 0 0 0 rgba(#000, 0.04);
303
- }
304
- 100% {
305
- transform: scale(0.97);
306
- box-shadow: inset 0 3px 9px rgba(#000, 0.04);
307
- }
308
- }
309
- }
310
- }
311
-
312
- // size (default: small)
313
- // small | medium | large
314
-
315
- // Medium-sized items
316
- .actionList-item--sizeMedium {
317
- // 40px total height considering 20px line-height
318
- grid-template-rows: minmax(28px, max-content);
319
- }
320
-
321
- // Large-sized items
322
- .actionList-item--sizeLarge {
323
- // 48px total height considering 20px line-height
324
- grid-template-rows: minmax(36px, max-content);
325
- }
326
-
327
- // On pointer:coarse (mobile), all list items are large
328
- @media (pointer: coarse) {
329
- .actionList-item {
330
- // 48px total height considering 20px line-height
331
- grid-template-rows: minmax(36px, max-content);
332
- }
333
- }
334
-
335
- .actionList-item-content-blockDescription {
336
- // if leading/trailing visual, align with first line of content
337
- .actionList-item-visual {
338
- place-self: start;
339
- }
340
- }
341
-
342
- // Danger listItem
343
-
344
- // TODO: conflict with selected state
345
- .actionList-item--danger {
346
- .actionList-item-content {
347
- color: var(--color-danger-fg);
348
-
349
- @media (hover: hover) and (pointer: fine) {
350
- &:hover {
351
- background: $actionList-item-danger-hover-bg;
352
- }
353
- }
354
-
355
- &:active {
356
- background: $actionList-item-danger-active-bg;
357
- }
358
- }
359
- }
360
-
361
- // listItem elements
362
- // TODO: safegaurd against incorrect SVG sizes
363
- // .actionList-item-leadingVisual,
364
- // .actionList-item-leadingVisual-16,
365
- // .actionList-item-leadingVisual-20 {
366
- // width: $s-16;
367
- // height: $s-20;
368
- // display: flex;
369
- // flex-direction: column;
370
- // justify-content: center;
371
-
372
- // svg {
373
- // fill: $text-secondary;
374
- // }
375
- // }
376
-
377
- // .actionList-item-leadingVisual-20 {
378
- // width: $s-20;
379
- // }
380
-
381
- .actionList-item-inlineDescription {
382
- align-self: baseline;
383
- // text-small
384
- font-size: 12px;
385
- line-height: 18px;
386
- color: var(--color-fg-muted);
387
- }
388
-
389
- // TODO: should label always be bold above a block description?
390
- .actionList-item-blockDescription {
391
- display: block;
392
- // text-small
393
- font-size: 12px;
394
- line-height: 18px;
395
- color: var(--color-fg-muted);
396
- margin-top: $s-4;
397
- }
398
-
399
- // child of .actionList-item-label, placed above everything
400
- // .actionList-item-trailingText {
401
- // margin-left: $s-16;
402
- // float: right;
403
- // color: var(--color-fg-muted);
404
- // }
405
-
406
- // sibling of .actionList-item-label
407
- // .actionList-item-trailingVisual {
408
- // height: $s-20;
409
- // display: flex;
410
- // flex-direction: column;
411
- // justify-content: center;
412
-
413
- // svg {
414
- // fill: var(--color-fg-muted);
415
- // }
416
- // }
417
-
418
- // Single-selection & Multi selection
419
- // TODO: can this be simplified?
420
- .actionList--single-selection .actionList-item > .actionList-item-content,
421
- .actionList--multi-selection .actionList-item > .actionList-item-content,
422
- .actionList-item--single-selection > .actionList-item-content,
423
- .actionList-item--multi-selection > .actionList-item-content {
424
- padding-left: ($s-16 + $s-16);
425
- }
426
-
427
- // .actionList-item .actionList-item-check {
428
- // width: $s-16;
429
- // height: $s-20;
430
- // display: flex;
431
- // flex-direction: column;
432
- // justify-content: center;
433
- // margin-left: ($s-24 * -1);
434
- // align-items: center;
435
-
436
- // svg {
437
- // fill: var(--color-fg-muted);
438
- // }
439
- // input {
440
- // cursor: pointer;
441
- // }
442
- // }
443
-
444
- // Dividers
445
-
446
- .actionList--divided .actionList-item:before,
447
- .actionList-item--divided:before {
448
- content: '';
449
- display: block;
450
- position: absolute;
451
- width: calc(100% - #{$s-16});
452
- height: 1px;
453
- background: $actionList-item-divider;
454
- top: 0;
455
- left: $s-8;
456
- }
457
-
458
- .actionList-item:first-child:before,
459
- .actionList-sectionDivider + .actionList-item:before,
460
- .actionList-sectionHeader + .actionList-item:before {
461
- visibility: hidden;
462
- }
463
-
464
- .actionList--divided-indent-16 .actionList-item:before,
465
- .actionList-item--divided-indent-16:before {
466
- left: $s-16 + $s-16;
467
- width: calc(100% - 40px) !important;
468
- }
469
-
470
- .actionList--divided-indent-20 .actionList-item:before,
471
- .actionList-item--divided-indent-20:before {
472
- left: $s-20 + $s-16;
473
- width: calc(100% - 44px) !important;
474
- }
475
-
476
- .actionList--divided-indent-24 .actionList-item:before,
477
- .actionList-item--divided-indent-24:before {
478
- left: $s-24 + $s-16;
479
- width: calc(100% - 48px) !important;
480
- }
481
-
482
- .actionList--divided-indent-32 .actionList-item:before,
483
- .actionList-item--divided-indent-32:before {
484
- left: $s-32 + $s-16;
485
- width: calc(100% - 56px) !important;
486
- }
487
-
488
- .actionList--single-selection.actionList--divided .actionList-item:before,
489
- .actionList--multi-selection.actionList--divided .actionList-item:before,
490
- .actionList-item--single-selection.actionList-item--divided:before,
491
- .actionList-item--multi-selection.actionList-item--divided:before {
492
- left: $s-16 + $s-16;
493
- width: calc(100% - 40px) !important;
494
- }
495
-
496
- .actionList--single-selection.actionList--divided-indent-20 .actionList-item:before,
497
- .actionList--multi-selection.actionList--divided-indent-20 .actionList-item:before,
498
- .actionList--single-selection .actionList-item--divided-indent-20:before,
499
- .actionList--multi-selection .actionList-item--divided-indent-20:before {
500
- left: $s-20 + $s-16;
501
- width: calc(100% - 44px) !important;
502
- }
503
-
504
- // Section divider
505
-
506
- .actionList-sectionDivider {
507
- height: 1px;
508
- background: $actionList-item-divider;
509
- border: 0;
510
- margin: ($s-8 - 1px) ($s-8 * -1) $s-8;
511
- padding: 0;
512
- }
513
-
514
- .actionList-sectionDivider--filled {
515
- height: $s-8;
516
- border-top: 1px solid $gray-200;
517
- border-bottom: 1px solid $gray-200;
518
- background: $gray-100;
519
- box-sizing: border-box;
520
- margin: $s-8 ($s-8 * -1);
521
- }
522
-
523
- // Section header
524
-
525
- .actionList-sectionHeader {
526
- // 32px total height considering 20px line-height
527
- padding: (($s-32 - $s-20) / 2) $s-8;
528
- font-size: 12px; // text-small
529
-
530
- // is this a variable in primer css?
531
- font-weight: 600;
532
-
533
- color: var(--color-fg-muted);
534
- }
535
-
536
- .actionList-sectionHeader--filled {
537
- background: $gray-100;
538
- margin: $s-8 ($s-8 * -1);
539
- border-top: 1px solid $gray-200;
540
- border-bottom: 1px solid $gray-200;
541
-
542
- &:first-child {
543
- margin-top: 0;
544
- }
545
- }
546
-
547
- // Nested content
548
- // Doesn't work with dividers
549
-
550
- .actionList-item-nestedContent {
551
- padding-left: $s-16;
552
- padding-bottom: $s-8;
553
- }