@primer/css 0.0.0-1f8274f → 0.0.0-2021101020130

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 (367) hide show
  1. package/CHANGELOG.md +1197 -133
  2. package/CODE_OF_CONDUCT.md +1 -1
  3. package/CONTRIBUTING.md +85 -0
  4. package/DEVELOP.md +11 -50
  5. package/LICENSE +1 -1
  6. package/README.md +13 -15
  7. package/RELEASING.md +5 -72
  8. package/actionlist/action-list-item-divider.scss +42 -0
  9. package/actionlist/action-list-item.scss +439 -0
  10. package/actionlist/action-list-variables.scss +8 -0
  11. package/actionlist/action-list.scss +33 -0
  12. package/actionlist/index.scss +5 -0
  13. package/alerts/README.md +11 -22
  14. package/alerts/flash.scss +91 -21
  15. package/alerts/index.scss +2 -2
  16. package/autocomplete/README.md +25 -0
  17. package/autocomplete/autocomplete.scss +58 -0
  18. package/autocomplete/index.scss +4 -0
  19. package/autocomplete/suggester.scss +92 -0
  20. package/avatars/README.md +11 -23
  21. package/avatars/avatar-parent-child.scss +4 -3
  22. package/avatars/avatar-stack.scss +21 -13
  23. package/avatars/avatar.scss +31 -3
  24. package/avatars/circle-badge.scss +5 -4
  25. package/avatars/index.scss +5 -5
  26. package/base/README.md +11 -22
  27. package/base/base.scss +40 -6
  28. package/base/index.scss +6 -4
  29. package/base/kbd.scss +20 -0
  30. package/base/normalize.scss +17 -57
  31. package/base/octicons.scss +6 -0
  32. package/base/typography-base.scss +2 -0
  33. package/blankslate/README.md +11 -23
  34. package/blankslate/blankslate.scss +25 -12
  35. package/blankslate/index.scss +2 -2
  36. package/box/README.md +11 -23
  37. package/box/box.scss +52 -44
  38. package/box/index.scss +2 -2
  39. package/branch-name/README.md +11 -23
  40. package/branch-name/branch-name.scss +18 -8
  41. package/branch-name/index.scss +2 -2
  42. package/breadcrumb/README.md +17 -13
  43. package/breadcrumb/breadcrumb.scss +15 -5
  44. package/breadcrumb/index.scss +2 -2
  45. package/buttons/README.md +11 -23
  46. package/buttons/button-group.scss +2 -0
  47. package/buttons/button.scss +218 -144
  48. package/buttons/index.scss +4 -3
  49. package/buttons/misc.scss +212 -0
  50. package/color-modes/index.scss +9 -0
  51. package/color-modes/native.scss +10 -0
  52. package/color-modes/themes/dark.scss +7 -0
  53. package/color-modes/themes/dark_colorblind.scss +7 -0
  54. package/color-modes/themes/dark_dimmed.scss +7 -0
  55. package/color-modes/themes/dark_high_contrast.scss +7 -0
  56. package/color-modes/themes/light.scss +7 -0
  57. package/color-modes/themes/light_colorblind.scss +7 -0
  58. package/core/README.md +11 -23
  59. package/core/index.scss +19 -20
  60. package/deprecations.js +24 -0
  61. package/deprecations.json +539 -0
  62. package/dist/actionlist.css +2 -0
  63. package/dist/actionlist.css.map +1 -0
  64. package/dist/actionlist.js +1 -0
  65. package/dist/alerts.css +1 -2
  66. package/dist/alerts.css.map +1 -1
  67. package/dist/alerts.js +1 -1
  68. package/dist/autocomplete.css +2 -0
  69. package/dist/autocomplete.css.map +1 -0
  70. package/dist/autocomplete.js +1 -0
  71. package/dist/avatars.css +1 -2
  72. package/dist/avatars.css.map +1 -1
  73. package/dist/avatars.js +1 -1
  74. package/dist/base.css +1 -2
  75. package/dist/base.css.map +1 -1
  76. package/dist/base.js +1 -1
  77. package/dist/blankslate.css +1 -2
  78. package/dist/blankslate.css.map +1 -1
  79. package/dist/blankslate.js +1 -1
  80. package/dist/box.css +1 -2
  81. package/dist/box.css.map +1 -1
  82. package/dist/box.js +1 -1
  83. package/dist/branch-name.css +1 -2
  84. package/dist/branch-name.css.map +1 -1
  85. package/dist/branch-name.js +1 -1
  86. package/dist/breadcrumb.css +1 -2
  87. package/dist/breadcrumb.css.map +1 -1
  88. package/dist/breadcrumb.js +1 -1
  89. package/dist/buttons.css +1 -2
  90. package/dist/buttons.css.map +1 -1
  91. package/dist/buttons.js +1 -1
  92. package/dist/color-modes.css +2 -0
  93. package/dist/color-modes.css.map +1 -0
  94. package/dist/color-modes.js +1 -0
  95. package/dist/core.css +3 -4
  96. package/dist/core.css.map +1 -1
  97. package/dist/core.js +1 -1
  98. package/dist/deprecations.json +539 -0
  99. package/dist/dropdown.css +2 -0
  100. package/dist/dropdown.css.map +1 -0
  101. package/dist/dropdown.js +1 -0
  102. package/dist/forms.css +1 -2
  103. package/dist/forms.css.map +1 -1
  104. package/dist/forms.js +1 -1
  105. package/dist/header.css +2 -0
  106. package/dist/header.css.map +1 -0
  107. package/dist/header.js +1 -0
  108. package/dist/labels.css +1 -2
  109. package/dist/labels.css.map +1 -1
  110. package/dist/labels.js +1 -1
  111. package/dist/layout.css +1 -2
  112. package/dist/layout.css.map +1 -1
  113. package/dist/layout.js +1 -1
  114. package/dist/links.css +2 -0
  115. package/dist/links.css.map +1 -0
  116. package/dist/links.js +1 -0
  117. package/dist/loaders.css +2 -0
  118. package/dist/loaders.css.map +1 -0
  119. package/dist/loaders.js +1 -0
  120. package/dist/markdown.css +1 -2
  121. package/dist/markdown.css.map +1 -1
  122. package/dist/markdown.js +1 -1
  123. package/dist/marketing-buttons.css +1 -2
  124. package/dist/marketing-buttons.css.map +1 -1
  125. package/dist/marketing-buttons.js +1 -1
  126. package/dist/marketing-support.css +1 -2
  127. package/dist/marketing-support.js +1 -1
  128. package/dist/marketing-type.css +1 -2
  129. package/dist/marketing-type.css.map +1 -1
  130. package/dist/marketing-type.js +1 -1
  131. package/dist/marketing-utilities.css +1 -2
  132. package/dist/marketing-utilities.css.map +1 -1
  133. package/dist/marketing-utilities.js +1 -1
  134. package/dist/marketing.css +3 -4
  135. package/dist/marketing.css.map +1 -1
  136. package/dist/marketing.js +1 -1
  137. package/dist/meta.json +325 -282
  138. package/dist/navigation.css +1 -2
  139. package/dist/navigation.css.map +1 -1
  140. package/dist/navigation.js +1 -1
  141. package/dist/pagination.css +1 -2
  142. package/dist/pagination.css.map +1 -1
  143. package/dist/pagination.js +1 -1
  144. package/dist/popover.css +1 -2
  145. package/dist/popover.css.map +1 -1
  146. package/dist/popover.js +1 -1
  147. package/dist/primer.css +13 -14
  148. package/dist/primer.css.map +1 -1
  149. package/dist/primer.js +1 -1
  150. package/dist/product.css +3 -4
  151. package/dist/product.css.map +1 -1
  152. package/dist/product.js +1 -1
  153. package/dist/progress.css +1 -2
  154. package/dist/progress.css.map +1 -1
  155. package/dist/progress.js +1 -1
  156. package/dist/select-menu.css +2 -0
  157. package/dist/select-menu.css.map +1 -0
  158. package/dist/select-menu.js +1 -0
  159. package/dist/stats/actionlist.json +1 -0
  160. package/dist/stats/alerts.json +1 -1
  161. package/dist/stats/autocomplete.json +1 -0
  162. package/dist/stats/avatars.json +1 -1
  163. package/dist/stats/base.json +1 -1
  164. package/dist/stats/blankslate.json +1 -1
  165. package/dist/stats/box.json +1 -1
  166. package/dist/stats/branch-name.json +1 -1
  167. package/dist/stats/breadcrumb.json +1 -1
  168. package/dist/stats/buttons.json +1 -1
  169. package/dist/stats/color-modes.json +1 -0
  170. package/dist/stats/core.json +1 -1
  171. package/dist/stats/dropdown.json +1 -0
  172. package/dist/stats/forms.json +1 -1
  173. package/dist/stats/header.json +1 -0
  174. package/dist/stats/labels.json +1 -1
  175. package/dist/stats/layout.json +1 -1
  176. package/dist/stats/links.json +1 -0
  177. package/dist/stats/loaders.json +1 -0
  178. package/dist/stats/markdown.json +1 -1
  179. package/dist/stats/marketing-buttons.json +1 -1
  180. package/dist/stats/marketing-support.json +1 -1
  181. package/dist/stats/marketing-type.json +1 -1
  182. package/dist/stats/marketing-utilities.json +1 -1
  183. package/dist/stats/marketing.json +1 -1
  184. package/dist/stats/navigation.json +1 -1
  185. package/dist/stats/pagination.json +1 -1
  186. package/dist/stats/popover.json +1 -1
  187. package/dist/stats/primer.json +1 -1
  188. package/dist/stats/product.json +1 -1
  189. package/dist/stats/progress.json +1 -1
  190. package/dist/stats/select-menu.json +1 -0
  191. package/dist/stats/subhead.json +1 -1
  192. package/dist/stats/support.json +1 -1
  193. package/dist/stats/table-object.json +1 -1
  194. package/dist/stats/timeline.json +1 -0
  195. package/dist/stats/toasts.json +1 -0
  196. package/dist/stats/tooltips.json +1 -1
  197. package/dist/stats/truncate.json +1 -1
  198. package/dist/stats/utilities.json +1 -1
  199. package/dist/subhead.css +1 -2
  200. package/dist/subhead.css.map +1 -1
  201. package/dist/subhead.js +1 -1
  202. package/dist/support.css +1 -1
  203. package/dist/support.js +1 -1
  204. package/dist/table-object.css +0 -1
  205. package/dist/table-object.css.map +1 -1
  206. package/dist/table-object.js +1 -1
  207. package/dist/timeline.css +2 -0
  208. package/dist/timeline.css.map +1 -0
  209. package/dist/timeline.js +1 -0
  210. package/dist/toasts.css +2 -0
  211. package/dist/toasts.css.map +1 -0
  212. package/dist/toasts.js +1 -0
  213. package/dist/tooltips.css +1 -2
  214. package/dist/tooltips.css.map +1 -1
  215. package/dist/tooltips.js +1 -1
  216. package/dist/truncate.css +1 -2
  217. package/dist/truncate.css.map +1 -1
  218. package/dist/truncate.js +1 -1
  219. package/dist/utilities.css +1 -2
  220. package/dist/utilities.css.map +1 -1
  221. package/dist/utilities.js +1 -1
  222. package/dist/variables.json +1352 -0
  223. package/dropdown/README.md +25 -0
  224. package/dropdown/dropdown.scss +270 -0
  225. package/dropdown/index.scss +2 -0
  226. package/forms/README.md +11 -23
  227. package/forms/form-control.scss +73 -37
  228. package/forms/form-group.scss +83 -46
  229. package/forms/form-select.scss +17 -5
  230. package/forms/form-validation.scss +51 -32
  231. package/forms/index.scss +7 -6
  232. package/forms/input-group.scss +10 -0
  233. package/forms/radio-group.scss +62 -0
  234. package/header/README.md +25 -0
  235. package/header/header.scss +47 -0
  236. package/header/index.scss +2 -0
  237. package/index.scss +7 -4
  238. package/labels/README.md +11 -23
  239. package/labels/counters.scss +24 -13
  240. package/labels/diffstat.scss +37 -0
  241. package/labels/index.scss +8 -4
  242. package/labels/issue-labels.scss +23 -0
  243. package/labels/labels.scss +59 -40
  244. package/labels/mixins.scss +32 -0
  245. package/labels/states.scss +40 -19
  246. package/layout/README.md +11 -23
  247. package/layout/container.scss +0 -8
  248. package/layout/grid-offset.scss +11 -11
  249. package/layout/grid.scss +23 -23
  250. package/layout/index.scss +7 -5
  251. package/layout/layout.scss +185 -0
  252. package/layout/mixins.scss +79 -0
  253. package/links/README.md +25 -0
  254. package/links/index.scss +3 -0
  255. package/links/link.scss +55 -0
  256. package/loaders/README.md +25 -0
  257. package/loaders/index.scss +2 -0
  258. package/loaders/loaders.scss +19 -0
  259. package/markdown/README.md +11 -23
  260. package/markdown/blob-csv.scss +4 -2
  261. package/markdown/code.scss +11 -3
  262. package/markdown/footnotes.scss +37 -0
  263. package/markdown/headings.scss +13 -4
  264. package/markdown/images.scss +15 -4
  265. package/markdown/index.scss +9 -8
  266. package/markdown/lists.scss +19 -5
  267. package/markdown/markdown-body.scss +15 -18
  268. package/markdown/tables.scss +8 -5
  269. package/marketing/README.md +11 -23
  270. package/marketing/buttons/button.scss +82 -61
  271. package/marketing/index.scss +6 -11
  272. package/marketing/support/index.scss +1 -0
  273. package/marketing/support/mixins.scss +66 -0
  274. package/marketing/support/variables.scss +110 -51
  275. package/marketing/type/typography.scss +100 -62
  276. package/marketing/utilities/animations.scss +9 -0
  277. package/marketing/utilities/filters.scss +0 -1
  278. package/marketing/utilities/index.scss +2 -3
  279. package/marketing/utilities/layout.scss +32 -11
  280. package/navigation/README.md +11 -23
  281. package/navigation/filter-list.scss +16 -14
  282. package/navigation/index.scss +7 -6
  283. package/navigation/menu.scss +42 -35
  284. package/navigation/sidenav.scss +99 -0
  285. package/navigation/subnav.scss +28 -21
  286. package/navigation/tabnav.scss +45 -21
  287. package/navigation/underline-nav.scss +36 -22
  288. package/package.json +78 -101
  289. package/pagination/README.md +12 -14
  290. package/pagination/index.scss +2 -2
  291. package/pagination/pagination.scss +61 -37
  292. package/popover/README.md +11 -24
  293. package/popover/index.scss +2 -2
  294. package/popover/popover.scss +18 -9
  295. package/postcss.config.cjs +22 -0
  296. package/prettier.config.cjs +1 -0
  297. package/product/README.md +11 -23
  298. package/product/index.scss +19 -17
  299. package/progress/README.md +11 -23
  300. package/progress/index.scss +2 -2
  301. package/progress/progress.scss +11 -1
  302. package/select-menu/README.md +25 -0
  303. package/select-menu/index.scss +3 -0
  304. package/select-menu/select-menu.scss +464 -0
  305. package/stylelint.config.cjs +16 -0
  306. package/subhead/README.md +11 -25
  307. package/subhead/index.scss +2 -2
  308. package/subhead/subhead.scss +10 -4
  309. package/support/README.md +12 -18
  310. package/support/index.scss +7 -8
  311. package/support/mixins/color-modes.scss +106 -0
  312. package/support/mixins/misc.scss +19 -13
  313. package/support/mixins/typography.scss +1 -1
  314. package/support/variables/layout.scss +104 -11
  315. package/support/variables/misc.scss +7 -30
  316. package/support/variables/typography.scss +4 -4
  317. package/table-object/README.md +11 -24
  318. package/table-object/index.scss +1 -1
  319. package/timeline/README.md +25 -0
  320. package/timeline/index.scss +2 -0
  321. package/timeline/timeline-item.scss +95 -0
  322. package/toasts/README.md +25 -0
  323. package/toasts/index.scss +2 -0
  324. package/toasts/toasts.scss +127 -0
  325. package/tooltips/README.md +11 -24
  326. package/tooltips/index.scss +2 -2
  327. package/tooltips/tooltips.scss +17 -8
  328. package/truncate/README.md +11 -24
  329. package/truncate/index.scss +2 -1
  330. package/truncate/truncate.scss +41 -7
  331. package/utilities/README.md +11 -23
  332. package/utilities/animations.scss +14 -2
  333. package/utilities/borders.scss +14 -58
  334. package/utilities/box-shadow.scss +8 -9
  335. package/utilities/colors.scss +71 -116
  336. package/utilities/details.scss +24 -4
  337. package/utilities/flexbox.scss +11 -16
  338. package/utilities/index.scss +12 -12
  339. package/utilities/layout.scss +23 -15
  340. package/utilities/margin.scss +34 -17
  341. package/utilities/padding.scss +13 -9
  342. package/utilities/typography.scss +54 -25
  343. package/utilities/visibility-display.scss +0 -13
  344. package/.browserslistrc +0 -6
  345. package/.eslintrc.json +0 -13
  346. package/.stylelintrc.json +0 -9
  347. package/MIGRATING.md +0 -70
  348. package/bin/primer-migrate +0 -86
  349. package/build/build.css +0 -23
  350. package/build/build.json +0 -1
  351. package/build/index.js +0 -1
  352. package/dist/marketing-support.css.map +0 -1
  353. package/dist/support.css.map +0 -1
  354. package/fonts/Inter-Medium.woff +0 -0
  355. package/fonts/Inter-Regular.woff +0 -0
  356. package/layout/columns.scss +0 -56
  357. package/marketing/buttons/README.md +0 -39
  358. package/marketing/support/README.md +0 -31
  359. package/marketing/type/README.md +0 -39
  360. package/marketing/utilities/README.md +0 -36
  361. package/marketing/utilities/margin.scss +0 -18
  362. package/marketing/utilities/padding.scss +0 -28
  363. package/postcss.config.js +0 -14
  364. package/prettier.config.js +0 -1
  365. package/support/mixins/buttons.scss +0 -160
  366. package/support/variables/color-system.scss +0 -243
  367. package/support/variables/colors.scss +0 -70
