@papillonarts/css 0.6.0 → 0.7.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.
Files changed (133) hide show
  1. package/LICENSE +1 -1
  2. package/build/primer/autocomplete/README.md +20 -0
  3. package/build/primer/autocomplete/index.scss +3 -0
  4. package/build/primer/autocomplete/suggester.scss +101 -0
  5. package/build/primer/avatars/README.md +20 -0
  6. package/build/primer/avatars/avatar-parent-child.scss +17 -0
  7. package/build/primer/avatars/circle-badge.scss +55 -0
  8. package/build/primer/avatars/index.scss +5 -0
  9. package/build/primer/base/README.md +20 -0
  10. package/build/primer/base/base.scss +9 -17
  11. package/build/primer/base/index.scss +1 -0
  12. package/build/primer/base/kbd.scss +8 -10
  13. package/build/primer/{color-modes/native.scss → base/native-colors.scss} +4 -2
  14. package/build/primer/base/normalize.scss +4 -3
  15. package/build/primer/base/typography-base.scss +4 -3
  16. package/build/primer/box/README.md +20 -0
  17. package/build/primer/box/box-overlay.scss +45 -0
  18. package/build/primer/box/index.scss +2 -0
  19. package/build/primer/branch-name/README.md +20 -0
  20. package/build/primer/branch-name/branch-name.scss +33 -0
  21. package/build/primer/branch-name/index.scss +3 -0
  22. package/build/primer/buttons/README.md +20 -0
  23. package/build/primer/buttons/button-group.scss +104 -0
  24. package/build/primer/buttons/button.scss +347 -0
  25. package/build/primer/buttons/index.scss +4 -0
  26. package/build/primer/buttons/misc.scss +244 -0
  27. package/build/primer/color-modes/index.scss +0 -1
  28. package/build/primer/color-modes/themes/dark.scss +1 -6
  29. package/build/primer/color-modes/themes/dark_colorblind.scss +1 -6
  30. package/build/primer/color-modes/themes/dark_dimmed.scss +1 -6
  31. package/build/primer/color-modes/themes/dark_high_contrast.scss +1 -6
  32. package/build/primer/color-modes/themes/dark_tritanopia.scss +1 -6
  33. package/build/primer/color-modes/themes/light.scss +1 -6
  34. package/build/primer/color-modes/themes/light_colorblind.scss +1 -6
  35. package/build/primer/color-modes/themes/light_high_contrast.scss +1 -6
  36. package/build/primer/color-modes/themes/light_tritanopia.scss +1 -6
  37. package/build/primer/core/README.md +20 -0
  38. package/build/primer/core/index.scss +18 -0
  39. package/build/primer/docs.scss +7 -0
  40. package/build/primer/forms/README.md +20 -0
  41. package/build/primer/forms/form-control.scss +286 -0
  42. package/build/primer/forms/form-group.scss +297 -0
  43. package/build/primer/forms/form-select.scss +47 -0
  44. package/build/primer/forms/index.scss +6 -0
  45. package/build/primer/forms/input-group.scss +81 -0
  46. package/build/primer/forms/radio-group.scss +68 -0
  47. package/build/primer/header/README.md +20 -0
  48. package/build/primer/header/header.scss +51 -0
  49. package/build/primer/header/index.scss +2 -0
  50. package/build/primer/index.scss +8 -3
  51. package/build/primer/labels/README.md +20 -0
  52. package/build/primer/labels/index.scss +3 -0
  53. package/build/primer/labels/issue-labels.scss +26 -0
  54. package/build/primer/labels/mixins.scss +44 -0
  55. package/build/primer/layout/README.md +20 -0
  56. package/build/primer/layout/app-frame.scss +156 -0
  57. package/build/primer/layout/container.scss +30 -0
  58. package/build/primer/layout/grid-offset.scss +19 -0
  59. package/build/primer/layout/grid.scss +77 -0
  60. package/build/primer/layout/index.scss +7 -0
  61. package/build/primer/layout/page-layout.scss +417 -0
  62. package/build/primer/layout/stack.scss +220 -0
  63. package/build/primer/loaders/README.md +20 -0
  64. package/build/primer/loaders/index.scss +2 -0
  65. package/build/primer/loaders/loaders.scss +19 -0
  66. package/build/primer/markdown/README.md +20 -0
  67. package/build/primer/markdown/blob-csv.scss +32 -0
  68. package/build/primer/markdown/code.scss +79 -0
  69. package/build/primer/markdown/footnotes.scss +59 -0
  70. package/build/primer/markdown/headings.scss +101 -0
  71. package/build/primer/markdown/images.scss +130 -0
  72. package/build/primer/markdown/index.scss +9 -0
  73. package/build/primer/markdown/lists.scss +101 -0
  74. package/build/primer/markdown/markdown-body.scss +101 -0
  75. package/build/primer/markdown/tables.scss +46 -0
  76. package/build/primer/marketing/README.md +20 -0
  77. package/build/primer/marketing/buttons/button.scss +171 -0
  78. package/build/primer/marketing/buttons/index.scss +3 -0
  79. package/build/primer/marketing/index.scss +8 -0
  80. package/build/primer/marketing/links/index.scss +3 -0
  81. package/build/primer/marketing/links/link.scss +51 -0
  82. package/build/primer/marketing/support/index.scss +2 -0
  83. package/build/primer/marketing/support/variables.scss +140 -0
  84. package/build/primer/marketing/type/index.scss +3 -0
  85. package/build/primer/marketing/type/typography.scss +140 -0
  86. package/build/primer/marketing/utilities/animations.scss +52 -0
  87. package/build/primer/marketing/utilities/borders.scss +4 -0
  88. package/build/primer/marketing/utilities/filters.scss +3 -0
  89. package/build/primer/marketing/utilities/index.scss +6 -0
  90. package/build/primer/marketing/utilities/layout.scss +58 -0
  91. package/build/primer/navigation/README.md +20 -0
  92. package/build/primer/navigation/filter-list.scss +86 -0
  93. package/build/primer/navigation/index.scss +5 -0
  94. package/build/primer/navigation/sidenav.scss +102 -0
  95. package/build/primer/navigation/subnav.scss +154 -0
  96. package/build/primer/pagination/README.md +20 -0
  97. package/build/primer/pagination/index.scss +3 -0
  98. package/build/primer/pagination/pagination.scss +157 -0
  99. package/build/primer/primitives/index.scss +10 -0
  100. package/build/primer/primitives/temp-typography-tokens.scss +22 -0
  101. package/build/primer/product/README.md +20 -0
  102. package/build/primer/product/index.scss +13 -0
  103. package/build/primer/select-menu/README.md +20 -0
  104. package/build/primer/select-menu/index.scss +3 -0
  105. package/build/primer/select-menu/select-menu.scss +486 -0
  106. package/build/primer/support/README.md +20 -0
  107. package/build/primer/support/mixins/color-modes.scss +89 -3
  108. package/build/primer/support/mixins/layout.scss +1 -2
  109. package/build/primer/support/mixins/misc.scss +15 -9
  110. package/build/primer/support/mixins/typography.scss +21 -2
  111. package/build/primer/support/variables/misc.scss +2 -2
  112. package/build/primer/support/variables/typography.scss +2 -2
  113. package/build/primer/table-object/index.scss +1 -0
  114. package/build/primer/table-object/table-object.scss +23 -0
  115. package/build/primer/toasts/README.md +20 -0
  116. package/build/primer/toasts/index.scss +2 -0
  117. package/build/primer/toasts/toasts.scss +129 -0
  118. package/build/primer/tooltips/README.md +20 -0
  119. package/build/primer/tooltips/index.scss +2 -0
  120. package/build/primer/tooltips/tooltips.scss +228 -0
  121. package/build/primer/truncate/truncate.scss +2 -66
  122. package/build/primer/utilities/README.md +20 -0
  123. package/build/primer/utilities/borders.scss +30 -21
  124. package/build/primer/utilities/box-shadow.scss +8 -6
  125. package/build/primer/utilities/colors.scss +59 -60
  126. package/build/primer/utilities/details.scss +2 -2
  127. package/build/primer/utilities/flexbox.scss +2 -2
  128. package/build/primer/utilities/layout.scss +8 -6
  129. package/build/primer/utilities/margin.scss +2 -5
  130. package/build/primer/utilities/padding.scss +8 -10
  131. package/build/primer/utilities/typography.scss +12 -11
  132. package/build/primer/utilities/visibility-display.scss +14 -12
  133. package/package.json +2 -2
