@primer/css 0.0.0-2021987743 → 0.0.0-20220106235309

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 (209) hide show
  1. package/CHANGELOG.md +128 -7
  2. package/DEVELOP.md +15 -0
  3. package/actionlist/action-list-item-divider.scss +42 -0
  4. package/actionlist/action-list-item.scss +513 -0
  5. package/actionlist/action-list-tree.scss +92 -0
  6. package/actionlist/action-list-variables.scss +8 -0
  7. package/actionlist/action-list.scss +38 -0
  8. package/actionlist/index.scss +6 -0
  9. package/alerts/flash.scss +9 -0
  10. package/alerts/index.scss +2 -2
  11. package/autocomplete/autocomplete.scss +1 -1
  12. package/autocomplete/index.scss +3 -3
  13. package/autocomplete/suggester.scss +9 -1
  14. package/avatars/avatar-stack.scss +2 -1
  15. package/avatars/circle-badge.scss +1 -1
  16. package/avatars/index.scss +5 -5
  17. package/base/base.scss +1 -0
  18. package/base/index.scss +6 -7
  19. package/base/normalize.scss +1 -1
  20. package/blankslate/index.scss +2 -3
  21. package/box/box-overlay.scss +40 -0
  22. package/box/index.scss +3 -2
  23. package/branch-name/index.scss +2 -2
  24. package/breadcrumb/breadcrumb.scss +1 -1
  25. package/breadcrumb/index.scss +2 -2
  26. package/buttons/button-group.scss +3 -2
  27. package/buttons/button.scss +14 -14
  28. package/buttons/index.scss +4 -4
  29. package/buttons/misc.scss +14 -10
  30. package/color-modes/index.scss +8 -7
  31. package/color-modes/native.scss +1 -0
  32. package/color-modes/themes/dark.scss +2 -3
  33. package/color-modes/themes/dark_colorblind.scss +3 -4
  34. package/color-modes/themes/dark_dimmed.scss +2 -3
  35. package/color-modes/themes/dark_high_contrast.scss +2 -3
  36. package/color-modes/themes/light.scss +2 -3
  37. package/color-modes/themes/light_colorblind.scss +3 -4
  38. package/color-modes/themes/light_high_contrast.scss +6 -0
  39. package/core/index.scss +15 -14
  40. package/deprecations.json +4 -2
  41. package/dist/actionlist.css +2 -0
  42. package/dist/actionlist.css.map +1 -0
  43. package/dist/actionlist.js +1 -0
  44. package/dist/alerts.css +1 -1
  45. package/dist/alerts.css.map +1 -1
  46. package/dist/autocomplete.css +1 -1
  47. package/dist/autocomplete.css.map +1 -1
  48. package/dist/avatars.css +1 -1
  49. package/dist/avatars.css.map +1 -1
  50. package/dist/base.css +1 -1
  51. package/dist/base.css.map +1 -1
  52. package/dist/blankslate.css.map +1 -1
  53. package/dist/box.css +1 -1
  54. package/dist/box.css.map +1 -1
  55. package/dist/branch-name.css.map +1 -1
  56. package/dist/breadcrumb.css.map +1 -1
  57. package/dist/buttons.css +1 -1
  58. package/dist/buttons.css.map +1 -1
  59. package/dist/color-modes.css +1 -1
  60. package/dist/color-modes.css.map +1 -1
  61. package/dist/core.css +1 -1
  62. package/dist/core.css.map +1 -1
  63. package/dist/deprecations.json +4 -2
  64. package/dist/dropdown.css.map +1 -1
  65. package/dist/forms.css +1 -1
  66. package/dist/forms.css.map +1 -1
  67. package/dist/header.css.map +1 -1
  68. package/dist/labels.css +1 -1
  69. package/dist/labels.css.map +1 -1
  70. package/dist/layout.css +1 -1
  71. package/dist/layout.css.map +1 -1
  72. package/dist/links.css.map +1 -1
  73. package/dist/loaders.css.map +1 -1
  74. package/dist/markdown.css.map +1 -1
  75. package/dist/marketing-buttons.css +1 -1
  76. package/dist/marketing-buttons.css.map +1 -1
  77. package/dist/marketing-links.css +2 -0
  78. package/dist/marketing-links.css.map +1 -0
  79. package/dist/marketing-links.js +1 -0
  80. package/dist/marketing-type.css.map +1 -1
  81. package/dist/marketing-utilities.css +1 -1
  82. package/dist/marketing-utilities.css.map +1 -1
  83. package/dist/marketing.css +1 -1
  84. package/dist/marketing.css.map +1 -1
  85. package/dist/meta.json +134 -218
  86. package/dist/navigation.css.map +1 -1
  87. package/dist/pagination.css +1 -1
  88. package/dist/pagination.css.map +1 -1
  89. package/dist/popover.css +1 -1
  90. package/dist/popover.css.map +1 -1
  91. package/dist/primer.css +4 -4
  92. package/dist/primer.css.map +1 -1
  93. package/dist/product.css +1 -1
  94. package/dist/product.css.map +1 -1
  95. package/dist/progress.css.map +1 -1
  96. package/dist/select-menu.css +1 -1
  97. package/dist/select-menu.css.map +1 -1
  98. package/dist/stats/actionlist.json +1 -0
  99. package/dist/stats/alerts.json +1 -1
  100. package/dist/stats/autocomplete.json +1 -1
  101. package/dist/stats/avatars.json +1 -1
  102. package/dist/stats/base.json +1 -1
  103. package/dist/stats/box.json +1 -1
  104. package/dist/stats/buttons.json +1 -1
  105. package/dist/stats/color-modes.json +1 -1
  106. package/dist/stats/core.json +1 -1
  107. package/dist/stats/forms.json +1 -1
  108. package/dist/stats/labels.json +1 -1
  109. package/dist/stats/layout.json +1 -1
  110. package/dist/stats/marketing-buttons.json +1 -1
  111. package/dist/stats/marketing-links.json +1 -0
  112. package/dist/stats/marketing-utilities.json +1 -1
  113. package/dist/stats/marketing.json +1 -1
  114. package/dist/stats/pagination.json +1 -1
  115. package/dist/stats/popover.json +1 -1
  116. package/dist/stats/primer.json +1 -1
  117. package/dist/stats/product.json +1 -1
  118. package/dist/stats/select-menu.json +1 -1
  119. package/dist/stats/subhead.json +1 -1
  120. package/dist/stats/toasts.json +1 -1
  121. package/dist/stats/utilities.json +1 -1
  122. package/dist/subhead.css +1 -1
  123. package/dist/subhead.css.map +1 -1
  124. package/dist/timeline.css.map +1 -1
  125. package/dist/toasts.css +1 -1
  126. package/dist/toasts.css.map +1 -1
  127. package/dist/tooltips.css.map +1 -1
  128. package/dist/truncate.css.map +1 -1
  129. package/dist/utilities.css +1 -1
  130. package/dist/utilities.css.map +1 -1
  131. package/dist/variables.json +62 -62
  132. package/dropdown/dropdown.scss +4 -4
  133. package/dropdown/index.scss +2 -2
  134. package/forms/form-control.scss +22 -8
  135. package/forms/form-group.scss +2 -2
  136. package/forms/form-select.scss +2 -2
  137. package/forms/form-validation.scss +9 -9
  138. package/forms/index.scss +7 -7
  139. package/forms/radio-group.scss +19 -0
  140. package/header/index.scss +2 -2
  141. package/index.scss +4 -4
  142. package/labels/counters.scss +1 -1
  143. package/labels/index.scss +7 -8
  144. package/labels/labels.scss +23 -4
  145. package/layout/grid.scss +1 -1
  146. package/layout/index.scss +7 -7
  147. package/layout/layout.scss +7 -11
  148. package/layout/mixins.scss +30 -4
  149. package/layout/page-layout.scss +380 -0
  150. package/links/index.scss +2 -2
  151. package/links/link.scss +1 -1
  152. package/loaders/index.scss +2 -2
  153. package/loaders/loaders.scss +1 -1
  154. package/markdown/footnotes.scss +1 -1
  155. package/markdown/images.scss +2 -2
  156. package/markdown/index.scss +9 -9
  157. package/markdown/lists.scss +3 -3
  158. package/markdown/markdown-body.scss +4 -4
  159. package/marketing/buttons/button.scss +102 -52
  160. package/marketing/buttons/index.scss +2 -2
  161. package/marketing/index.scss +5 -4
  162. package/marketing/links/index.scss +3 -0
  163. package/marketing/links/link.scss +50 -0
  164. package/marketing/support/index.scss +2 -3
  165. package/marketing/support/variables.scss +4 -5
  166. package/marketing/type/index.scss +2 -2
  167. package/marketing/type/typography.scss +26 -23
  168. package/marketing/utilities/animations.scss +42 -0
  169. package/marketing/utilities/index.scss +5 -5
  170. package/marketing/utilities/layout.scss +1 -1
  171. package/navigation/filter-list.scss +2 -2
  172. package/navigation/index.scss +7 -7
  173. package/navigation/menu.scss +3 -3
  174. package/navigation/sidenav.scss +5 -5
  175. package/navigation/subnav.scss +2 -2
  176. package/navigation/tabnav.scss +2 -2
  177. package/navigation/underline-nav.scss +2 -2
  178. package/package.json +19 -19
  179. package/pagination/index.scss +2 -2
  180. package/pagination/pagination.scss +5 -5
  181. package/popover/index.scss +2 -2
  182. package/popover/popover.scss +43 -5
  183. package/postcss.config.cjs +1 -1
  184. package/product/index.scss +17 -17
  185. package/progress/index.scss +2 -2
  186. package/select-menu/index.scss +2 -2
  187. package/select-menu/select-menu.scss +6 -6
  188. package/stylelint.config.cjs +2 -11
  189. package/subhead/index.scss +2 -2
  190. package/subhead/subhead.scss +6 -0
  191. package/support/index.scss +7 -7
  192. package/support/mixins/color-modes.scss +3 -0
  193. package/support/mixins/layout.scss +5 -5
  194. package/support/mixins/misc.scss +1 -1
  195. package/support/mixins/typography.scss +3 -2
  196. package/support/variables/layout.scss +8 -19
  197. package/support/variables/typography.scss +1 -1
  198. package/table-object/index.scss +1 -1
  199. package/timeline/index.scss +2 -2
  200. package/timeline/timeline-item.scss +1 -1
  201. package/toasts/index.scss +2 -2
  202. package/toasts/toasts.scss +0 -4
  203. package/tooltips/index.scss +2 -2
  204. package/tooltips/tooltips.scss +1 -1
  205. package/truncate/index.scss +2 -2
  206. package/utilities/details.scss +1 -1
  207. package/utilities/index.scss +12 -12
  208. package/utilities/visibility-display.scss +3 -3
  209. package/marketing/support/mixins.scss +0 -66