@@ -0,0 +1,439 @@
1
+ // <li>
2
+ .ActionList-item {
3
+ position: relative;
4
+ list-style: none;
5
+ background-color: transparent;
6
+ border-radius: $border-radius;
7
+
8
+ &:hover,
9
+ &:active {
10
+ cursor: pointer;
11
+
12
+ // a href
13
+ .ActionList-content {
14
+ text-decoration: none;
15
+ }
16
+ }
17
+
18
+ // li only: focus-visible, a href: focus-within on li
19
+ &:focus-visible,
20
+ &:focus-within {
21
+ @include focusOutline;
22
+ }
23
+
24
+ // only hover li without list as children
25
+ &:not(.ActionList-item--hasSubItem) {
26
+ &:hover {
27
+ cursor: pointer;
28
+ background-color: var(--color-action-list-item-default-hover-bg);
29
+ }
30
+
31
+ &:active {
32
+ background: var(--color-action-list-item-default-active-bg);
33
+
34
+ @media screen and (prefers-reduced-motion: no-preference) {
35
+ animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
36
+ }
37
+
38
+ // stylelint-disable primer/box-shadow
39
+ @keyframes ActionList-item-active-bg {
40
+ // stylelint-disable-next-line max-nesting-depth
41
+ 50% {
42
+ box-shadow: inset 0 0 0 rgba(#000, 0.04);
43
+ transform: scale(1);
44
+ }
45
+
46
+ // stylelint-disable-next-line max-nesting-depth
47
+ 100% {
48
+ box-shadow: inset 0 3px 9px rgba(#000, 0.04);
49
+ transform: scale(0.97);
50
+ }
51
+ }
52
+ // stylelint-enable primer/box-shadow
53
+ }
54
+
55
+ &:hover,
56
+ &:active {
57
+ // hide dividers
58
+ // stylelint-disable-next-line selector-max-specificity
59
+ .ActionList-item-label::before,
60
+ + .ActionList-item .ActionList-item-label::before {
61
+ visibility: hidden;
62
+ }
63
+ }
64
+ }
65
+
66
+ // target contents of li if sub-item (li wraps item label + nested ul)
67
+ // collapse styles here
68
+ &.ActionList-item--hasSubItem {
69
+ // first child
70
+ > .ActionList-content {
71
+ &:hover {
72
+ background-color: var(--color-action-list-item-default-hover-bg);
73
+ }
74
+ }
75
+ }
76
+
77
+ // active state [aria-current]
78
+
79
+ &.ActionList-item--navActive:not(.ActionList-item--danger) {
80
+ background: var(--color-action-list-item-default-selected-bg);
81
+
82
+ // stylelint-disable-next-line selector-max-specificity
83
+ &::before,
84
+ + .ActionList-item::before {
85
+ visibility: hidden;
86
+ }
87
+
88
+ // blue accent line
89
+ &::after {
90
+ position: absolute;
91
+ top: calc(50% - 12px);
92
+ left: -$actionList-item-padding-horizontal;
93
+ width: $spacer-1;
94
+ height: $spacer-4;
95
+ content: '';
96
+ background: var(--color-accent-fg);
97
+ border-radius: $border-radius;
98
+ }
99
+ }
100
+
101
+ // collapsible item [aria-expanded]
102
+
103
+ &[aria-expanded='true'] {
104
+ .ActionList-item-collapseIcon {
105
+ transition: transform 120ms linear;
106
+ transform: scaleY(-1);
107
+ }
108
+
109
+ .ActionList--subGroup {
110
+ display: block;
111
+ }
112
+
113
+ &.ActionList-item--hasSubItem {
114
+ // stylelint-disable-next-line selector-max-specificity
115
+ > .ActionList-content > .ActionList-item-label {
116
+ font-weight: $font-weight-bold;
117
+ }
118
+ }
119
+ }
120
+
121
+ &[aria-expanded='false'] {
122
+ .ActionList-item-collapseIcon {
123
+ transition: transform 120ms linear;
124
+ transform: scaleY(1);
125
+ }
126
+
127
+ .ActionList--subGroup {
128
+ display: none;
129
+ }
130
+ }
131
+
132
+ // checkbox item [aria-checked]
133
+ // listbox [aria-selected]
134
+
135
+ &[aria-checked='true'],
136
+ &[aria-selected='true'] {
137
+ // multiselect checkmark
138
+ .ActionList-item-multiSelectCheckmark {
139
+ visibility: visible;
140
+ opacity: 1;
141
+ transition: visibility 0 linear 0, opacity $actionList-item-checkmark-transition-timing;
142
+ }
143
+
144
+ // singleselect checkmark
145
+ .ActionList-item-singleSelectCheckmark {
146
+ visibility: visible;
147
+
148
+ @media screen and (prefers-reduced-motion: no-preference) {
149
+ animation: checkmarkIn 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
150
+ }
151
+ }
152
+
153
+ // checkbox
154
+ .ActionList-item-multiSelectIcon {
155
+ .ActionList-item-multiSelectIconRect {
156
+ fill: var(--color-accent-fg);
157
+ stroke: var(--color-accent-fg);
158
+ stroke-width: $border-width;
159
+ }
160
+
161
+ .ActionList-item-multiSelectCheckmark {
162
+ fill: var(--color-fg-on-emphasis);
163
+ }
164
+ }
165
+ }
166
+
167
+ &[aria-checked='false'],
168
+ &[aria-selected='false'] {
169
+ // multiselect checkmark
170
+ .ActionList-item-multiSelectCheckmark {
171
+ visibility: hidden;
172
+ opacity: 0;
173
+ transition:
174
+ visibility 0 linear $actionList-item-checkmark-transition-timing,
175
+ opacity $actionList-item-checkmark-transition-timing;
176
+ }
177
+
178
+ // singleselect checkmark
179
+ .ActionList-item-singleSelectCheckmark {
180
+ visibility: hidden;
181
+ transition: visibility 0s linear 200ms;
182
+ clip-path: inset(16px 0 0 0);
183
+
184
+ @media screen and (prefers-reduced-motion: no-preference) {
185
+ animation: checkmarkOut 200ms cubic-bezier(0.11, 0, 0.5, 0) forwards;
186
+ }
187
+ }
188
+
189
+ // checkbox
190
+ .ActionList-item-multiSelectIcon {
191
+ .ActionList-item-multiSelectIconRect {
192
+ fill: var(--color-canvas-default);
193
+ stroke: var(--color-border-default);
194
+ stroke-width: $border-width;
195
+ }
196
+ }
197
+
198
+ .ActionList-item-multiSelectIconRect {
199
+ fill: var(--color-canvas-default);
200
+ border: $border-width $border-style var(--color-border-default);
201
+ }
202
+ }
203
+
204
+ @keyframes checkmarkIn {
205
+ from {
206
+ clip-path: inset(16px 0 0 0);
207
+ }
208
+
209
+ to {
210
+ clip-path: inset(0 0 0 0);
211
+ }
212
+ }
213
+
214
+ @keyframes checkmarkOut {
215
+ from {
216
+ clip-path: inset(0 0 0 0);
217
+ }
218
+
219
+ to {
220
+ clip-path: inset(16px 0 0 0);
221
+ }
222
+ }
223
+
224
+ // variants
225
+
226
+ // danger
227
+ &.ActionList-item--danger {
228
+ .ActionList-item-label {
229
+ color: var(--color-danger-fg);
230
+ }
231
+
232
+ .ActionList-item-visual {
233
+ color: var(--color-danger-fg);
234
+ }
235
+
236
+ @media (hover: hover) and (pointer: fine) {
237
+ &:hover {
238
+ background: var(--color-action-list-item-danger-hover-bg);
239
+
240
+ // stylelint-disable-next-line max-nesting-depth
241
+ .ActionList-item-label {
242
+ color: var(--color-action-list-item-danger-hover-text);
243
+ }
244
+ }
245
+ }
246
+
247
+ &:active {
248
+ background: var(--color-action-list-item-danger-active-bg);
249
+ }
250
+ }
251
+
252
+ // disabled
253
+ &[aria-disabled='true'] {
254
+ .ActionList-item-label,
255
+ .ActionList-item-description {
256
+ color: var(--color-primer-fg-disabled);
257
+ }
258
+
259
+ .ActionList-item-visual {
260
+ fill: var(--color-primer-fg-disabled);
261
+ }
262
+
263
+ @media (hover: hover) and (pointer: fine) {
264
+ &:hover {
265
+ cursor: not-allowed;
266
+ background-color: transparent;
267
+ }
268
+ }
269
+ }
270
+
271
+ // if nested list exists, remove default padding
272
+ .ActionList {
273
+ // stylelint-disable-next-line primer/spacing
274
+ padding: unset;
275
+ }
276
+ }
277
+
278
+ // span or a href
279
+ .ActionList-content {
280
+ position: relative;
281
+ display: grid;
282
+ // stylelint-disable-next-line primer/spacing
283
+ padding: $actionList-item-padding-vertical $actionList-item-padding-horizontal;
284
+ font-weight: $font-weight-normal;
285
+ color: var(--color-fg-default);
286
+ user-select: none;
287
+ border-radius: $border-radius;
288
+ transition: $actionList-item-bg-transition;
289
+ grid-template-rows: min-content;
290
+ grid-template-areas: 'leadingAction leadingVisual label trailingVisual trailingAction';
291
+ grid-template-columns: min-content min-content minmax(min-content, auto) min-content min-content;
292
+ align-items: center;
293
+
294
+ // column-gap persists with empty grid-areas, margin applies only when children exist
295
+ > :not(:last-child) {
296
+ margin-right: $spacer-2;
297
+ }
298
+
299
+ // sizes
300
+
301
+ &.ActionList-content--sizeMedium {
302
+ // 44px total height
303
+ // stylelint-disable-next-line primer/spacing
304
+ padding: $actionList-item-padding-vertical-md $actionList-item-padding-horizontal;
305
+ }
306
+
307
+ &.ActionList-content--sizeLarge {
308
+ // 48px total height
309
+ // stylelint-disable-next-line primer/spacing
310
+ padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
311
+ }
312
+
313
+ // On pointer:coarse (mobile), all list items are large
314
+ @media (pointer: coarse) {
315
+ // stylelint-disable-next-line primer/spacing
316
+ padding: $actionList-item-padding-vertical-lg $actionList-item-padding-horizontal;
317
+ }
318
+
319
+ &.ActionList-content--blockDescription {
320
+ // if leading/trailing visual, align with first line of content
321
+ .ActionList-item-visual {
322
+ place-self: start;
323
+ }
324
+ }
325
+ }
326
+
327
+ // place children on grid
328
+
329
+ .ActionList-item-action--leading {
330
+ grid-area: leadingAction;
331
+ }
332
+
333
+ .ActionList-item-visual--leading {
334
+ grid-area: leadingVisual;
335
+ }
336
+
337
+ .ActionList-item-label {
338
+ grid-area: label;
339
+ }
340
+
341
+ .ActionList-item-visual--trailing {
342
+ grid-area: trailingVisual;
343
+ }
344
+
345
+ .ActionList-item-action--trailing {
346
+ grid-area: trailingAction;
347
+ }
348
+
349
+ // wrapper span
350
+ // default block
351
+ .ActionList-item-descriptionWrap {
352
+ grid-area: label;
353
+ display: flex;
354
+ flex-direction: column;
355
+
356
+ .ActionList-item-description {
357
+ margin-top: $spacer-1;
358
+ }
359
+
360
+ .ActionList-item-label {
361
+ font-weight: $font-weight-bold;
362
+ }
363
+ }
364
+
365
+ // inline
366
+ .ActionList-item-descriptionWrap--inline {
367
+ flex-direction: row;
368
+ align-items: baseline;
369
+
370
+ .ActionList-item-description {
371
+ // stylelint-disable-next-line primer/spacing
372
+ margin-left: $actionList-item-padding-horizontal;
373
+ }
374
+ }
375
+
376
+ // description
377
+ .ActionList-item-description {
378
+ font-size: $font-size-small;
379
+ font-weight: $font-weight-normal;
380
+ line-height: $lh-default;
381
+ color: var(--color-fg-muted);
382
+ }
383
+
384
+ // helper for grid alignment with multi-line content
385
+ // span wrapping svg or text
386
+ .ActionList-item-visual,
387
+ .ActionList-item-action {
388
+ display: flex;
389
+ min-height: $actionList-item-height-sm;
390
+ color: var(--color-fg-muted); // if visual is text
391
+ fill: var(--color-fg-muted);
392
+ align-items: center;
393
+ }
394
+
395
+ // text
396
+ // stylelint-disable-next-line no-duplicate-selectors
397
+ .ActionList-item-label {
398
+ position: relative; // for pseudo dividers
399
+ font-weight: $font-weight-normal;
400
+ // we need a strict value here for grid alignment
401
+ // stylelint-disable-next-line primer/typography
402
+ line-height: $actionList-item-label-line-height;
403
+ color: var(--color-fg-default);
404
+ }
405
+
406
+ // nested lists (only supports 1 level currently)
407
+ // target ActionList-item--subItem for padding-left to maintain :active :after state
408
+
409
+ .ActionList-item--subItem > .ActionList-content {
410
+ font-size: $font-size-small;
411
+ }
412
+
413
+ // no leading visual
414
+ .ActionList--subGroup {
415
+ .ActionList-item--subItem {
416
+ padding-left: $spacer-3;
417
+ }
418
+ }
419
+
420
+ // has 16px leading visual
421
+ .ActionList-content--visual16 + .ActionList--subGroup {
422
+ .ActionList-item--subItem {
423
+ padding-left: $spacer-4;
424
+ }
425
+ }
426
+
427
+ // has 20px leading visual
428
+ .ActionList-content--visual20 + .ActionList--subGroup {
429
+ .ActionList-item--subItem {
430
+ padding-left: $spacer-3 * 1.75;
431
+ }
432
+ }
433
+
434
+ // has 24px leading visual
435
+ .ActionList-content--visual24 + .ActionList--subGroup {
436
+ .ActionList-item--subItem {
437
+ padding-left: $spacer-5;
438
+ }
439
+ }
@@ -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,33 @@
1
+ // <ul>
2
+ .ActionList {
3
+ padding: $spacer-2;
4
+ }
5
+
6
+ // dividers
7
+
8
+ .ActionList--divided {
9
+ .ActionList-item-label::before {
10
+ position: absolute;
11
+ top: -$actionList-item-padding-vertical;
12
+ display: block;
13
+ width: 100%;
14
+ height: 1px;
15
+ content: '';
16
+ background: var(--color-action-list-item-inline-divider);
17
+ }
18
+
19
+ // hide divider if item is active
20
+ .ActionList-item--navActive {
21
+ // stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
22
+ .ActionList-item-label::before,
23
+ + .ActionList-item .ActionList-item-label::before {
24
+ visibility: hidden;
25
+ }
26
+ }
27
+ }
28
+
29
+ // hide if item is first of type with label::before, or is the first item after a sectionDivider
30
+ .ActionList-item:first-of-type .ActionList-item-label::before,
31
+ .ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
32
+ visibility: hidden;
33
+ }
@@ -0,0 +1,5 @@
1
+ @import '../support/index.scss';
2
+ @import './action-list-variables.scss';
3
+ @import './action-list.scss';
4
+ @import './action-list-item.scss';
5
+ @import './action-list-item-divider.scss';
package/alerts/README.md CHANGED
@@ -1,36 +1,25 @@
1
- # Primer Alerts
2
- > Flash messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time.
1
+ ---
2
+ bundle: "alerts"
3
+ generated: true
4
+ ---
3
5
 
4
- This repository is a module of the full [Primer CSS][primer] repository.
6
+ # Primer CSS: `alerts` bundle
5
7
 
6
8
  ## Usage
7
9
 
8
- The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this.
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:
9
11
 
10
12
  ```scss
11
- @import "primer-alerts/index.scss";
13
+ @import "@primer/css/alerts/index.scss";
12
14
  ```
13
15
 
14
- You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._
15
-
16
16
  ## Build
17
17
 
18
- For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package.
19
-
20
- ```
21
- $ npm run build
22
- ```
23
-
24
- ## Documentation
25
-
26
- Find further documentation at [primer.style/css/components/alerts](https://primer.style/css/components/alerts).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/alerts.css`.
27
19
 
28
20
  ## License
29
21
 
30
- [MIT](./LICENSE) &copy; [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) &copy; [GitHub](https://github.com/)
23
+
31
24
 
32
- [primer]: https://github.com/primer/css
33
- [docs]: https://primer.style/css
34
- [npm]: https://www.npmjs.com/
35
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
36
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
package/alerts/flash.scss CHANGED
@@ -1,16 +1,22 @@
1
+ // stylelint-disable selector-max-type, no-duplicate-selectors
2
+
1
3
  // Default flash
2
- // stylelint-disable selector-max-type
3
4
  .flash {
4
5
  position: relative;
5
- padding: $spacer-3;
6
- color: $blue-800;
7
- background-color: $blue-100;
8
- border: 1px solid $border-black-fade;
9
- border-radius: 3px;
6
+ // stylelint-disable-next-line primer/spacing
7
+ padding: 20px $spacer-3;
8
+ border-style: $border-style;
9
+ border-width: $border-width;
10
+ border-radius: $border-radius;
10
11
 
11
12
  p:last-child {
12
13
  margin-bottom: 0;
13
14
  }
15
+
16
+ .octicon {
17
+ // stylelint-disable-next-line primer/spacing
18
+ margin-right: 12px;
19
+ }
14
20
  }
15
21
 
16
22
  // Contain the flash messages
@@ -23,59 +29,123 @@
23
29
  float: right;
24
30
  padding: $spacer-3;
25
31
  margin: -$spacer-3;
26
- color: inherit;
27
32
  text-align: center;
28
33
  cursor: pointer;
34
+
29
35
  // Undo `<button>` styles
30
36
  background: none;
31
37
  border: 0;
32
38
  appearance: none;
33
- opacity: 0.6;
34
39
 
35
40
  &:hover {
36
- opacity: 1;
41
+ opacity: 0.7;
42
+ }
43
+
44
+ &:active {
45
+ opacity: 0.5;
46
+ }
47
+
48
+ .octicon {
49
+ margin-right: 0;
37
50
  }
38
51
  }
39
52
 
40
53
  // Action button
41
54
  .flash-action {
42
55
  float: right;
56
+ // stylelint-disable-next-line primer/spacing
43
57
  margin-top: -3px;
44
58
  margin-left: $spacer-4;
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
+ }
45
69
  }
46
70
 
47
71
  //
48
- // Variations
72
+ // Color variations
49
73
  //
50
74
 
75
+ .flash {
76
+ color: var(--color-fg-default);
77
+ background-image: linear-gradient(var(--color-accent-subtle), var(--color-accent-subtle));
78
+ border-color: var(--color-accent-muted);
79
+
80
+ .octicon {
81
+ color: var(--color-accent-fg);
82
+ }
83
+ }
84
+
51
85
  .flash-warn {
52
- color: $yellow-900;
53
- background-color: $yellow-100;
54
- border-color: $black-fade-15;
86
+ color: var(--color-fg-default);
87
+ background-image: linear-gradient(var(--color-attention-subtle), var(--color-attention-subtle));
88
+ border-color: var(--color-attention-muted);
89
+
90
+ .octicon {
91
+ color: var(--color-attention-fg);
92
+ }
55
93
  }
56
94
 
57
95
  .flash-error {
58
- color: $red-900;
59
- background-color: $red-100;
60
- border-color: $black-fade-15;
96
+ color: var(--color-fg-default);
97
+ background-image: linear-gradient(var(--color-danger-subtle), var(--color-danger-subtle));
98
+ border-color: var(--color-danger-muted);
99
+
100
+ .octicon {
101
+ color: var(--color-danger-fg);
102
+ }
61
103
  }
62
104
 
63
105
  .flash-success {
64
- color: $green-800;
65
- background-color: $green-100;
66
- border-color: $black-fade-15;
106
+ color: var(--color-fg-default);
107
+ background-image: linear-gradient(var(--color-success-subtle), var(--color-success-subtle));
108
+ border-color: var(--color-success-muted);
109
+
110
+ .octicon {
111
+ color: var(--color-success-fg);
112
+ }
67
113
  }
68
114
 
115
+ //
116
+ // Layout variations
117
+ //
118
+
69
119
  .flash-full {
120
+ // stylelint-disable-next-line primer/spacing
70
121
  margin-top: -1px;
71
- border-width: 1px 0;
122
+ border-width: $border-width 0;
123
+ border-radius: 0;
124
+ }
125
+
126
+ // A banner rendered at the top of the page.
127
+ .flash-banner {
128
+ position: fixed;
129
+ top: 0;
130
+ z-index: 90;
131
+ width: 100%;
132
+ border-top: 0;
133
+ border-right: 0;
134
+ border-left: 0;
72
135
  border-radius: 0;
73
136
  }
74
137
 
138
+ // Makes sure the background is opaque to cover any content underneath
139
+ .flash-full,
140
+ .flash-banner {
141
+ background-color: var(--color-canvas-default);
142
+ }
143
+
75
144
  // FIXME deprecate this
76
145
  .warning {
77
146
  padding: $em-spacer-5;
147
+ // stylelint-disable-next-line primer/spacing
78
148
  margin-bottom: 0.8em;
79
149
  font-weight: $font-weight-bold;
80
- background-color: $yellow-100;
150
+ background-color: var(--color-attention-subtle);
81
151
  }
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';