@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
@@ -1,37 +1,25 @@
1
- # Primer / Branch Name
1
+ ---
2
+ bundle: "branch-name"
3
+ generated: true
4
+ ---
2
5
 
3
- > A nice, consistent way to display branch names.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `branch-name` bundle
6
7
 
7
8
  ## Usage
8
9
 
9
- 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:
10
11
 
11
12
  ```scss
12
- @import "primer-branch-name/index.scss";
13
+ @import "@primer/css/branch-name/index.scss";
13
14
  ```
14
15
 
15
- 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._
16
-
17
16
  ## Build
18
17
 
19
- For a compiled **CSS** version of this module, an 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:
20
-
21
- ```
22
- $ npm run build
23
- ```
24
-
25
- ## Documentation
26
-
27
- Find further documentation at [primer.style/css/components/branch-name](https://primer.style/css/components/branch-name).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/branch-name.css`.
28
19
 
29
20
  ## License
30
21
 
31
- [MIT](./LICENSE) © [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
32
24
 
33
- [primer]: https://github.com/primer/css
34
- [docs]: https://primer.style/css
35
- [npm]: https://www.npmjs.com/
36
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
37
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1,20 +1,30 @@
1
+ // stylelint-disable selector-max-type, selector-no-qualifying-type
2
+
1
3
  // A nice way to display branch names inside the UI. Can be a link or not.
2
- // stylelint-disable selector-max-type
4
+
3
5
  .branch-name {
4
6
  display: inline-block;
7
+ // stylelint-disable-next-line primer/spacing
5
8
  padding: 2px 6px;
6
9
  font: 12px $mono-font;
7
- color: rgba($black, 0.6);
8
- background-color: lighten($blue-100, 3%);
9
- border-radius: 3px;
10
+ color: var(--color-fg-muted);
11
+ background-color: var(--color-accent-subtle);
12
+ border-radius: $border-radius;
10
13
 
11
14
  .octicon {
15
+ // stylelint-disable-next-line primer/spacing
12
16
  margin: 1px -2px 0 0;
13
- color: desaturate($blue-300, 70%);
17
+ color: var(--color-fg-muted);
14
18
  }
15
19
  }
16
20
 
17
21
  // When a branch name is a link
18
- // stylelint-disable selector-no-qualifying-type
19
- a.branch-name { color: $text-blue; }
20
- // stylelint-enable selector-no-qualifying-type
22
+
23
+ a.branch-name {
24
+ color: var(--color-accent-fg);
25
+ background-color: var(--color-accent-subtle);
26
+
27
+ .octicon {
28
+ color: var(--color-accent-fg);
29
+ }
30
+ }
@@ -1,3 +1,3 @@
1
1
  // support files
2
- @import "../support/index.scss";
3
- @import "./branch-name.scss";
2
+ @import '../support/index.scss';
3
+ @import './branch-name.scss';
@@ -1,21 +1,25 @@
1
- # Primer Breadcrumb Navigation
1
+ ---
2
+ bundle: "breadcrumb"
3
+ generated: true
4
+ ---
2
5
 
3
- > Breadcrumb navigation for GitHub's pages with parents / grandparents.
6
+ # Primer CSS: `breadcrumb` bundle
4
7
 
5
- This repository is a module of the full [primer][primer] repository.
8
+ ## Usage
6
9
 
7
- ## Documentation
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:
8
11
 
9
- Find further documentation at [primer.style/css/components/breadcrumb](https://primer.style/css/components/breadcrumb).
12
+ ```scss
13
+ @import "@primer/css/breadcrumb/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/breadcrumb.css`.
10
19
 
11
20
  ## License
12
21
 
13
- MIT © [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
14
24
 
15
- [primer]: https://github.com/primer/css
16
- [primer-support]: https://github.com/primer/css-support
17
- [support]: https://github.com/primer/css-support
18
- [docs]: https://primer.style/css
19
- [npm]: https://www.npmjs.com/
20
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
21
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1,14 +1,18 @@
1
1
  .breadcrumb-item {
2
2
  display: inline-block;
3
+ // stylelint-disable-next-line primer/spacing
3
4
  margin-left: -0.35em;
4
5
  white-space: nowrap;
5
6
  list-style: none;
6
7
 
7
8
  &::after {
8
- padding-right: $em-spacer-5;
9
- padding-left: $em-spacer-5;
10
- color: $border-gray;
11
- content: "/";
9
+ display: inline-block;
10
+ height: 0.8em;
11
+ margin: 0 $em-spacer-5;
12
+ content: '';
13
+ // stylelint-disable-next-line primer/borders
14
+ border-right: 0.1em $border-style var(--color-fg-muted);
15
+ transform: rotate(15deg);
12
16
  }
13
17
 
14
18
  &:first-child {
@@ -16,8 +20,14 @@
16
20
  }
17
21
  }
18
22
 
19
- .breadcrumb-item-selected {
23
+ .breadcrumb-item-selected,
24
+ .breadcrumb-item[aria-current]:not([aria-current=false]) {
20
25
  &::after {
21
26
  content: none;
22
27
  }
23
28
  }
29
+
30
+ // stylelint-disable selector-max-type
31
+ .breadcrumb-item-selected a {
32
+ color: var(--color-fg-default);
33
+ }
@@ -1,3 +1,3 @@
1
1
  // support files
2
- @import "../support/index.scss";
3
- @import "./breadcrumb.scss";
2
+ @import '../support/index.scss';
3
+ @import './breadcrumb.scss';
package/buttons/README.md CHANGED
@@ -1,37 +1,25 @@
1
- # Primer Buttons
1
+ ---
2
+ bundle: "buttons"
3
+ generated: true
4
+ ---
2
5
 
3
- > Buttons are used for actions, like in forms, while textual hyperlinks are used for destinations, or moving from one page to another.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `buttons` bundle
6
7
 
7
8
  ## Usage
8
9
 
9
- 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:
10
11
 
11
12
  ```scss
12
- @import "primer-buttons/index.scss";
13
+ @import "@primer/css/buttons/index.scss";
13
14
  ```
14
15
 
15
- 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._
16
-
17
16
  ## Build
18
17
 
19
- 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.
20
-
21
- ```
22
- $ npm run build
23
- ```
24
-
25
- ## Documentation
26
-
27
- Find further documentation at [primer.style/css/components/buttons](https://primer.style/css/components/buttons).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/buttons.css`.
28
19
 
29
20
  ## License
30
21
 
31
- [MIT](./LICENSE) © [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
32
24
 
33
- [primer]: https://github.com/primer/css
34
- [docs]: https://primer.style/css
35
- [npm]: https://www.npmjs.com/
36
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
37
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -33,6 +33,7 @@
33
33
  }
34
34
 
35
35
  &.selected,
36
+ &[aria-selected=true],
36
37
  &:focus,
37
38
  &:active,
38
39
  &:hover {
@@ -65,6 +66,7 @@
65
66
  }
66
67
 
67
68
  &.selected,
69
+ &[aria-selected=true],
68
70
  &:focus,
69
71
  &:active,
70
72
  &:hover {
@@ -1,24 +1,33 @@
1
- // stylelint-disable selector-max-type, block-opening-brace-space-before, no-duplicate-selectors
1
+ // stylelint-disable selector-max-type, no-duplicate-selectors
2
2
 
3
3
  // Base button styles
4
4
  .btn {
5
5
  position: relative;
6
6
  display: inline-block;
7
- padding: 6px 12px;
7
+ // stylelint-disable-next-line primer/spacing
8
+ padding: 5px $spacer-3;
8
9
  font-size: $body-font-size;
9
- font-weight: $font-weight-bold;
10
+ font-weight: $font-weight-semibold;
11
+ // stylelint-disable-next-line primer/typography
10
12
  line-height: 20px; // Specifically not inherit our `<body>` default
11
13
  white-space: nowrap;
12
14
  vertical-align: middle;
13
15
  cursor: pointer;
14
16
  user-select: none;
15
- background-repeat: repeat-x;
16
- background-position: -1px -1px;
17
- background-size: 110% 110%;
18
- border: 1px solid transparentize($black, 0.8);
19
- border-radius: 0.25em;
17
+ border: $border-width $border-style;
18
+ border-radius: $border-radius;
20
19
  appearance: none; // Corrects inability to style clickable `input` types in iOS.
21
20
 
21
+ &:hover {
22
+ text-decoration: none;
23
+ }
24
+
25
+ &:disabled,
26
+ &.disabled,
27
+ &[aria-disabled='true'] {
28
+ cursor: default;
29
+ }
30
+
22
31
  i {
23
32
  font-style: normal;
24
33
  font-weight: $font-weight-semibold;
@@ -26,143 +35,246 @@
26
35
  }
27
36
 
28
37
  .octicon {
29
- vertical-align: text-top;
38
+ margin-right: $spacer-1;
39
+ color: var(--color-fg-muted);
40
+ vertical-align: text-bottom;
41
+
42
+ &:only-child {
43
+ margin-right: 0;
44
+ }
30
45
  }
31
46
 
32
- // Darken for just a tad more contrast against the button background
33
47
  .Counter {
34
- color: $gray-600;
48
+ // stylelint-disable-next-line primer/spacing
49
+ margin-left: 2px;
50
+ color: inherit;
35
51
  text-shadow: none;
36
- background-color: rgba($black, 0.1);
52
+ vertical-align: top;
53
+ background-color: var(--color-btn-counter-bg);
37
54
  }
38
55
 
39
- &:hover {
40
- text-decoration: none;
41
- background-repeat: repeat-x;
56
+ .dropdown-caret {
57
+ margin-left: $spacer-1;
58
+ opacity: 0.8;
42
59
  }
60
+ }
61
+
62
+ // Default button
63
+
64
+ .btn {
65
+ color: var(--color-btn-text);
66
+ background-color: var(--color-btn-bg);
67
+ border-color: var(--color-btn-border);
68
+ box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);
69
+ transition: 0.2s cubic-bezier(0.3, 0, 0.5, 1);
70
+ transition-property: color, background-color, border-color;
43
71
 
44
- &:focus {
45
- outline: 0;
72
+ &:hover,
73
+ &.hover,
74
+ [open] > & {
75
+ background-color: var(--color-btn-hover-bg);
76
+ border-color: var(--color-btn-hover-border);
77
+ transition-duration: 0.1s;
78
+ }
79
+
80
+ &:active {
81
+ background-color: var(--color-btn-active-bg);
82
+ border-color: var(--color-btn-active-border);
83
+ transition: none;
84
+ }
85
+
86
+ &.selected,
87
+ &[aria-selected='true'] {
88
+ background-color: var(--color-btn-selected-bg);
89
+ box-shadow: var(--color-primer-shadow-inset);
46
90
  }
47
91
 
48
92
  &:disabled,
49
- &.disabled {
50
- cursor: default;
51
- // Repeat `background-position` because `:hover`
52
- background-position: 0 0;
93
+ &.disabled,
94
+ &[aria-disabled='true'] {
95
+ color: var(--color-primer-fg-disabled);
96
+ background-color: var(--color-btn-bg);
97
+ border-color: var(--color-btn-border);
98
+
99
+ .octicon {
100
+ color: var(--color-primer-fg-disabled);
101
+ }
102
+ }
103
+ }
104
+
105
+ // Primary button
106
+
107
+ .btn-primary {
108
+ color: var(--color-btn-primary-text);
109
+ background-color: var(--color-btn-primary-bg);
110
+ border-color: var(--color-btn-primary-border);
111
+ box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);
112
+
113
+ &:hover,
114
+ &.hover,
115
+ [open] > & {
116
+ background-color: var(--color-btn-primary-hover-bg);
117
+ border-color: var(--color-btn-primary-hover-border);
53
118
  }
54
119
 
55
120
  &:active,
56
- &.selected {
57
- background-image: none;
121
+ &.selected,
122
+ &[aria-selected='true'] {
123
+ background-color: var(--color-btn-primary-selected-bg);
124
+ box-shadow: var(--color-btn-primary-selected-shadow);
58
125
  }
59
- }
60
126
 
61
- .btn { @include btn-solid($text-gray-dark, $gray-000, darken($gray-100, 2%)); }
62
- .btn-primary { @include btn-solid($text-white, $green-400, $green-500); }
63
- @warn ".btn-purple will be removed in 13.0.0. Please don't make buttons purple.";
64
- .btn-purple { @include btn-solid($text-white, lighten($purple-500, 5%), darken($purple-500, 5%)); }
65
- .btn-blue { @include btn-solid($text-white, lighten($blue-500, 8%), darken($blue-500, 2%)); }
66
- .btn-danger { @include btn-inverse($red-600, $gray-000, darken($gray-100, 2%)); }
127
+ &:disabled,
128
+ &.disabled,
129
+ &[aria-disabled='true'] {
130
+ color: var(--color-btn-primary-disabled-text);
131
+ background-color: var(--color-btn-primary-disabled-bg);
132
+ border-color: var(--color-btn-primary-disabled-border);
133
+
134
+ .octicon {
135
+ color: var(--color-btn-primary-disabled-text);
136
+ }
137
+ }
138
+
139
+ .Counter {
140
+ color: inherit;
141
+ background-color: var(--color-btn-primary-counter-bg);
142
+ }
143
+
144
+ .octicon {
145
+ color: var(--color-btn-primary-icon);
146
+ }
147
+ }
67
148
 
68
149
  // Outline button
69
- //
70
- // For when we need a linky-action that's not too heavy in busier
71
- // areas like conversation timelines.
150
+
72
151
  .btn-outline {
73
- @include btn-outline($text-blue);
74
- }
152
+ color: var(--color-btn-outline-text);
75
153
 
76
- // Social button count
77
- .btn-with-count {
78
- float: left;
79
- border-top-right-radius: 0;
80
- border-bottom-right-radius: 0;
81
- }
154
+ &:hover,
155
+ [open] > & {
156
+ color: var(--color-btn-outline-hover-text);
157
+ background-color: var(--color-btn-outline-hover-bg);
158
+ border-color: var(--color-btn-outline-hover-border);
159
+ box-shadow: var(--color-btn-outline-hover-shadow), var(--color-btn-outline-hover-inset-shadow);
82
160
 
83
- // Minibutton overrides
84
- //
85
- // Tweak `line-height` to make them smaller.
86
- .btn-sm {
87
- padding: 3px 10px;
88
- font-size: $font-size-small;
89
- line-height: 20px;
90
- }
161
+ .Counter {
162
+ background-color: var(--color-btn-outline-hover-counter-bg);
163
+ }
91
164
 
92
- // Large button adds more padding around text. Use font-size utils to increase font-size.. e.g, <p class="text-gamma"><button class="btn btn-large btn-primary" type="button">Big green button</button></p>
93
- .btn-large {
94
- padding: $em-spacer-6 1.25em;
95
- font-size: inherit;
96
- border-radius: 6px;
97
- }
165
+ .octicon {
166
+ color: inherit;
167
+ }
168
+ }
98
169
 
99
- // Hidden text button
100
- //
101
- // Use `.hidden-text-expander` to indicate and expand hidden text.
102
- .hidden-text-expander {
103
- display: block;
170
+ &:active,
171
+ &.selected,
172
+ &[aria-selected='true'] {
173
+ color: var(--color-btn-outline-selected-text);
174
+ background-color: var(--color-btn-outline-selected-bg);
175
+ border-color: var(--color-btn-outline-selected-border);
176
+ box-shadow: var(--color-btn-outline-selected-shadow);
177
+ }
178
+
179
+ &:disabled,
180
+ &.disabled,
181
+ &[aria-disabled='true'] {
182
+ color: var(--color-btn-outline-disabled-text);
183
+ background-color: var(--color-btn-outline-disabled-bg);
184
+ border-color: var(--color-btn-border);
185
+ box-shadow: none;
104
186
 
105
- &.inline {
106
- position: relative;
107
- top: -1px;
108
- display: inline-block;
109
- margin-left: 5px;
110
- line-height: 0;
187
+ .Counter {
188
+ background-color: var(--color-btn-outline-disabled-counter-bg);
189
+ }
190
+ }
191
+
192
+ .Counter {
193
+ color: inherit;
194
+ background-color: var(--color-btn-outline-counter-bg);
111
195
  }
112
196
  }
113
197
 
114
- .hidden-text-expander a,
115
- .ellipsis-expander {
116
- display: inline-block;
117
- height: 12px;
118
- padding: 0 5px 5px;
119
- font-size: $font-size-small;
120
- font-weight: $font-weight-bold;
121
- line-height: 6px;
122
- color: $gray-700;
123
- text-decoration: none;
124
- vertical-align: middle;
125
- background: lighten($gray-300, 5%);
126
- border: 0;
127
- border-radius: 1px;
198
+ // Danger button
128
199
 
129
- &:hover {
130
- text-decoration: none;
131
- background-color: darken($gray-300, 4%);
200
+ .btn-danger {
201
+ color: var(--color-btn-danger-text);
202
+
203
+ .octicon {
204
+ color: var(--color-btn-danger-icon);
132
205
  }
133
206
 
134
- &:active {
135
- color: $text-white;
136
- background-color: $blue-400;
207
+ &:hover,
208
+ [open] > & {
209
+ color: var(--color-btn-danger-hover-text);
210
+ background-color: var(--color-btn-danger-hover-bg);
211
+ border-color: var(--color-btn-danger-hover-border);
212
+ box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
213
+
214
+ .Counter {
215
+ background-color: var(--color-btn-danger-hover-counter-bg);
216
+ }
217
+
218
+ .octicon {
219
+ color: var(--color-btn-danger-hover-icon);
220
+ }
221
+ }
222
+
223
+ &:active,
224
+ &.selected,
225
+ &[aria-selected='true'] {
226
+ color: var(--color-btn-danger-selected-text);
227
+ background-color: var(--color-btn-danger-selected-bg);
228
+ border-color: var(--color-btn-danger-selected-border);
229
+ box-shadow: var(--color-btn-danger-selected-shadow);
230
+ }
231
+
232
+ &:disabled,
233
+ &.disabled,
234
+ &[aria-disabled='true'] {
235
+ color: var(--color-btn-danger-disabled-text);
236
+ background-color: var(--color-btn-danger-disabled-bg);
237
+ border-color: var(--color-btn-border);
238
+ box-shadow: none;
239
+
240
+ .Counter {
241
+ background-color: var(--color-btn-danger-disabled-counter-bg);
242
+ }
243
+
244
+ .octicon {
245
+ color: var(--color-btn-danger-disabled-text);
246
+ }
247
+ }
248
+
249
+ .Counter {
250
+ color: inherit;
251
+ background-color: var(--color-btn-danger-counter-bg);
137
252
  }
138
253
  }
139
254
 
140
- // Social count bubble
255
+ // Sizes
141
256
  //
142
- // A container that is used for social bubbles counts.
143
- .social-count {
144
- float: left;
145
- padding: 3px 10px;
257
+ // Tweak `line-height` to make them smaller.
258
+ .btn-sm {
259
+ // stylelint-disable-next-line primer/spacing
260
+ padding: 3px 12px;
146
261
  font-size: $font-size-small;
147
- font-weight: $font-weight-bold;
262
+ // stylelint-disable-next-line primer/typography
148
263
  line-height: 20px;
149
- color: $text-gray-dark;
150
- vertical-align: middle;
151
- background-color: $bg-white;
152
- border: 1px solid transparentize($black, 0.8); // match with .btn
153
- border-left: 0;
154
- border-top-right-radius: 3px;
155
- border-bottom-right-radius: 3px;
156
264
 
157
- &:hover,
158
- &:active {
159
- text-decoration: none;
265
+ .octicon {
266
+ vertical-align: text-top;
160
267
  }
268
+ }
161
269
 
162
- &:hover {
163
- color: $text-blue;
164
- cursor: pointer;
165
- }
270
+ // Large button adds more padding around text. Use font-size utils to increase font-size.. e.g, <p class="text-gamma"><button class="btn btn-large btn-primary" type="button">Big green button</button></p>
271
+ .btn-large {
272
+ padding: $em-spacer-6 1.5em;
273
+ font-size: inherit;
274
+ line-height: $lh-default;
275
+
276
+ // stylelint-disable-next-line primer/borders
277
+ border-radius: 0.5em;
166
278
  }
167
279
 
168
280
  // Full-width button
@@ -173,41 +285,3 @@
173
285
  width: 100%;
174
286
  text-align: center;
175
287
  }
176
-
177
- // Link-like buttons
178
- //
179
- // This class is for styling <button> and <input> elements to look like links
180
- .btn-link {
181
- display: inline-block;
182
- padding: 0;
183
- font-size: inherit;
184
- color: $text-blue;
185
- text-decoration: none;
186
- white-space: nowrap;
187
- cursor: pointer;
188
- user-select: none;
189
- background-color: transparent;
190
- border: 0;
191
- appearance: none; // Corrects inability to style clickable `input` types in iOS.
192
-
193
- &:hover {
194
- text-decoration: underline;
195
- }
196
-
197
- &:disabled {
198
- &,
199
- &:hover {
200
- color: rgba($gray-600, 0.5);
201
- cursor: default;
202
- }
203
- }
204
- }
205
-
206
- .details-reset {
207
- // Remove marker added by the display: list-item browser default
208
- > summary { list-style: none; }
209
- // Remove marker added by details polyfill
210
- > summary::before { display: none; }
211
- // Remove marker added by Chrome
212
- > summary::-webkit-details-marker { display: none; }
213
- }