@primer/css 0.0.0-2022020193741 → 0.0.0-20220208013302

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 (143) hide show
  1. package/CHANGELOG.md +53 -6
  2. package/actionlist/action-list-item.scss +120 -54
  3. package/actionlist/action-list-tree.scss +92 -0
  4. package/actionlist/index.scss +1 -0
  5. package/autocomplete/autocomplete.scss +1 -1
  6. package/avatars/avatar-stack.scss +1 -0
  7. package/base/base.scss +1 -0
  8. package/base/index.scss +0 -1
  9. package/blankslate/index.scss +0 -1
  10. package/breadcrumb/breadcrumb.scss +1 -1
  11. package/buttons/button-group.scss +3 -2
  12. package/buttons/button.scss +0 -35
  13. package/buttons/misc.scss +6 -7
  14. package/color-modes/native.scss +12 -0
  15. package/color-modes/themes/dark.scss +0 -1
  16. package/color-modes/themes/dark_colorblind.scss +0 -1
  17. package/color-modes/themes/dark_dimmed.scss +0 -1
  18. package/color-modes/themes/dark_high_contrast.scss +0 -1
  19. package/color-modes/themes/light.scss +0 -1
  20. package/color-modes/themes/light_colorblind.scss +0 -1
  21. package/color-modes/themes/light_high_contrast.scss +0 -1
  22. package/core/index.scss +2 -0
  23. package/dialog/README.md +25 -0
  24. package/dialog/dialog.scss +19 -0
  25. package/dialog/index.scss +2 -0
  26. package/dist/actionlist.css +1 -1
  27. package/dist/actionlist.css.map +1 -1
  28. package/dist/alerts.css.map +1 -1
  29. package/dist/autocomplete.css.map +1 -1
  30. package/dist/avatars.css +1 -1
  31. package/dist/avatars.css.map +1 -1
  32. package/dist/base.css.map +1 -1
  33. package/dist/blankslate.css.map +1 -1
  34. package/dist/box.css.map +1 -1
  35. package/dist/branch-name.css.map +1 -1
  36. package/dist/breadcrumb.css.map +1 -1
  37. package/dist/buttons.css +1 -1
  38. package/dist/buttons.css.map +1 -1
  39. package/dist/color-modes.css +1 -1
  40. package/dist/color-modes.css.map +1 -1
  41. package/dist/core.css +1 -1
  42. package/dist/core.css.map +1 -1
  43. package/dist/dialog.css +2 -0
  44. package/dist/dialog.css.map +1 -0
  45. package/dist/dialog.js +1 -0
  46. package/dist/dropdown.css.map +1 -1
  47. package/dist/forms.css.map +1 -1
  48. package/dist/header.css.map +1 -1
  49. package/dist/labels.css +1 -1
  50. package/dist/labels.css.map +1 -1
  51. package/dist/layout.css +1 -1
  52. package/dist/layout.css.map +1 -1
  53. package/dist/links.css.map +1 -1
  54. package/dist/loaders.css.map +1 -1
  55. package/dist/markdown.css.map +1 -1
  56. package/dist/marketing-buttons.css +1 -1
  57. package/dist/marketing-buttons.css.map +1 -1
  58. package/dist/marketing-links.css +2 -0
  59. package/dist/marketing-links.css.map +1 -0
  60. package/dist/marketing-links.js +1 -0
  61. package/dist/marketing-type.css.map +1 -1
  62. package/dist/marketing-utilities.css +1 -1
  63. package/dist/marketing-utilities.css.map +1 -1
  64. package/dist/marketing.css +1 -1
  65. package/dist/marketing.css.map +1 -1
  66. package/dist/meta.json +86 -53
  67. package/dist/navigation.css.map +1 -1
  68. package/dist/overlay.css +2 -0
  69. package/dist/overlay.css.map +1 -0
  70. package/dist/overlay.js +1 -0
  71. package/dist/pagination.css +1 -1
  72. package/dist/pagination.css.map +1 -1
  73. package/dist/popover.css +1 -1
  74. package/dist/popover.css.map +1 -1
  75. package/dist/primer.css +4 -4
  76. package/dist/primer.css.map +1 -1
  77. package/dist/product.css +1 -1
  78. package/dist/product.css.map +1 -1
  79. package/dist/progress.css.map +1 -1
  80. package/dist/select-menu.css.map +1 -1
  81. package/dist/stats/actionlist.json +1 -1
  82. package/dist/stats/avatars.json +1 -1
  83. package/dist/stats/buttons.json +1 -1
  84. package/dist/stats/color-modes.json +1 -1
  85. package/dist/stats/core.json +1 -1
  86. package/dist/stats/dialog.json +1 -0
  87. package/dist/stats/labels.json +1 -1
  88. package/dist/stats/layout.json +1 -1
  89. package/dist/stats/marketing-buttons.json +1 -1
  90. package/dist/stats/marketing-links.json +1 -0
  91. package/dist/stats/marketing-utilities.json +1 -1
  92. package/dist/stats/marketing.json +1 -1
  93. package/dist/stats/overlay.json +1 -0
  94. package/dist/stats/pagination.json +1 -1
  95. package/dist/stats/popover.json +1 -1
  96. package/dist/stats/primer.json +1 -1
  97. package/dist/stats/product.json +1 -1
  98. package/dist/stats/utilities.json +1 -1
  99. package/dist/subhead.css.map +1 -1
  100. package/dist/timeline.css.map +1 -1
  101. package/dist/toasts.css.map +1 -1
  102. package/dist/tooltips.css.map +1 -1
  103. package/dist/truncate.css.map +1 -1
  104. package/dist/utilities.css +1 -1
  105. package/dist/utilities.css.map +1 -1
  106. package/dist/variables.json +38 -8
  107. package/forms/form-control.scss +2 -0
  108. package/labels/counters.scss +1 -1
  109. package/labels/index.scss +0 -1
  110. package/labels/labels.scss +1 -0
  111. package/layout/index.scss +1 -1
  112. package/layout/layout.scss +8 -11
  113. package/layout/mixins.scss +30 -4
  114. package/layout/page-layout.scss +380 -0
  115. package/markdown/images.scss +2 -2
  116. package/marketing/buttons/button.scss +8 -0
  117. package/marketing/index.scss +1 -0
  118. package/marketing/links/index.scss +3 -0
  119. package/marketing/links/link.scss +50 -0
  120. package/marketing/type/typography.scss +3 -0
  121. package/marketing/utilities/animations.scss +42 -0
  122. package/navigation/filter-list.scss +2 -2
  123. package/navigation/menu.scss +2 -2
  124. package/navigation/sidenav.scss +2 -2
  125. package/navigation/subnav.scss +2 -2
  126. package/navigation/tabnav.scss +2 -2
  127. package/navigation/underline-nav.scss +2 -2
  128. package/overlay/README.md +25 -0
  129. package/overlay/index.scss +2 -0
  130. package/overlay/overlay.scss +182 -0
  131. package/package.json +14 -13
  132. package/pagination/pagination.scss +41 -4
  133. package/popover/popover.scss +1 -1
  134. package/product/index.scss +1 -1
  135. package/select-menu/select-menu.scss +2 -2
  136. package/stylelint.config.cjs +2 -11
  137. package/support/mixins/color-modes.scss +3 -0
  138. package/support/mixins/misc.scss +0 -16
  139. package/support/mixins/typography.scss +3 -2
  140. package/support/variables/layout.scss +1 -2
  141. package/support/variables/misc.scss +2 -0
  142. package/support/variables/typography.scss +1 -0
  143. package/utilities/visibility-display.scss +3 -3