@@ -0,0 +1,486 @@
1
+ // stylelint-disable selector-max-type
2
+ // selector-max-type is needed for body:not(.intent-mouse) to target keyboard only styles.
3
+
4
+ $SelectMenu-max-height: 480px !default;
5
+
6
+ // Select Menu
7
+ //
8
+ // A more advanced menu with support for navigation, filtering, and more.
9
+
10
+ .SelectMenu {
11
+ position: fixed;
12
+ top: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: 99;
17
+ display: flex;
18
+ padding: var(--base-size-16);
19
+ pointer-events: none;
20
+ flex-direction: column;
21
+
22
+ @include breakpoint(sm) {
23
+ position: absolute;
24
+ top: auto;
25
+ right: auto;
26
+ bottom: auto;
27
+ left: auto;
28
+ padding: 0;
29
+ }
30
+ }
31
+
32
+ // Backdrop
33
+ //
34
+ // Adds a dark, semi transparent "cover" underneath the modal. Only visible for xs.
35
+
36
+ .SelectMenu::before {
37
+ position: absolute;
38
+ top: 0;
39
+ right: 0;
40
+ bottom: 0;
41
+ left: 0;
42
+ pointer-events: none;
43
+ content: '';
44
+ background-color: var(--overlay-backdrop-bgColor, var(--color-primer-canvas-backdrop));
45
+
46
+ @include breakpoint(sm) {
47
+ display: none;
48
+ }
49
+ }
50
+
51
+ // Modal
52
+ //
53
+ // The main "box" that contains the content
54
+
55
+ .SelectMenu-modal {
56
+ position: relative;
57
+ z-index: 99; // Needs to be higher than .details-overlay's z-index: 80.
58
+ display: flex;
59
+ max-height: 66%;
60
+ margin: auto 0;
61
+ overflow: hidden; // Enables border radius on scrollable child elements
62
+ pointer-events: auto;
63
+ flex-direction: column;
64
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
65
+ // stylelint-disable-next-line primer/borders, primer/colors
66
+ border: $border-width $border-style var(--selectMenu-borderColor, var(--color-select-menu-backdrop-border));
67
+ // stylelint-disable-next-line primer/borders
68
+ border-radius: $border-radius * 2;
69
+ box-shadow: var(--shadow-floating-legacy, var(--color-overlay-shadow));
70
+ animation: SelectMenu-modal-animation 0.12s cubic-bezier(0, 0.1, 0.1, 1) backwards;
71
+
72
+ @keyframes SelectMenu-modal-animation {
73
+ 0% {
74
+ opacity: 0;
75
+ transform: scale(0.9);
76
+ }
77
+ }
78
+
79
+ @keyframes SelectMenu-modal-animation--sm {
80
+ 0% {
81
+ opacity: 0;
82
+ transform: translateY(calc(var(--base-size-16) * -1));
83
+ }
84
+ }
85
+
86
+ @include breakpoint(sm) {
87
+ width: 300px;
88
+ height: auto;
89
+ max-height: $SelectMenu-max-height;
90
+ margin: var(--base-size-8) 0 var(--base-size-16) 0;
91
+ // stylelint-disable-next-line primer/typography
92
+ font-size: $font-size-small;
93
+ border-color: var(--borderColor-default, var(--color-border-default));
94
+ // stylelint-disable-next-line primer/borders
95
+ border-radius: $border-radius;
96
+ box-shadow: var(--shadow-floating-legacy, var(--color-overlay-shadow));
97
+ animation-name: SelectMenu-modal-animation--sm;
98
+ }
99
+ }
100
+
101
+ // Header
102
+ //
103
+ // Used for showing a title and the close button. Close button is only visible for xs.
104
+
105
+ .SelectMenu-header {
106
+ display: flex;
107
+ padding: var(--base-size-16);
108
+ flex: none; // fixes header from getting squeezed in Safari iOS
109
+ align-items: center;
110
+ // stylelint-disable-next-line primer/borders, primer/colors
111
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
112
+
113
+ @include breakpoint(sm) {
114
+ // stylelint-disable-next-line primer/spacing
115
+ padding: 7px 7px 7px var(--base-size-16);
116
+ }
117
+ }
118
+
119
+ .SelectMenu-title {
120
+ flex: 1;
121
+ // stylelint-disable-next-line primer/typography
122
+ font-size: $body-font-size;
123
+ // stylelint-disable-next-line primer/typography
124
+ font-weight: $font-weight-bold;
125
+
126
+ @include breakpoint(sm) {
127
+ font-size: inherit;
128
+ }
129
+ }
130
+
131
+ .SelectMenu-closeButton {
132
+ padding: var(--base-size-16);
133
+ margin: calc(var(--base-size-16) * -1);
134
+ // stylelint-disable-next-line primer/typography
135
+ line-height: 1;
136
+ color: var(--fgColor-muted, var(--color-fg-muted));
137
+ background-color: transparent;
138
+ border: 0;
139
+
140
+ @include breakpoint(sm) {
141
+ padding: var(--base-size-8);
142
+ // stylelint-disable-next-line primer/spacing
143
+ margin: calc(var(--base-size-8) * -1) (-7px); // Using -7px fixes a :focus glitch
144
+ }
145
+ }
146
+
147
+ // Filter
148
+ //
149
+ // An input to filter a large list
150
+
151
+ .SelectMenu-filter {
152
+ padding: var(--base-size-16);
153
+ margin: 0;
154
+ // stylelint-disable-next-line primer/borders, primer/colors
155
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
156
+
157
+ @include breakpoint(sm) {
158
+ padding: var(--base-size-8);
159
+ }
160
+ }
161
+
162
+ .SelectMenu-input {
163
+ display: block;
164
+ width: 100%;
165
+
166
+ @include breakpoint(sm) {
167
+ // stylelint-disable-next-line primer/typography
168
+ font-size: $h5-size;
169
+ }
170
+ }
171
+
172
+ // List
173
+ //
174
+ // The container that holds all the list items. Starts scrolling when the list gets too long.
175
+
176
+ .SelectMenu-list {
177
+ position: relative;
178
+ padding: 0;
179
+ margin: 0;
180
+ // stylelint-disable-next-line primer/spacing
181
+ margin-bottom: -$border-width; // Hides the last border in the list
182
+ flex: auto;
183
+ overflow-x: hidden;
184
+ overflow-y: auto;
185
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
186
+ -webkit-overflow-scrolling: touch; // Adds momentum + bouncy scrolling
187
+ }
188
+
189
+ // List Item
190
+ //
191
+ // The interactive element used to make a selection
192
+
193
+ .SelectMenu-item {
194
+ display: flex;
195
+ align-items: center;
196
+ width: 100%;
197
+ padding: var(--base-size-16);
198
+ overflow: hidden;
199
+ color: var(--fgColor-default, var(--color-fg-default));
200
+ text-align: left;
201
+ cursor: pointer;
202
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
203
+ border: 0;
204
+ // stylelint-disable-next-line primer/borders, primer/colors
205
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
206
+
207
+ @include breakpoint(sm) {
208
+ // stylelint-disable-next-line primer/spacing
209
+ padding-top: 7px;
210
+ // stylelint-disable-next-line primer/spacing
211
+ padding-bottom: 7px;
212
+ }
213
+
214
+ // Borderless
215
+ .SelectMenu-list--borderless & {
216
+ border-bottom: 0;
217
+ }
218
+ }
219
+
220
+ // Icon
221
+ //
222
+ // Icon shown on the left of a list item.
223
+
224
+ .SelectMenu-icon {
225
+ width: var(--base-size-16); // fixed width to make sure following content aligns
226
+ margin-right: var(--base-size-8);
227
+ flex-shrink: 0;
228
+ }
229
+
230
+ // Check icon
231
+ .SelectMenu-icon--check {
232
+ visibility: hidden;
233
+ transition: transform 0.12s cubic-bezier(0.5, 0.1, 1, 0.5), visibility 0s 0.12s linear;
234
+ transform: scale(0);
235
+ }
236
+
237
+ // Tabs
238
+ //
239
+ // Allows switching between multiple lists
240
+
241
+ .SelectMenu-tabs {
242
+ display: flex;
243
+ flex-shrink: 0;
244
+ overflow-x: auto;
245
+ overflow-y: hidden;
246
+ // stylelint-disable-next-line primer/box-shadow
247
+ box-shadow: inset 0 -1px 0 var(--borderColor-muted, var(--color-border-muted));
248
+ -webkit-overflow-scrolling: touch;
249
+
250
+ // Hide scrollbar so it doesn't cover the text
251
+ &::-webkit-scrollbar {
252
+ display: none;
253
+ }
254
+
255
+ @include breakpoint(sm) {
256
+ padding: var(--base-size-8) var(--base-size-8) 0 var(--base-size-8);
257
+ }
258
+ }
259
+
260
+ .SelectMenu-tab {
261
+ flex: 1;
262
+ padding: var(--base-size-8) var(--base-size-16);
263
+ // stylelint-disable-next-line primer/typography
264
+ font-size: $font-size-small;
265
+ // stylelint-disable-next-line primer/typography
266
+ font-weight: $font-weight-semibold;
267
+ color: var(--fgColor-muted, var(--color-fg-muted));
268
+ text-align: center;
269
+ background-color: transparent;
270
+ border: 0;
271
+ // stylelint-disable-next-line primer/box-shadow
272
+ box-shadow: inset 0 -1px 0 var(--borderColor-muted, var(--color-border-muted));
273
+
274
+ @include breakpoint(sm) {
275
+ flex: none;
276
+ padding: var(--base-size-4) var(--base-size-16);
277
+ // stylelint-disable-next-line primer/borders, primer/colors
278
+ border: $border-width $border-style transparent;
279
+ border-bottom-width: 0;
280
+ // stylelint-disable-next-line primer/borders
281
+ border-top-left-radius: $border-radius;
282
+ // stylelint-disable-next-line primer/borders
283
+ border-top-right-radius: $border-radius;
284
+ }
285
+
286
+ &[aria-selected='true'] {
287
+ z-index: 1; // Keeps box-shadow visible when hovering
288
+ color: var(--fgColor-default, var(--color-fg-default));
289
+ cursor: default;
290
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
291
+ // stylelint-disable-next-line primer/box-shadow
292
+ box-shadow: 0 0 0 1px var(--borderColor-muted, var(--color-border-muted));
293
+
294
+ @include breakpoint(sm) {
295
+ border-color: var(--borderColor-muted, var(--color-border-muted));
296
+ box-shadow: none;
297
+ }
298
+ }
299
+ }
300
+
301
+ // Message
302
+ //
303
+ // A container used to show different kinds of text messages.
304
+
305
+ .SelectMenu-message {
306
+ // stylelint-disable-next-line primer/spacing
307
+ padding: 7px var(--base-size-16);
308
+ text-align: center;
309
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
310
+ // stylelint-disable-next-line primer/borders, primer/colors
311
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
312
+ }
313
+
314
+ // Blankslate and Loading
315
+ //
316
+ // A container used to show a blankslate or the loading animation.
317
+
318
+ .SelectMenu-blankslate,
319
+ .SelectMenu-loading {
320
+ padding: var(--base-size-24) var(--base-size-16);
321
+ text-align: center;
322
+ background-color: var(--overlay-bgColor, var(--color-canvas-overlay));
323
+ }
324
+
325
+ // Divider
326
+ //
327
+ // Can be used to divide the list into multiple groups
328
+
329
+ .SelectMenu-divider {
330
+ padding: var(--base-size-4) var(--base-size-16);
331
+ margin: 0;
332
+ // stylelint-disable-next-line primer/typography
333
+ font-size: $font-size-small;
334
+ // stylelint-disable-next-line primer/typography
335
+ font-weight: $font-weight-semibold;
336
+ color: var(--fgColor-muted, var(--color-fg-muted));
337
+ background-color: var(--bgColor-muted, var(--color-canvas-subtle));
338
+ // stylelint-disable-next-line primer/borders, primer/colors
339
+ border-bottom: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
340
+
341
+ // Borderless
342
+ .SelectMenu-list--borderless & {
343
+ // stylelint-disable-next-line primer/borders, primer/colors
344
+ border-top: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
345
+
346
+ &:empty {
347
+ padding: 0;
348
+ border-top: 0;
349
+ }
350
+ }
351
+ }
352
+
353
+ // Footer
354
+ //
355
+ // A container at the bottom.
356
+
357
+ .SelectMenu-footer {
358
+ z-index: 0; // Avoid top border from getting covered by the negative margin of the list
359
+ padding: var(--base-size-8) var(--base-size-16);
360
+ // stylelint-disable-next-line primer/typography
361
+ font-size: $font-size-small;
362
+ color: var(--fgColor-muted, var(--color-fg-muted));
363
+ text-align: center;
364
+ // stylelint-disable-next-line primer/borders, primer/colors
365
+ border-top: $border-width $border-style var(--borderColor-muted, var(--color-border-muted));
366
+
367
+ @include breakpoint(sm) {
368
+ // stylelint-disable-next-line primer/spacing
369
+ padding: 7px var(--base-size-16);
370
+ }
371
+ }
372
+
373
+ // Has Filter (modifier)
374
+ //
375
+ // Makes sure that the filter input keeps a fixed position at the top while typing. Only visible for xs.
376
+
377
+ .SelectMenu--hasFilter {
378
+ .SelectMenu-modal {
379
+ height: 80%;
380
+ max-height: none;
381
+ margin-top: 0;
382
+
383
+ @include breakpoint(sm) {
384
+ height: auto;
385
+ max-height: $SelectMenu-max-height;
386
+ margin-top: var(--base-size-8);
387
+ }
388
+ }
389
+ }
390
+
391
+ // States
392
+ //
393
+ // Different states
394
+
395
+ // Reset outlines
396
+ .SelectMenu-tab:focus,
397
+ .SelectMenu-item:focus {
398
+ outline: 0;
399
+ }
400
+
401
+ // Reset <a> elements
402
+ .SelectMenu-item:hover {
403
+ text-decoration: none;
404
+ }
405
+
406
+ // Selected
407
+ //
408
+ // Visible when a user clicks/taps on a list item
409
+
410
+ .SelectMenu-item[aria-checked='true'] {
411
+ // stylelint-disable-next-line primer/typography
412
+ font-weight: $font-weight-semibold;
413
+ color: var(--fgColor-default, var(--color-fg-default));
414
+
415
+ .SelectMenu-icon--check {
416
+ visibility: visible;
417
+ transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), visibility 0s linear;
418
+ transform: scale(1);
419
+ }
420
+ }
421
+
422
+ // Disabled
423
+ //
424
+ // Prevent list items to be selected
425
+
426
+ .SelectMenu-item:disabled,
427
+ .SelectMenu-item[aria-disabled='true'] {
428
+ color: var(--fgColor-disabled, var(--color-primer-fg-disabled));
429
+ pointer-events: none;
430
+ }
431
+
432
+ // Can hover states
433
+ //
434
+ // For mouse/keyboard input
435
+
436
+ @media (hover: hover) {
437
+ body:not(.intent-mouse) .SelectMenu-closeButton:focus,
438
+ .SelectMenu-closeButton:hover {
439
+ color: var(--fgColor-default, var(--color-fg-default));
440
+ }
441
+
442
+ .SelectMenu-closeButton:active {
443
+ color: var(--fgColor-muted, var(--color-fg-muted));
444
+ }
445
+
446
+ body:not(.intent-mouse) .SelectMenu-item:focus,
447
+ .SelectMenu-item:hover {
448
+ background-color: var(--bgColor-neutral-muted, var(--color-neutral-subtle));
449
+ }
450
+
451
+ .SelectMenu-item:active {
452
+ background-color: var(--bgColor-muted, var(--color-canvas-subtle));
453
+ }
454
+
455
+ body:not(.intent-mouse) .SelectMenu-tab:focus {
456
+ background-color: var(--selectMenu-bgColor-active, var(--color-select-menu-tap-focus-bg));
457
+ }
458
+
459
+ .SelectMenu-tab:hover {
460
+ color: var(--fgColor-default, var(--color-fg-default));
461
+ }
462
+
463
+ .SelectMenu-tab:not([aria-selected='true']):active {
464
+ color: var(--fgColor-default, var(--color-fg-default));
465
+ background-color: var(--bgColor-muted, var(--color-canvas-subtle));
466
+ }
467
+ }
468
+
469
+ // Can not hover states
470
+ //
471
+ // For touch input
472
+
473
+ @media (hover: none) {
474
+ // Android
475
+ .SelectMenu-item:focus,
476
+ .SelectMenu-item:active {
477
+ background-color: var(--bgColor-muted, var(--color-canvas-subtle));
478
+ }
479
+
480
+ // iOS Safari
481
+ // :active would work if ontouchstart is added to the button
482
+ // Instead this tweaks the "native" highlight color
483
+ .SelectMenu-item {
484
+ -webkit-tap-highlight-color: var(--control-bgColor-active, var(--color-select-menu-tap-highlight));
485
+ }
486
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ bundle: "support"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `support` bundle
7
+
8
+ ## Usage
9
+
10
+ Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
11
+
12
+ ```scss
13
+ @import "@primer/css/support/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/support.css`.
19
+
20
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1,34 +1,122 @@
1
+ // This mixin is used to output the tokens/variables from Primitives
2
+ //
3
+ // Example:
4
+ //
5
+ // @include color-mode-theme(dark) {
6
+ // --color: black;
7
+ // }
8
+ //
9
+ // Warning!!!
10
+ // Don't use this mixin with a class. E.g.
11
+ // @include color-mode-theme(dark) {
12
+ // .my-class {
13
+ // color: red;
14
+ // }
15
+ // }
16
+ //
17
+ // The outputted `::selection .my-class` will make the selector invalid and the entire ruleset is disregarded.
18
+ // At some point we hopefully can remove the need for `&, &::selection {}` again (once the spec/implementation changes).
19
+
1
20
  @mixin color-mode-theme($theme-name, $include-root: false) {
2
21
  @if $include-root {
3
22
  :root,
4
23
  [data-color-mode="light"][data-light-theme="#{$theme-name}"],
5
24
  [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
6
- @content;
25
+ &,
26
+ &::selection {
27
+ @content;
28
+ }
7
29
 
8
30
  /*! */ // This is a fix for a cssstats bug see https://github.com/cssstats/cssstats/issues/331
9
31
  }
32
+
33
+ ::backdrop,
34
+ [data-color-mode="light"][data-light-theme="#{$theme-name}"] ::backdrop,
35
+ [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] ::backdrop {
36
+ @content;
37
+
38
+ /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14.
39
+ }
10
40
  }
11
41
 
12
42
  @else {
13
43
  [data-color-mode="light"][data-light-theme="#{$theme-name}"],
14
44
  [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
45
+ &,
46
+ &::selection {
47
+ @content;
48
+ }
49
+ }
50
+
51
+ ::backdrop,
52
+ [data-color-mode="light"][data-light-theme="#{$theme-name}"] ::backdrop,
53
+ [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] ::backdrop {
15
54
  @content;
55
+
56
+ /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14.
16
57
  }
17
58
  }
18
59
 
19
60
  @media (prefers-color-scheme: light) {
20
61
  [data-color-mode="auto"][data-light-theme="#{$theme-name}"] {
62
+ &,
63
+ &::selection {
64
+ @content;
65
+ }
66
+ }
67
+
68
+ [data-color-mode="auto"][data-light-theme="#{$theme-name}"] ::backdrop {
21
69
  @content;
70
+
71
+ /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14.
22
72
  }
23
73
  }
24
74
 
25
75
  @media (prefers-color-scheme: dark) {
26
76
  [data-color-mode="auto"][data-dark-theme="#{$theme-name}"] {
77
+ &,
78
+ &::selection {
79
+ @content;
80
+ }
81
+ }
82
+
83
+ [data-color-mode="auto"][data-light-theme="#{$theme-name}"] ::backdrop {
27
84
  @content;
85
+
86
+ /*! */ // Must remain separate from the above selector to not break browsers which don't support ::backdrop, e.g. Safari 14.
28
87
  }
29
88
  }
30
89
  }
31
90
 
91
+ // This mixin wraps styles with light or dark mode selectors
92
+ // If possible, use a color variable instead.
93
+ //
94
+ // Example:
95
+ //
96
+ // @include color-mode('dark') {
97
+ // .my-class {
98
+ // color: red;
99
+ // }
100
+ // }
101
+ //
102
+ // Returns:
103
+ //
104
+ // [data-color-mode=light][data-light-theme*=dark] .my-class,
105
+ // [data-color-mode=dark][data-dark-theme*=dark] .my-class {
106
+ // color: red;
107
+ // }
108
+ //
109
+ // @media (prefers-color-scheme: light) {
110
+ // [data-color-mode=auto][data-light-theme*=dark] .my-class {
111
+ // color: red;
112
+ // }
113
+ // }
114
+ // @media (prefers-color-scheme: dark) {
115
+ // [data-color-mode=auto][data-dark-theme*=dark] .my-class {
116
+ // color: red;
117
+ // }
118
+ // }
119
+
32
120
  @mixin color-mode($mode) {
33
121
  @if $mode == light {
34
122
  :root,
@@ -84,12 +172,10 @@
84
172
  @each $name, $value in $color-map {
85
173
  @each $type, $color in $value {
86
174
  @if $type == dark {
87
- // stylelint-disable-next-line function-no-unknown
88
175
  $dark-colors: append($dark-colors, (--color-#{$name}, #{$color}));
89
176
  }
90
177
 
91
178
  @else {
92
- // stylelint-disable-next-line function-no-unknown
93
179
  $light-colors: append($light-colors, (--color-#{$name}, #{$color}));
94
180
  }
95
181
  }
@@ -1,4 +1,4 @@
1
- @import "../variables/layout.scss";
1
+ @import '../variables/layout.scss';
2
2
 
3
3
  // Responsive media queries
4
4
 
@@ -9,7 +9,6 @@
9
9
 
10
10
  @else {
11
11
  // Retrieves the value from the key
12
- // stylelint-disable-next-line function-no-unknown
13
12
  $value: map-get($breakpoints, $breakpoint);
14
13
 
15
14
  // If the key exists in the map