@@ -0,0 +1,513 @@
1
+ @mixin focusOutline {
2
+ position: relative;
3
+ z-index: 1;
4
+ outline: none;
5
+ box-shadow: 0 0 0 2px var(--color-accent-fg); // this color breaks convention
6
+ }
7
+
8
+ @mixin activeIndicatorLine {
9
+ position: absolute;
10
+ top: calc(50% - 12px);
11
+ left: -$actionList-item-padding-horizontal;
12
+ width: $spacer-1;
13
+ height: $spacer-4;
14
+ content: '';
15
+ background: var(--color-accent-fg);
16
+ border-radius: $border-radius;
17
+ }
18
+
19
+ // <li>
20
+ .ActionList-item {
21
+ position: relative;
22
+ list-style: none;
23
+ background-color: transparent;
24
+ border-radius: $border-radius;
25
+
26
+ &:hover,
27
+ &:active {
28
+ cursor: pointer;
29
+
30
+ // a href
31
+ .ActionList-content {
32
+ text-decoration: none;
33
+ }
34
+ }
35
+
36
+ // only hover li without list as children
37
+ &:not(.ActionList-item--hasSubItem) {
38
+ &:hover {
39
+ cursor: pointer;
40
+ background-color: var(--color-action-list-item-default-hover-bg);
41
+ }
42
+
43
+ &:active {
44
+ background: var(--color-action-list-item-default-active-bg);
45
+
46
+ @media screen and (prefers-reduced-motion: no-preference) {
47
+ animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
48
+ }
49
+
50
+ // stylelint-disable primer/box-shadow
51
+ @keyframes ActionList-item-active-bg {
52
+ // stylelint-disable-next-line max-nesting-depth
53
+ 50% {
54
+ box-shadow: inset 0 0 0 rgba(#000, 0.04);
55
+ transform: scale(1);
56
+ }
57
+
58
+ // stylelint-disable-next-line max-nesting-depth
59
+ 100% {
60
+ box-shadow: inset 0 3px 9px rgba(#000, 0.04);
61
+ transform: scale(0.97);
62
+ }
63
+ }
64
+ // stylelint-enable primer/box-shadow
65
+ }
66
+
67
+ &:hover,
68
+ &:active {
69
+ // hide dividers
70
+ // stylelint-disable-next-line selector-max-specificity
71
+ .ActionList-item-label::before,
72
+ + .ActionList-item .ActionList-item-label::before {
73
+ visibility: hidden;
74
+ }
75
+ }
76
+ }
77
+
78
+ // target contents of li if sub-item (li wraps item label + nested ul)
79
+ // collapse styles here
80
+ &.ActionList-item--hasSubItem {
81
+ // first child
82
+ > .ActionList-content {
83
+ &:hover {
84
+ background-color: var(--color-action-list-item-default-hover-bg);
85
+ }
86
+ }
87
+ }
88
+
89
+ // active state [aria-current]
90
+
91
+ &.ActionList-item--navActive {
92
+ &:not(.ActionList-item--subItem) {
93
+ .ActionList-item-label {
94
+ font-weight: $font-weight-bold;
95
+ }
96
+ }
97
+
98
+ &:not(.ActionList-item--danger) {
99
+ background: var(--color-action-list-item-default-selected-bg);
100
+
101
+ &:hover {
102
+ background-color: var(--color-action-list-item-default-hover-bg);
103
+ }
104
+
105
+ // stylelint-disable-next-line selector-max-specificity
106
+ &::before,
107
+ + .ActionList-item::before {
108
+ visibility: hidden;
109
+ }
110
+
111
+ // blue accent line
112
+ &::after {
113
+ @include activeIndicatorLine;
114
+ }
115
+ }
116
+ }
117
+
118
+ // collapsible item [aria-expanded]
119
+
120
+ // nesting (single level)
121
+ // target items inside expanded subgroups
122
+ &[aria-expanded] {
123
+ .ActionList--subGroup {
124
+ transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
125
+
126
+ @media (prefers-reduced-motion) {
127
+ transition: none;
128
+ }
129
+
130
+ .ActionList-content {
131
+ padding-left: $spacer-4;
132
+ }
133
+ }
134
+
135
+ // has 16px leading visual
136
+ .ActionList-content--visual16 + .ActionList--subGroup {
137
+ // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity
138
+ .ActionList-content {
139
+ padding-left: $spacer-5;
140
+ }
141
+ }
142
+
143
+ // has 20px leading visual
144
+ .ActionList-content--visual20 + .ActionList--subGroup {
145
+ // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity
146
+ .ActionList-content {
147
+ padding-left: $spacer-2 * 4.5; // 36px
148
+ }
149
+ }
150
+
151
+ // has 24px leading visual
152
+ .ActionList-content--visual24 + .ActionList--subGroup {
153
+ // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity
154
+ .ActionList-content {
155
+ padding-left: $spacer-6;
156
+ }
157
+ }
158
+ }
159
+
160
+ &[aria-expanded='true'] {
161
+ .ActionList-item-collapseIcon {
162
+ transition: transform 120ms linear;
163
+ transform: scaleY(-1);
164
+ }
165
+
166
+ .ActionList--subGroup {
167
+ visibility: visible;
168
+ overflow: auto;
169
+ height: auto;
170
+ opacity: 1;
171
+ transform: translateY(0);
172
+ }
173
+
174
+ &.ActionList-item--hasActiveSubItem {
175
+ // stylelint-disable-next-line selector-max-specificity
176
+ > .ActionList-content > .ActionList-item-label {
177
+ font-weight: $font-weight-bold;
178
+ }
179
+ }
180
+ }
181
+
182
+ &[aria-expanded='false'] {
183
+ .ActionList-item-collapseIcon {
184
+ transition: transform 120ms linear;
185
+ transform: scaleY(1);
186
+ }
187
+
188
+ .ActionList--subGroup {
189
+ display: block;
190
+ visibility: hidden;
191
+ overflow: hidden;
192
+ height: 0;
193
+ opacity: 0;
194
+ transform: translateY(-$spacer-3);
195
+ }
196
+
197
+ // show active indicator on parent collapse if child is active
198
+ &.ActionList-item--hasActiveSubItem {
199
+ background: var(--color-action-list-item-default-selected-bg);
200
+
201
+ .ActionList-item-label {
202
+ font-weight: $font-weight-bold;
203
+ }
204
+
205
+ // stylelint-disable-next-line selector-max-specificity
206
+ &::before,
207
+ + .ActionList-item::before {
208
+ visibility: hidden;
209
+ }
210
+
211
+ // blue accent line
212
+ &::after {
213
+ @include activeIndicatorLine;
214
+ }
215
+ }
216
+ }
217
+
218
+ // checkbox item [aria-checked]
219
+ // listbox [aria-selected]
220
+
221
+ &[aria-checked='true'],
222
+ &[aria-selected='true'] {
223
+ // multiselect checkmark
224
+ .ActionList-item-multiSelectCheckmark {
225
+ visibility: visible;
226
+ opacity: 1;
227
+ transition: visibility 0 linear 0, opacity $actionList-item-checkmark-transition-timing;
228
+ }
229
+
230
+ // singleselect checkmark
231
+ .ActionList-item-singleSelectCheckmark {
232
+ visibility: visible;
233
+
234
+ @media screen and (prefers-reduced-motion: no-preference) {
235
+ animation: checkmarkIn 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
236
+ }
237
+ }
238
+
239
+ // checkbox
240
+ .ActionList-item-multiSelectIcon {
241
+ .ActionList-item-multiSelectIconRect {
242
+ fill: var(--color-accent-fg);
243
+ stroke: var(--color-accent-fg);
244
+ stroke-width: $border-width;
245
+ }
246
+
247
+ .ActionList-item-multiSelectCheckmark {
248
+ fill: var(--color-fg-on-emphasis);
249
+ }
250
+ }
251
+ }
252
+
253
+ &[aria-checked='false'],
254
+ &[aria-selected='false'] {
255
+ // multiselect checkmark
256
+ .ActionList-item-multiSelectCheckmark {
257
+ visibility: hidden;
258
+ opacity: 0;
259
+ transition:
260
+ visibility 0 linear $actionList-item-checkmark-transition-timing,
261
+ opacity $actionList-item-checkmark-transition-timing;
262
+ }
263
+
264
+ // singleselect checkmark
265
+ .ActionList-item-singleSelectCheckmark {
266
+ visibility: hidden;
267
+ transition: visibility 0s linear 200ms;
268
+ clip-path: inset(16px 0 0 0);
269
+
270
+ @media screen and (prefers-reduced-motion: no-preference) {
271
+ animation: checkmarkOut 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
272
+ }
273
+ }
274
+
275
+ // checkbox
276
+ .ActionList-item-multiSelectIcon {
277
+ .ActionList-item-multiSelectIconRect {
278
+ fill: var(--color-canvas-default);
279
+ stroke: var(--color-border-default);
280
+ stroke-width: $border-width;
281
+ }
282
+ }
283
+
284
+ .ActionList-item-multiSelectIconRect {
285
+ fill: var(--color-canvas-default);
286
+ border: $border-width $border-style var(--color-border-default);
287
+ }
288
+ }
289
+
290
+ @keyframes checkmarkIn {
291
+ from {
292
+ clip-path: inset(16px 0 0 0);
293
+ }
294
+
295
+ to {
296
+ clip-path: inset(0 0 0 0);
297
+ }
298
+ }
299
+
300
+ @keyframes checkmarkOut {
301
+ from {
302
+ clip-path: inset(0 0 0 0);
303
+ }
304
+
305
+ to {
306
+ clip-path: inset(16px 0 0 0);
307
+ }
308
+ }
309
+
310
+ // variants
311
+
312
+ // danger
313
+ &.ActionList-item--danger {
314
+ .ActionList-item-label {
315
+ color: var(--color-danger-fg);
316
+ }
317
+
318
+ .ActionList-item-visual {
319
+ color: var(--color-danger-fg);
320
+ }
321
+
322
+ @media (hover: hover) and (pointer: fine) {
323
+ &:hover {
324
+ background: var(--color-action-list-item-danger-hover-bg);
325
+
326
+ // stylelint-disable-next-line max-nesting-depth
327
+ .ActionList-item-label {
328
+ color: var(--color-action-list-item-danger-hover-text);
329
+ }
330
+ }
331
+ }
332
+
333
+ &:active {
334
+ background: var(--color-action-list-item-danger-active-bg);
335
+ }
336
+ }
337
+
338
+ // disabled
339
+ &[aria-disabled='true'] {
340
+ .ActionList-item-label,
341
+ .ActionList-item-description {
342
+ color: var(--color-primer-fg-disabled);
343
+ }
344
+
345
+ .ActionList-item-visual {
346
+ fill: var(--color-primer-fg-disabled);
347
+ }
348
+
349
+ @media (hover: hover) and (pointer: fine) {
350
+ &:hover {
351
+ cursor: not-allowed;
352
+ background-color: transparent;
353
+ }
354
+ }
355
+ }
356
+
357
+ // if nested list exists, remove default padding
358
+ .ActionList {
359
+ // stylelint-disable-next-line primer/spacing
360
+ padding: unset;
361
+ }
362
+ }
363
+
364
+ // span or a href
365
+ .ActionList-content {
366
+ position: relative;
367
+ display: grid;
368
+ // stylelint-disable-next-line primer/spacing
369
+ padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
370
+ font-size: $body-font-size;
371
+ font-weight: $font-weight-normal;
372
+ color: var(--color-fg-default);
373
+ user-select: none;
374
+ border-radius: $border-radius;
375
+ transition: $actionList-item-bg-transition;
376
+ grid-template-rows: min-content;
377
+ grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
378
+ grid-template-columns: min-content min-content minmax(0, auto) min-content min-content;
379
+ align-items: start;
380
+
381
+ // column-gap persists with empty grid-areas, margin applies only when children exist
382
+ > :not(:last-child) {
383
+ margin-right: $spacer-2;
384
+ }
385
+
386
+ &:focus-visible {
387
+ @include focusOutline;
388
+ }
389
+
390
+ // sizes
391
+
392
+ &.ActionList-content--sizeMedium {
393
+ // 44px total height
394
+ // stylelint-disable-next-line primer/spacing
395
+ padding: $actionList-item-padding-vertical-md $actionList-item-padding-horizontal;
396
+ }
397
+
398
+ &.ActionList-content--sizeLarge {
399
+ // 48px total height
400
+ // stylelint-disable-next-line primer/spacing
401
+ padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
402
+ }
403
+
404
+ &.ActionList-content--fontSmall {
405
+ font-size: $font-size-small;
406
+ }
407
+
408
+ // On pointer:coarse (mobile), all list items are large
409
+ @media (pointer: coarse) {
410
+ // stylelint-disable-next-line primer/spacing
411
+ padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
412
+ }
413
+
414
+ &.ActionList-content--blockDescription {
415
+ // if leading/trailing visual, align with first line of content
416
+ .ActionList-item-visual {
417
+ place-self: start;
418
+ }
419
+ }
420
+ }
421
+
422
+ // place children on grid
423
+
424
+ .ActionList-item-action--leading {
425
+ grid-area: leadingAction;
426
+ }
427
+
428
+ .ActionList-item-visual--leading {
429
+ grid-area: leadingVisual;
430
+ }
431
+
432
+ .ActionList-item-label {
433
+ grid-area: label;
434
+ }
435
+
436
+ .ActionList-item-visual--trailing {
437
+ grid-area: trailingVisual;
438
+ }
439
+
440
+ .ActionList-item-action--trailing {
441
+ grid-area: trailingAction;
442
+ }
443
+
444
+ // wrapper span
445
+ // default block
446
+ .ActionList-item-descriptionWrap {
447
+ grid-area: label;
448
+ display: flex;
449
+ flex-direction: column;
450
+
451
+ .ActionList-item-description {
452
+ margin-top: $spacer-1;
453
+ }
454
+
455
+ .ActionList-item-label {
456
+ font-weight: $font-weight-bold;
457
+ }
458
+ }
459
+
460
+ // inline
461
+ .ActionList-item-descriptionWrap--inline {
462
+ flex-direction: row;
463
+ align-items: baseline;
464
+
465
+ .ActionList-item-description {
466
+ // stylelint-disable-next-line primer/spacing
467
+ margin-left: $actionList-item-padding-horizontal;
468
+ }
469
+ }
470
+
471
+ // description
472
+ .ActionList-item-description {
473
+ font-size: $font-size-small;
474
+ font-weight: $font-weight-normal;
475
+ line-height: $lh-default;
476
+ color: var(--color-fg-muted);
477
+ }
478
+
479
+ // helper for grid alignment with multi-line content
480
+ // span wrapping svg or text
481
+ .ActionList-item-visual,
482
+ .ActionList-item-action {
483
+ display: flex;
484
+ min-height: $actionList-item-height-sm;
485
+ color: var(--color-fg-muted); // if visual is text
486
+ fill: var(--color-fg-muted);
487
+ align-items: center;
488
+ }
489
+
490
+ // text
491
+ // stylelint-disable-next-line no-duplicate-selectors
492
+ .ActionList-item-label {
493
+ position: relative; // for pseudo dividers
494
+ font-weight: $font-weight-normal;
495
+ // we need a strict value here for grid alignment
496
+ // stylelint-disable-next-line primer/typography
497
+ line-height: $actionList-item-label-line-height;
498
+ color: var(--color-fg-default);
499
+ }
500
+
501
+ .ActionList-item-label--truncate {
502
+ overflow: hidden;
503
+ text-overflow: ellipsis;
504
+ white-space: nowrap;
505
+ }
506
+
507
+ // nested lists (only supports 1 level currently)
508
+ // target ActionList-item--subItem for padding-left to maintain :active :after state
509
+
510
+ // TODO: remove with PVC implementation
511
+ .ActionList-item--subItem > .ActionList-content {
512
+ font-size: $font-size-small;
513
+ }
@@ -0,0 +1,92 @@
1
+ // tree-view variant
2
+ // renders ActionList with default styling for tree-view
3
+ // collapse/expand icons presents as leadingActions, rotate 90deg
4
+ // connecting vertical lines between collapse groups
5
+ // consistent font-size between nested groups
6
+
7
+ @mixin treeConnectingLine($left) {
8
+ position: absolute;
9
+ left: $left;
10
+ width: 1px;
11
+ height: 100%;
12
+ content: '';
13
+ background: var(--color-action-list-item-inline-divider);
14
+ }
15
+
16
+ .ActionList--tree {
17
+ --ActionList-tree-depth: 1;
18
+ // TODO: remove with PVC implementation
19
+ .ActionList-item--subItem > .ActionList-content {
20
+ font-size: $body-font-size;
21
+ }
22
+
23
+ .ActionList-item {
24
+ // nesting (infinate levels)
25
+ // target items inside expanded subgroup
26
+ &[aria-expanded] {
27
+ .ActionList--subGroup {
28
+ position: relative;
29
+
30
+ // --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
31
+ // stylelint-disable-next-line selector-max-specificity, max-nesting-depth, selector-max-compound-selectors
32
+ .ActionList-content {
33
+ // stylelint-disable-next-line primer/spacing
34
+ padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
35
+ }
36
+ }
37
+ }
38
+
39
+ // tree-view specific collapse icon positioning/animation
40
+ &[aria-expanded='true'] {
41
+ .ActionList-item-collapseIcon {
42
+ transition: transform 120ms linear;
43
+ transform: rotate(0deg);
44
+ }
45
+ }
46
+
47
+ &[aria-expanded='false'] {
48
+ .ActionList-item-collapseIcon {
49
+ transition: transform 120ms linear;
50
+ transform: rotate(-90deg);
51
+ }
52
+ }
53
+ }
54
+
55
+ // expand/collapse group
56
+ .ActionList-item--hasSubItem {
57
+ .ActionList-item--subItem:not(.ActionList-item--hasSubItem) {
58
+ // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
59
+ .ActionList-content {
60
+ // increase child padding by targeting content first child span (add to ActionList-content padding, not replace)
61
+ // creates a slight indent of child items
62
+ // stylelint-disable-next-line selector-max-specificity, selector-max-type, max-nesting-depth, selector-max-compound-selectors
63
+ > span:first-child {
64
+ padding-left: $spacer-4;
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ // first subitem
71
+ > [aria-level='1'].ActionList-item--hasSubItem {
72
+ > .ActionList--subGroup {
73
+ // stylelint-disable-next-line selector-max-specificity
74
+ &::before {
75
+ @include treeConnectingLine($left: $spacer-3);
76
+ }
77
+ }
78
+ }
79
+
80
+ // all other subitems
81
+ // center connecting line with parent (line is 1px (8px - 1px)
82
+ .ActionList-item--hasSubItem:not([aria-level='1']) {
83
+ > .ActionList--subGroup {
84
+ // stylelint-disable-next-line selector-max-specificity
85
+ &::before {
86
+ @include treeConnectingLine(
87
+ $left: calc(#{$spacer-2} * (var(--ActionList-tree-depth)) + #{$spacer-2 - $border-width})
88
+ );
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,8 @@
1
+ $actionList-item-height-sm: $spacer-2 * 2.5 !default;
2
+ $actionList-item-label-line-height: $spacer-2 * 2.5 !default;
3
+ $actionList-item-padding-vertical-md: $spacer-2 * 1.25 !default;
4
+ $actionList-item-padding-vertical-lg: $spacer-2 * 1.75 !default;
5
+ $actionList-item-padding-vertical: $spacer-1 * 1.5 !default;
6
+ $actionList-item-padding-horizontal: $spacer-2 !default;
7
+ $actionList-item-bg-transition: background 33.333ms linear !default; // 2 frames on a 60hz monitor
8
+ $actionList-item-checkmark-transition-timing: 50ms !default;
@@ -0,0 +1,38 @@
1
+ // <ul>
2
+ .ActionList {
3
+ padding: $spacer-2;
4
+ }
5
+
6
+ // full bleed
7
+ .ActionList--full {
8
+ padding: 0;
9
+ }
10
+
11
+ // dividers
12
+
13
+ .ActionList--divided {
14
+ .ActionList-item-label::before {
15
+ position: absolute;
16
+ top: -$actionList-item-padding-vertical;
17
+ display: block;
18
+ width: 100%;
19
+ height: 1px;
20
+ content: '';
21
+ background: var(--color-action-list-item-inline-divider);
22
+ }
23
+
24
+ // hide divider if item is active
25
+ .ActionList-item--navActive {
26
+ // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
27
+ .ActionList-item-label::before,
28
+ + .ActionList-item .ActionList-item-label::before {
29
+ visibility: hidden;
30
+ }
31
+ }
32
+ }
33
+
34
+ // hide if item is first of type with label::before, or is the first item after a sectionDivider
35
+ .ActionList-item:first-of-type .ActionList-item-label::before,
36
+ .ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
37
+ visibility: hidden;
38
+ }
@@ -0,0 +1,6 @@
1
+ @import '../support/index.scss';
2
+ @import './action-list-variables.scss';
3
+ @import './action-list.scss';
4
+ @import './action-list-tree.scss';
5
+ @import './action-list-item.scss';
6
+ @import './action-list-item-divider.scss';
package/alerts/flash.scss CHANGED
@@ -57,6 +57,15 @@
57
57
  margin-top: -3px;
58
58
  margin-left: $spacer-4;
59
59
  background-clip: padding-box;
60
+
61
+ &.btn .octicon {
62
+ margin-right: $spacer-1;
63
+ color: var(--color-fg-muted);
64
+ }
65
+
66
+ &.btn-primary .octicon {
67
+ color: inherit;
68
+ }
60
69
  }
61
70
 
62
71
  //
package/alerts/index.scss CHANGED
@@ -1,3 +1,3 @@
1
1
  // support files
2
- @import "../support/index.scss";
3
- @import "./flash.scss";
2
+ @import '../support/index.scss';
3
+ @import './flash.scss';
@@ -44,7 +44,7 @@
44
44
  }
45
45
 
46
46
  &.selected,
47
- &[aria-selected=true],
47
+ &[aria-selected='true'],
48
48
  &.navigation-focus {
49
49
  color: var(--color-fg-on-emphasis);
50
50
  text-decoration: none;
@@ -1,4 +1,4 @@
1
1
  // support files
2
- @import "../support/index.scss";
3
- @import "./autocomplete.scss";
4
- @import "./suggester.scss";
2
+ @import '../support/index.scss';
3
+ @import './autocomplete.scss';
4
+ @import './suggester.scss';