package/CHANGELOG.md CHANGED
@@ -1,22 +1,69 @@
1
1
  # @primer/css
2
2
 
3
- ## 0.0.0-2022020193741
3
+ ## 0.0.0-20220208013302
4
+
5
+ ### Patch Changes
6
+
7
+ - Fake entry to force publishing
8
+
9
+ * [#1890](https://github.com/primer/css/pull/1890) [`74d0438b`](https://github.com/primer/css/commit/74d0438bd4dbaed447b553c5d3c8b945da282836) Thanks [@andrialexandrou](https://github.com/andrialexandrou)! - Adds --color-accent-emphasis and --color-fg-on-emphasis rules for Windows High Contrast Mode
10
+
11
+ - [#1882](https://github.com/primer/css/pull/1882) [`4a06aba1`](https://github.com/primer/css/commit/4a06aba1d3f80bcc228ff4360d0e02d5ace158ff) Thanks [@tqwewe](https://github.com/tqwewe)! - Fix layout gutter none styles
12
+
13
+ * [#1894](https://github.com/primer/css/pull/1894) [`d1adf595`](https://github.com/primer/css/commit/d1adf595308afb97f83c5ca172222944189a5961) Thanks [@simurai](https://github.com/simurai)! - Make `pagination` responsive by default
14
+
15
+ ## 19.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#1737](https://github.com/primer/css/pull/1737) [`6b4089d8`](https://github.com/primer/css/commit/6b4089d8b37174ca061762c56b5e4134a54cf4ef) Thanks [@vdepizzol](https://github.com/vdepizzol)! - Adds new PageLayout component CSS with Storybook documentation
20
+
21
+ ### Patch Changes
22
+
23
+ - [#1855](https://github.com/primer/css/pull/1855) [`8f2e7534`](https://github.com/primer/css/commit/8f2e7534ecbdb3d0e773d60c725b55dc4bb263e2) Thanks [@simurai](https://github.com/simurai)! - Bump primer/primitives to `7.4.0`
24
+
25
+ * [#1869](https://github.com/primer/css/pull/1869) [`868f61a1`](https://github.com/primer/css/commit/868f61a199df14862922d52905de66cdb1e1c192) Thanks [@jdanyow](https://github.com/jdanyow)! - Minor bugfix for AvatarStack. Removing the box-shadow from the AvatarStack-body on hover.
26
+
27
+ - [#1856](https://github.com/primer/css/pull/1856) [`cbe3fb56`](https://github.com/primer/css/commit/cbe3fb56e4c7ee6bfe803eb0c15e15ab95d84157) Thanks [@langermank](https://github.com/langermank)! - ActionList item outlines for high contrast theme
28
+
29
+ * [#1870](https://github.com/primer/css/pull/1870) [`815daff9`](https://github.com/primer/css/commit/815daff9f07d8096d572cf75bee17284f36492f6) Thanks [@vdepizzol](https://github.com/vdepizzol)! - [ActionList] Add hover to `aria-current` elements and other micro interactions
30
+
31
+ ## 19.1.1
32
+
33
+ ### Patch Changes
34
+
35
+ - [#1827](https://github.com/primer/css/pull/1827) [`69e1fc53`](https://github.com/primer/css/commit/69e1fc539e4bb2fdf78d34a18fc591ebdfddd2f5) Thanks [@simurai](https://github.com/simurai)! - Support fractional viewport sizes for `max-width` media queries
36
+
37
+ * [#1803](https://github.com/primer/css/pull/1803) [`c46fe918`](https://github.com/primer/css/commit/c46fe9186efbcf6e4a482685529bdb0bda28aa9f) Thanks [@langermank](https://github.com/langermank)! - - Adds ActionList tree-view specific CSS
38
+ - Minor bug fixes for ActionList default
39
+
40
+ - [#1827](https://github.com/primer/css/pull/1827) [`69e1fc53`](https://github.com/primer/css/commit/69e1fc539e4bb2fdf78d34a18fc591ebdfddd2f5) Thanks [@simurai](https://github.com/simurai)! - Support fractional viewport sizes for the `hide` utilities
41
+
42
+ ## 19.1.0
4
43
 
5
44
  ### Minor Changes
6
45
 
7
46
  - [#1759](https://github.com/primer/css/pull/1759) [`74724ce7`](https://github.com/primer/css/commit/74724ce7c72b1cb540a9ef3d845169f1df17b55e) Thanks [@langermank](https://github.com/langermank)! - Remove `popover` responsive hack
8
47
 
48
+ * [#1807](https://github.com/primer/css/pull/1807) [`13a4654f`](https://github.com/primer/css/commit/13a4654fa0854accfaabbbd2f21d2e0a1c90442d) Thanks [@enstyled](https://github.com/enstyled)! - Marketing: Add link components
49
+ Marketing: Add animated arrow utility
50
+ Marketing: Document button components with arrows
51
+
9
52
  ### Patch Changes
10
53
 
11
- - Fake entry to force publishing
54
+ - [#1780](https://github.com/primer/css/pull/1780) [`8e9ba62d`](https://github.com/primer/css/commit/8e9ba62d30ed10c012b99dd998751df01ad6aa99) Thanks [@langermank](https://github.com/langermank)! - ActionList followup
55
+
56
+ * [#1805](https://github.com/primer/css/pull/1805) [`99537d31`](https://github.com/primer/css/commit/99537d317f04ff5474a076ab96d3ea315b2181e2) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Fix local dev (revert webpack 5.5.0 → 6.0.0)
57
+
58
+ - [#1781](https://github.com/primer/css/pull/1781) [`4d8dcf24`](https://github.com/primer/css/commit/4d8dcf24bc9e0732a9a2f34c94f6bcad7d3382dd) Thanks [@simurai](https://github.com/simurai)! - Reformat `rgba()` colors for `.btn-mktg`
12
59
 
13
- * [#1780](https://github.com/primer/css/pull/1780) [`8e9ba62d`](https://github.com/primer/css/commit/8e9ba62d30ed10c012b99dd998751df01ad6aa99) Thanks [@langermank](https://github.com/langermank)! - ActionList followup
60
+ * [#1768](https://github.com/primer/css/pull/1768) [`4abb1af9`](https://github.com/primer/css/commit/4abb1af95b9b3c8c38512fa5e1e4fae9e7d01f4f) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Marketing: Add disabled states for buttons (and tweak hover)
14
61
 
15
- - [#1805](https://github.com/primer/css/pull/1805) [`99537d31`](https://github.com/primer/css/commit/99537d317f04ff5474a076ab96d3ea315b2181e2) Thanks [@tobiasahlin](https://github.com/tobiasahlin)! - Fix local dev (revert webpack 5.5.0 → 6.0.0)
62
+ - [#1792](https://github.com/primer/css/pull/1792) [`b1c43f1f`](https://github.com/primer/css/commit/b1c43f1f8d9b07b58b275665ca69abd5d4f7a5fc) Thanks [@simurai](https://github.com/simurai)! - Use `counter-border` for LHC
16
63
 
17
- * [#1781](https://github.com/primer/css/pull/1781) [`4d8dcf24`](https://github.com/primer/css/commit/4d8dcf24bc9e0732a9a2f34c94f6bcad7d3382dd) Thanks [@simurai](https://github.com/simurai)! - Reformat `rgba()` colors for `.btn-mktg`
64
+ * [#1808](https://github.com/primer/css/pull/1808) [`ee27583f`](https://github.com/primer/css/commit/ee27583f594248bd44122ea5dc81b12382c02b09) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Add hover and active states to btn-invisible
18
65
 
19
- - [#1808](https://github.com/primer/css/pull/1808) [`ee27583f`](https://github.com/primer/css/commit/ee27583f594248bd44122ea5dc81b12382c02b09) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Add hover and active states to btn-invisible
66
+ - [#1818](https://github.com/primer/css/pull/1818) [`22c29e7a`](https://github.com/primer/css/commit/22c29e7a8b1b6a0df1dd61d400cc0dd132e0c909) Thanks [@vdepizzol](https://github.com/vdepizzol)! - [Layout component] Avoid resizing `main` while loading
20
67
 
21
68
  ## 19.0.0
22
69
 
@@ -1,3 +1,5 @@
1
+ // stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors
2
+
1
3
  @mixin focusOutline {
2
4
  position: relative;
3
5
  z-index: 1;
@@ -22,6 +24,8 @@
22
24
  list-style: none;
23
25
  background-color: transparent;
24
26
  border-radius: $border-radius;
27
+ touch-action: manipulation;
28
+ -webkit-tap-highlight-color: transparent;
25
29
 
26
30
  &:hover,
27
31
  &:active {
@@ -34,40 +38,64 @@
34
38
  }
35
39
 
36
40
  // 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
+ &:not(.ActionList-item--hasSubItem),
42
+ // target contents of first child li if sub-item (li wraps item label + nested ul)
43
+ &.ActionList-item--hasSubItem > .ActionList-content {
44
+ @media (hover: hover) {
45
+ &:hover {
46
+ cursor: pointer;
47
+ background-color: var(--color-action-list-item-default-hover-bg);
48
+
49
+ &:not(.ActionList-item--navActive) {
50
+ // Support for "Windows high contrast mode"
51
+ outline: $border-style $border-width transparent;
52
+ outline-offset: -$border-width;
53
+ // stylelint-disable-next-line primer/box-shadow
54
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
55
+ }
56
+ }
41
57
  }
42
58
 
43
59
  &:active {
44
60
  background: var(--color-action-list-item-default-active-bg);
45
61
 
62
+ &:not(.ActionList-item--navActive) {
63
+ // Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/
64
+ outline: $border-style $border-width transparent;
65
+ outline-offset: -$border-width;
66
+ // stylelint-disable-next-line primer/box-shadow
67
+ box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border);
68
+ }
69
+
46
70
  @media screen and (prefers-reduced-motion: no-preference) {
47
71
  animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
48
72
  }
49
73
 
50
- // stylelint-disable primer/box-shadow
51
74
  @keyframes ActionList-item-active-bg {
52
- // stylelint-disable-next-line max-nesting-depth
53
75
  50% {
54
- box-shadow: inset 0 0 0 rgba(#000, 0.04);
76
+ // stylelint-disable-next-line primer/box-shadow
77
+ box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4);
55
78
  transform: scale(1);
56
79
  }
57
80
 
58
- // stylelint-disable-next-line max-nesting-depth
59
81
  100% {
60
- box-shadow: inset 0 3px 9px rgba(#000, 0.04);
61
82
  transform: scale(0.97);
62
83
  }
63
84
  }
64
- // stylelint-enable primer/box-shadow
65
85
  }
66
86
 
67
- &:hover,
87
+ // hide dividers
88
+
89
+ @media (hover: hover) {
90
+ &:hover {
91
+ .ActionList-item-label::before,
92
+ + .ActionList-item .ActionList-item-label::before {
93
+ visibility: hidden;
94
+ }
95
+ }
96
+ }
97
+ // stylelint-disable-next-line no-duplicate-selectors
68
98
  &:active {
69
- // hide dividers
70
- // stylelint-disable-next-line selector-max-specificity
71
99
  .ActionList-item-label::before,
72
100
  + .ActionList-item .ActionList-item-label::before {
73
101
  visibility: hidden;
@@ -80,8 +108,16 @@
80
108
  &.ActionList-item--hasSubItem {
81
109
  // first child
82
110
  > .ActionList-content {
83
- &:hover {
84
- background-color: var(--color-action-list-item-default-hover-bg);
111
+ z-index: 1;
112
+
113
+ @media (hover: hover) {
114
+ &:hover {
115
+ background-color: var(--color-action-list-item-default-hover-bg);
116
+ }
117
+ }
118
+
119
+ &:active {
120
+ background-color: var(--color-action-list-item-default-active-bg);
85
121
  }
86
122
  }
87
123
  }
@@ -98,7 +134,12 @@
98
134
  &:not(.ActionList-item--danger) {
99
135
  background: var(--color-action-list-item-default-selected-bg);
100
136
 
101
- // stylelint-disable-next-line selector-max-specificity
137
+ @media (hover: hover) {
138
+ &:hover {
139
+ background-color: var(--color-action-list-item-default-hover-bg);
140
+ }
141
+ }
142
+
102
143
  &::before,
103
144
  + .ActionList-item::before {
104
145
  visibility: hidden;
@@ -113,6 +154,41 @@
113
154
 
114
155
  // collapsible item [aria-expanded]
115
156
 
157
+ // nesting (single level)
158
+ // target items inside expanded subgroups
159
+ &[aria-expanded] {
160
+ .ActionList--subGroup {
161
+ @media screen and (prefers-reduced-motion: no-preference) {
162
+ transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1);
163
+ }
164
+
165
+ .ActionList-content {
166
+ padding-left: $spacer-4;
167
+ }
168
+ }
169
+
170
+ // has 16px leading visual
171
+ .ActionList-content--visual16 + .ActionList--subGroup {
172
+ .ActionList-content {
173
+ padding-left: $spacer-5;
174
+ }
175
+ }
176
+
177
+ // has 20px leading visual
178
+ .ActionList-content--visual20 + .ActionList--subGroup {
179
+ .ActionList-content {
180
+ padding-left: $spacer-2 * 4.5; // 36px
181
+ }
182
+ }
183
+
184
+ // has 24px leading visual
185
+ .ActionList-content--visual24 + .ActionList--subGroup {
186
+ .ActionList-content {
187
+ padding-left: $spacer-6;
188
+ }
189
+ }
190
+ }
191
+
116
192
  &[aria-expanded='true'] {
117
193
  .ActionList-item-collapseIcon {
118
194
  transition: transform 120ms linear;
@@ -120,11 +196,14 @@
120
196
  }
121
197
 
122
198
  .ActionList--subGroup {
123
- display: block;
199
+ height: auto;
200
+ overflow: visible;
201
+ visibility: visible;
202
+ opacity: 1;
203
+ transform: translateY(0);
124
204
  }
125
205
 
126
206
  &.ActionList-item--hasActiveSubItem {
127
- // stylelint-disable-next-line selector-max-specificity
128
207
  > .ActionList-content > .ActionList-item-label {
129
208
  font-weight: $font-weight-bold;
130
209
  }
@@ -138,7 +217,11 @@
138
217
  }
139
218
 
140
219
  .ActionList--subGroup {
141
- display: none;
220
+ height: 0;
221
+ overflow: hidden;
222
+ visibility: hidden;
223
+ opacity: 0;
224
+ transform: translateY(-$spacer-3);
142
225
  }
143
226
 
144
227
  // show active indicator on parent collapse if child is active
@@ -149,7 +232,6 @@
149
232
  font-weight: $font-weight-bold;
150
233
  }
151
234
 
152
- // stylelint-disable-next-line selector-max-specificity
153
235
  &::before,
154
236
  + .ActionList-item::before {
155
237
  visibility: hidden;
@@ -204,7 +286,7 @@
204
286
  visibility: hidden;
205
287
  opacity: 0;
206
288
  transition:
207
- visibility 0 linear $actionList-item-checkmark-transition-timing,
289
+ visibility 0 linear $actionList-item-checkmark-transition-timing,
208
290
  opacity $actionList-item-checkmark-transition-timing;
209
291
  }
210
292
 
@@ -266,11 +348,10 @@
266
348
  color: var(--color-danger-fg);
267
349
  }
268
350
 
269
- @media (hover: hover) and (pointer: fine) {
351
+ @media (hover: hover) {
270
352
  &:hover {
271
353
  background: var(--color-action-list-item-danger-hover-bg);
272
354
 
273
- // stylelint-disable-next-line max-nesting-depth
274
355
  .ActionList-item-label {
275
356
  color: var(--color-action-list-item-danger-hover-text);
276
357
  }
@@ -293,7 +374,7 @@
293
374
  fill: var(--color-primer-fg-disabled);
294
375
  }
295
376
 
296
- @media (hover: hover) and (pointer: fine) {
377
+ @media (hover: hover) {
297
378
  &:hover {
298
379
  cursor: not-allowed;
299
380
  background-color: transparent;
@@ -314,15 +395,17 @@
314
395
  display: grid;
315
396
  // stylelint-disable-next-line primer/spacing
316
397
  padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
398
+ font-size: $body-font-size;
317
399
  font-weight: $font-weight-normal;
318
400
  color: var(--color-fg-default);
319
401
  user-select: none;
402
+ touch-action: manipulation;
320
403
  border-radius: $border-radius;
321
404
  transition: $actionList-item-bg-transition;
322
405
  grid-template-rows: min-content;
323
406
  grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
324
- grid-template-columns: min-content min-content minmax(min-content, auto) min-content min-content;
325
- align-items: center;
407
+ grid-template-columns: min-content min-content minmax(0, auto) min-content min-content;
408
+ align-items: start;
326
409
 
327
410
  // column-gap persists with empty grid-areas, margin applies only when children exist
328
411
  > :not(:last-child) {
@@ -347,6 +430,10 @@
347
430
  padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
348
431
  }
349
432
 
433
+ &.ActionList-content--fontSmall {
434
+ font-size: $font-size-small;
435
+ }
436
+
350
437
  // On pointer:coarse (mobile), all list items are large
351
438
  @media (pointer: coarse) {
352
439
  // stylelint-disable-next-line primer/spacing
@@ -440,37 +527,16 @@
440
527
  color: var(--color-fg-default);
441
528
  }
442
529
 
530
+ .ActionList-item-label--truncate {
531
+ overflow: hidden;
532
+ text-overflow: ellipsis;
533
+ white-space: nowrap;
534
+ }
535
+
443
536
  // nested lists (only supports 1 level currently)
444
537
  // target ActionList-item--subItem for padding-left to maintain :active :after state
445
538
 
539
+ // TODO: remove with PVC implementation
446
540
  .ActionList-item--subItem > .ActionList-content {
447
541
  font-size: $font-size-small;
448
542
  }
449
-
450
- // no leading visual
451
- .ActionList--subGroup {
452
- .ActionList-item--subItem {
453
- padding-left: $spacer-3;
454
- }
455
- }
456
-
457
- // has 16px leading visual
458
- .ActionList-content--visual16 + .ActionList--subGroup {
459
- .ActionList-item--subItem {
460
- padding-left: $spacer-4;
461
- }
462
- }
463
-
464
- // has 20px leading visual
465
- .ActionList-content--visual20 + .ActionList--subGroup {
466
- .ActionList-item--subItem {
467
- padding-left: $spacer-3 * 1.75;
468
- }
469
- }
470
-
471
- // has 24px leading visual
472
- .ActionList-content--visual24 + .ActionList--subGroup {
473
- .ActionList-item--subItem {
474
- padding-left: $spacer-5;
475
- }
476
- }
@@ -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
+ }
@@ -1,5 +1,6 @@
1
1
  @import '../support/index.scss';
2
2
  @import './action-list-variables.scss';
3
3
  @import './action-list.scss';
4
+ @import './action-list-tree.scss';
4
5
  @import './action-list-item.scss';
5
6
  @import './action-list-item-divider.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;
@@ -36,6 +36,7 @@
36
36
  border-right: $border-width $border-style var(--color-canvas-default);
37
37
  // stylelint-disable-next-line primer/borders
38
38
  border-radius: $border-radius-1;
39
+ box-shadow: none;
39
40
  transition: margin 0.1s ease-in-out;
40
41
 
41
42
  &:first-child {
package/base/base.scss CHANGED
@@ -46,6 +46,7 @@ hr,
46
46
  background: transparent;
47
47
  border: 0;
48
48
  border-bottom: $border-width $border-style var(--color-border-muted);
49
+
49
50
  @include clearfix();
50
51
  }
51
52
 
package/base/index.scss CHANGED
@@ -1,5 +1,4 @@
1
1
  @import '../support/index.scss';
2
-
3
2
  @import './normalize.scss';
4
3
  @import './base.scss';
5
4
  @import './kbd.scss';
@@ -1,3 +1,2 @@
1
1
  @import '../support/index.scss';
2
-
3
2
  @import './blankslate.scss';
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  .breadcrumb-item-selected,
24
- .breadcrumb-item[aria-current]:not([aria-current=false]) {
24
+ .breadcrumb-item[aria-current]:not([aria-current='false']) {
25
25
  &::after {
26
26
  content: none;
27
27
  }
@@ -6,6 +6,7 @@
6
6
  .BtnGroup {
7
7
  display: inline-block;
8
8
  vertical-align: middle;
9
+
9
10
  @include clearfix();
10
11
 
11
12
  // Proper spacing for multiple button groups (a la, gollum editor)
@@ -33,7 +34,7 @@
33
34
  }
34
35
 
35
36
  &.selected,
36
- &[aria-selected=true],
37
+ &[aria-selected='true'],
37
38
  &:focus,
38
39
  &:active,
39
40
  &:hover {
@@ -66,7 +67,7 @@
66
67
  }
67
68
 
68
69
  &.selected,
69
- &[aria-selected=true],
70
+ &[aria-selected='true'],
70
71
  &:focus,
71
72
  &:active,
72
73
  &:hover {
@@ -310,38 +310,3 @@
310
310
  width: 100%;
311
311
  text-align: center;
312
312
  }
313
-
314
- // Icon-only buttons
315
- // default mobile sizing
316
- .btn--icon {
317
- display: grid;
318
- width: 32px;
319
- height: 32px;
320
- padding: 0;
321
- place-content: center;
322
- }
323
-
324
- .btn--icon-sm {
325
- width: 28px;
326
- height: 28px;
327
-
328
- .octicon {
329
- width: 14px;
330
- height: 14px;
331
- }
332
- }
333
-
334
- .btn--icon-lg {
335
- width: 40px;
336
- height: 40px;
337
- }
338
-
339
- // desktop friendly sizing
340
- @media (pointer: course) {
341
- .btn--icon {
342
- &::before {
343
- @include minTouchTarget(48px, 48px);
344
- background: deeppink !important;
345
- }
346
- }
347
- }
package/buttons/misc.scss CHANGED
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  &:disabled,
24
- &[aria-disabled=true] {
24
+ &[aria-disabled='true'] {
25
25
  &,
26
26
  &:hover {
27
27
  color: var(--color-primer-fg-disabled);
@@ -50,7 +50,7 @@
50
50
  &:active,
51
51
  &:focus,
52
52
  &.selected,
53
- &[aria-selected=true],
53
+ &[aria-selected='true'],
54
54
  &.zeroclipboard-is-active {
55
55
  color: var(--color-accent-fg);
56
56
  background-color: none;
@@ -59,20 +59,19 @@
59
59
  box-shadow: var(--color-btn-focus-shadow);
60
60
  }
61
61
 
62
- &:active
63
- &.zeroclipboard-is-active {
62
+ &:active &.zeroclipboard-is-active {
64
63
  background-color: var(--color-btn-selected-bg);
65
64
  }
66
65
 
67
66
  &:disabled,
68
67
  &.disabled,
69
- &[aria-disabled=true] {
68
+ &[aria-disabled='true'] {
70
69
  color: var(--color-primer-fg-disabled);
71
70
  background-color: transparent;
72
71
  }
73
72
  }
74
73
 
75
- // Octicon button (deprecated)
74
+ // Octicon button
76
75
  //
77
76
  // Icon-only buttons
78
77
  .btn-octicon {
@@ -93,7 +92,7 @@
93
92
  &:hover { color: var(--color-accent-fg); }
94
93
 
95
94
  &.disabled,
96
- &[aria-disabled=true] {
95
+ &[aria-disabled='true'] {
97
96
  color: var(--color-primer-fg-disabled);
98
97
  cursor: default;
99
98
 
@@ -2,9 +2,21 @@
2
2
  // Enables color modes for native elements
3
3
 
4
4
  @include color-mode(light) { color-scheme: light; }
5
+
5
6
  @include color-mode(dark) { color-scheme: dark; }
6
7
 
7
8
  [data-color-mode] {
8
9
  color: var(--color-fg-default);
9
10
  background-color: var(--color-canvas-default);
10
11
  }
12
+
13
+ // Windows High Contrast mode
14
+
15
+ // Improves focus state for various components when Windows High Contrast mode is enabled
16
+ // stylelint-disable selector-max-type
17
+ @media (forced-colors: active) {
18
+ body {
19
+ --color-accent-emphasis: Highlight;
20
+ --color-fg-on-emphasis: LinkText;
21
+ }
22
+ }
@@ -1,5 +1,4 @@
1
1
  @import '../../support/index.scss';
2
-
3
2
  @import '@primer/primitives/dist/scss/colors/_dark.scss';
4
3
 
5
4
  @include color-mode-theme(dark) {