@primer/css 0.0.0-1ea75fe → 0.0.0-202110100305

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 (368) hide show
  1. package/CHANGELOG.md +1231 -132
  2. package/CODE_OF_CONDUCT.md +1 -1
  3. package/CONTRIBUTING.md +85 -0
  4. package/DEVELOP.md +11 -69
  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 +444 -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 +5 -4
  28. package/base/index.scss +6 -4
  29. package/base/kbd.scss +20 -0
  30. package/base/normalize.scss +5 -5
  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 +243 -143
  48. package/buttons/index.scss +4 -3
  49. package/buttons/misc.scss +222 -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 +316 -273
  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 +272 -0
  225. package/dropdown/index.scss +2 -0
  226. package/forms/README.md +11 -23
  227. package/forms/form-control.scss +76 -32
  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 +2 -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 +8 -5
  251. package/layout/layout-beta.scss +339 -0
  252. package/layout/layout.scss +185 -0
  253. package/layout/mixins.scss +79 -0
  254. package/links/README.md +25 -0
  255. package/links/index.scss +3 -0
  256. package/links/link.scss +55 -0
  257. package/loaders/README.md +25 -0
  258. package/loaders/index.scss +2 -0
  259. package/loaders/loaders.scss +19 -0
  260. package/markdown/README.md +11 -23
  261. package/markdown/blob-csv.scss +4 -2
  262. package/markdown/code.scss +11 -3
  263. package/markdown/footnotes.scss +37 -0
  264. package/markdown/headings.scss +13 -4
  265. package/markdown/images.scss +15 -4
  266. package/markdown/index.scss +9 -8
  267. package/markdown/lists.scss +19 -5
  268. package/markdown/markdown-body.scss +15 -18
  269. package/markdown/tables.scss +8 -5
  270. package/marketing/README.md +11 -23
  271. package/marketing/buttons/button.scss +82 -61
  272. package/marketing/index.scss +6 -11
  273. package/marketing/support/index.scss +1 -0
  274. package/marketing/support/mixins.scss +66 -0
  275. package/marketing/support/variables.scss +110 -51
  276. package/marketing/type/typography.scss +100 -62
  277. package/marketing/utilities/animations.scss +9 -0
  278. package/marketing/utilities/filters.scss +0 -1
  279. package/marketing/utilities/index.scss +2 -3
  280. package/marketing/utilities/layout.scss +32 -11
  281. package/navigation/README.md +11 -23
  282. package/navigation/filter-list.scss +16 -14
  283. package/navigation/index.scss +7 -6
  284. package/navigation/menu.scss +44 -35
  285. package/navigation/sidenav.scss +108 -0
  286. package/navigation/subnav.scss +28 -21
  287. package/navigation/tabnav.scss +45 -21
  288. package/navigation/underline-nav.scss +36 -22
  289. package/package.json +78 -107
  290. package/pagination/README.md +12 -14
  291. package/pagination/index.scss +2 -2
  292. package/pagination/pagination.scss +61 -37
  293. package/popover/README.md +11 -24
  294. package/popover/index.scss +2 -2
  295. package/popover/popover.scss +18 -9
  296. package/postcss.config.cjs +22 -0
  297. package/prettier.config.cjs +1 -0
  298. package/product/README.md +11 -23
  299. package/product/index.scss +19 -17
  300. package/progress/README.md +11 -23
  301. package/progress/index.scss +2 -2
  302. package/progress/progress.scss +11 -1
  303. package/select-menu/README.md +25 -0
  304. package/select-menu/index.scss +3 -0
  305. package/select-menu/select-menu.scss +464 -0
  306. package/stylelint.config.cjs +16 -0
  307. package/subhead/README.md +11 -25
  308. package/subhead/index.scss +2 -2
  309. package/subhead/subhead.scss +10 -4
  310. package/support/README.md +12 -18
  311. package/support/index.scss +7 -8
  312. package/support/mixins/color-modes.scss +106 -0
  313. package/support/mixins/misc.scss +9 -12
  314. package/support/mixins/typography.scss +1 -1
  315. package/support/variables/layout.scss +103 -11
  316. package/support/variables/misc.scss +7 -30
  317. package/support/variables/typography.scss +4 -4
  318. package/table-object/README.md +11 -24
  319. package/table-object/index.scss +1 -1
  320. package/timeline/README.md +25 -0
  321. package/timeline/index.scss +2 -0
  322. package/timeline/timeline-item.scss +95 -0
  323. package/toasts/README.md +25 -0
  324. package/toasts/index.scss +2 -0
  325. package/toasts/toasts.scss +124 -0
  326. package/tooltips/README.md +11 -24
  327. package/tooltips/index.scss +2 -2
  328. package/tooltips/tooltips.scss +17 -8
  329. package/truncate/README.md +11 -24
  330. package/truncate/index.scss +2 -1
  331. package/truncate/truncate.scss +41 -7
  332. package/utilities/README.md +11 -23
  333. package/utilities/animations.scss +14 -2
  334. package/utilities/borders.scss +29 -65
  335. package/utilities/box-shadow.scss +8 -9
  336. package/utilities/colors.scss +71 -110
  337. package/utilities/details.scss +12 -4
  338. package/utilities/flexbox.scss +14 -14
  339. package/utilities/index.scss +12 -12
  340. package/utilities/layout.scss +28 -22
  341. package/utilities/margin.scss +34 -17
  342. package/utilities/padding.scss +13 -9
  343. package/utilities/typography.scss +54 -25
  344. package/utilities/visibility-display.scss +0 -13
  345. package/.browserslistrc +0 -6
  346. package/.eslintrc.json +0 -13
  347. package/.stylelintrc.json +0 -9
  348. package/MIGRATING.md +0 -70
  349. package/bin/primer-migrate +0 -86
  350. package/build/build.css +0 -23
  351. package/build/build.json +0 -1
  352. package/build/index.js +0 -1
  353. package/dist/marketing-support.css.map +0 -1
  354. package/dist/support.css.map +0 -1
  355. package/fonts/Inter-Medium.woff +0 -0
  356. package/fonts/Inter-Regular.woff +0 -0
  357. package/layout/columns.scss +0 -56
  358. package/marketing/buttons/README.md +0 -39
  359. package/marketing/support/README.md +0 -31
  360. package/marketing/type/README.md +0 -39
  361. package/marketing/utilities/README.md +0 -36
  362. package/marketing/utilities/margin.scss +0 -18
  363. package/marketing/utilities/padding.scss +0 -28
  364. package/postcss.config.js +0 -14
  365. package/prettier.config.js +0 -1
  366. package/support/mixins/buttons.scss +0 -160
  367. package/support/variables/color-system.scss +0 -243
  368. package/support/variables/colors.scss +0 -70
@@ -0,0 +1,47 @@
1
+ .Header {
2
+ z-index: 32; // TODO: Figure out z-index system
3
+ display: flex;
4
+ padding: $spacer-3;
5
+ font-size: $h5-size;
6
+ line-height: $lh-default;
7
+ color: var(--color-header-text);
8
+ background-color: var(--color-header-bg);
9
+ align-items: center;
10
+ flex-wrap: nowrap;
11
+ }
12
+
13
+ .Header-item {
14
+ display: flex;
15
+ margin-right: $spacer-3;
16
+ align-self: stretch;
17
+ align-items: center;
18
+ flex-wrap: nowrap;
19
+ }
20
+
21
+ .Header-item--full {
22
+ flex: auto;
23
+ }
24
+
25
+ .Header-link {
26
+ font-weight: $font-weight-bold;
27
+ color: var(--color-header-logo);
28
+ white-space: nowrap;
29
+
30
+ &:hover,
31
+ &:focus {
32
+ color: var(--color-header-text);
33
+ text-decoration: none;
34
+ }
35
+ }
36
+
37
+ .Header-input {
38
+ color: var(--color-header-text);
39
+ background-color: var(--color-header-search-bg);
40
+ border: $border-width $border-style var(--color-header-search-border);
41
+ box-shadow: none;
42
+
43
+ &::placeholder {
44
+ // stylelint-disable-next-line primer/colors
45
+ color: rgba(255, 255, 255, 0.75);
46
+ }
47
+ }
@@ -0,0 +1,2 @@
1
+ @import '../support/index.scss';
2
+ @import './header.scss';
package/index.scss CHANGED
@@ -1,15 +1,18 @@
1
1
  /*!
2
- * Primer
3
- * http://primer.github.io
2
+ * Primer CSS
3
+ * https://primer.style
4
4
  *
5
- * Released under MIT license. Copyright (c) 2019 GitHub Inc.
5
+ * Released under MIT license.
6
6
  */
7
7
 
8
- // Primer master file
8
+ // Primer main file
9
9
  //
10
10
  // Imports all Primer files in their intended order for easy mass-inclusion.
11
11
  // Should you need specific files, you can easily use separate `@import`s.
12
12
 
13
+ // CSS color variables
14
+ @import "./color-modes/index.scss";
15
+
13
16
  // Global requirements
14
17
  @import "./core/index.scss";
15
18
  @import "./product/index.scss";
package/labels/README.md CHANGED
@@ -1,37 +1,25 @@
1
- # Primer Labels
1
+ ---
2
+ bundle: "labels"
3
+ generated: true
4
+ ---
2
5
 
3
- > Labels add metadata or indicate status of items and navigational elements.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `labels` 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-labels/index.scss";
13
+ @import "@primer/css/labels/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/labels](https://primer.style/css/components/labels).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/labels.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,25 +1,36 @@
1
1
  // Counters are rounded-corner badges for numbers
2
2
  .Counter {
3
3
  display: inline-block;
4
- padding: 2px 5px;
4
+ min-width: $size-2; // makes sure it's a circle with just one digit
5
+ // stylelint-disable-next-line primer/spacing
6
+ padding: 0 6px;
5
7
  font-size: $font-size-small;
6
- font-weight: $font-weight-bold;
7
- line-height: $lh-condensed-ultra;
8
- color: $gray-600;
9
- background-color: rgba($black, 0.08);
10
- border-radius: 20px;
8
+ font-weight: $font-weight-semibold;
9
+ // stylelint-disable-next-line primer/typography
10
+ line-height: $size-2 - 2px; // remove borders
11
+ color: var(--color-fg-default);
12
+ text-align: center;
13
+ background-color: var(--color-neutral-muted);
14
+ border: $border-width $border-style transparent; // Support Firefox custom colors
15
+ // stylelint-disable-next-line primer/borders
16
+ border-radius: 2em;
11
17
 
12
18
  &:empty {
13
- visibility: hidden;
19
+ display: none;
20
+ }
21
+
22
+ .octicon {
23
+ vertical-align: text-top;
24
+ opacity: 0.8;
14
25
  }
15
26
  }
16
27
 
17
- .Counter--gray-light {
18
- color: $text-gray-dark;
19
- background-color: $black-fade-15;
28
+ .Counter--primary {
29
+ color: var(--color-fg-on-emphasis);
30
+ background-color: var(--color-neutral-emphasis);
20
31
  }
21
32
 
22
- .Counter--gray {
23
- color: $white;
24
- background-color: $gray;
33
+ .Counter--secondary {
34
+ color: var(--color-fg-muted);
35
+ background-color: var(--color-neutral-subtle);
25
36
  }
@@ -0,0 +1,37 @@
1
+ // diffstat
2
+ //
3
+ // Green/red blocks showing additions and deletions
4
+
5
+ .diffstat {
6
+ font-size: $h6-size;
7
+ font-weight: $font-weight-bold;
8
+ color: var(--color-fg-muted);
9
+ white-space: nowrap;
10
+ cursor: default;
11
+ }
12
+
13
+ .diffstat-block-deleted,
14
+ .diffstat-block-added,
15
+ .diffstat-block-neutral {
16
+ display: inline-block;
17
+ width: $spacer-2;
18
+ height: $spacer-2;
19
+ // stylelint-disable-next-line primer/spacing
20
+ margin-left: 1px;
21
+ outline-offset: -1px; // Support Firefox custom colors
22
+ }
23
+
24
+ .diffstat-block-deleted {
25
+ background-color: var(--color-danger-emphasis);
26
+ outline: 1px solid var(--color-border-subtle); // Support Firefox custom colors
27
+ }
28
+
29
+ .diffstat-block-added {
30
+ background-color: var(--color-diffstat-addition-bg);
31
+ outline: 1px solid var(--color-border-subtle); // Support Firefox custom colors
32
+ }
33
+
34
+ .diffstat-block-neutral {
35
+ background-color: var(--color-neutral-muted);
36
+ outline: 1px solid var(--color-border-subtle); // Support Firefox custom colors
37
+ }
package/labels/index.scss CHANGED
@@ -1,4 +1,8 @@
1
- @import "../support/index.scss";
2
- @import "./labels.scss";
3
- @import "./states.scss";
4
- @import "./counters.scss";
1
+ @import '../support/index.scss';
2
+ @import './mixins.scss';
3
+
4
+ @import './issue-labels.scss';
5
+ @import './labels.scss';
6
+ @import './states.scss';
7
+ @import './counters.scss';
8
+ @import './diffstat.scss';
@@ -0,0 +1,23 @@
1
+ // Issue Labels
2
+
3
+ // TODO: Replace with .Label once solid backgrounds are supported
4
+
5
+ .IssueLabel {
6
+ @include labels-base;
7
+
8
+ .g-emoji {
9
+ position: relative;
10
+ top: -0.05em;
11
+ display: inline-block;
12
+ font-size: 1em;
13
+ line-height: $lh-condensed-ultra;
14
+ }
15
+
16
+ &:hover {
17
+ text-decoration: none;
18
+ }
19
+ }
20
+
21
+ .IssueLabel--big {
22
+ @include labels-large;
23
+ }
@@ -1,63 +1,82 @@
1
- // Needs refactoring
2
- // stylelint-disable selector-no-qualifying-type
3
- // stylelint-disable selector-max-type
4
1
  // Labels
5
- //
6
- // Use labels to add keyword tags or phrases to issues and pull requests. These
7
- // are used within a list of issues/PRs, on individual issues/PRs, and within
8
- // the select menus that manage them.
9
2
 
10
3
  // Provide a wrapper to ensure labels stick together
11
4
  .labels {
12
5
  position: relative;
13
6
  }
14
7
 
15
- // Each label gets common styles
16
- // .label will be deprecated for .Label
17
- .label,
8
+ // Default label
9
+
10
+ .label, // TODO: Deprecte
18
11
  .Label {
19
- display: inline-block;
20
- padding: 3px $spacer-1;
21
- font-size: $font-size-small;
22
- font-weight: $font-weight-bold;
23
- line-height: $lh-condensed-ultra; // prevent inheritance from changing proportions
24
- color: $text-white;
25
- border-radius: 2px;
26
- box-shadow: inset 0 -1px 0 rgba($black, 0.12);
12
+ @include labels-base;
13
+ background-color: transparent !important; // TODO: Remove again
14
+ border-color: var(--color-border-default);
27
15
 
28
16
  &:hover {
29
17
  text-decoration: none;
30
18
  }
31
19
  }
32
20
 
33
- // Custom GitHub labels (not for issues/PRs/etc)
34
- //
35
- // Commonly used across the site to indicate a particular role. For example,
36
- // "repo owner" within code comments or role in organizations.
37
- .Label--gray {
38
- color: $gray-600;
39
- background-color: lighten($gray-200, 3%);
21
+ // Large
22
+
23
+ .Label--large {
24
+ @include labels-large;
25
+ }
26
+
27
+ // Inline
28
+
29
+ .Label--inline {
30
+ @include labels--inline;
31
+ }
32
+
33
+ // Contrast
34
+
35
+ .Label--primary {
36
+ color: var(--color-fg-default);
37
+ border-color: var(--color-neutral-emphasis);
38
+ }
39
+
40
+ .Label--secondary {
41
+ color: var(--color-fg-muted);
42
+ border-color: var(--color-border-default);
43
+ }
44
+
45
+ // Colors
46
+
47
+ .Label--info, // TODO: deprecate
48
+ .Label--accent {
49
+ color: var(--color-accent-fg);
50
+ border-color: var(--color-accent-emphasis);
51
+ }
52
+
53
+ .Label--success {
54
+ color: var(--color-success-fg);
55
+ border-color: var(--color-success-emphasis);
56
+ }
57
+
58
+ .Label--warning, // TODO: deprecate
59
+ .Label--attention {
60
+ color: var(--color-attention-fg);
61
+ border-color: var(--color-attention-emphasis);
40
62
  }
41
63
 
42
- .Label--outline {
43
- margin-top: -1px; // offsets the 1px border
44
- margin-bottom: -1px; // offsets the 1px border
45
- font-weight: $font-weight-normal;
46
- color: $text-gray;
47
- background-color: transparent;
48
- border: 1px solid $black-fade-15;
49
- box-shadow: none;
64
+ .Label--severe {
65
+ color: var(--color-severe-fg);
66
+ border-color: var(--color-severe-emphasis);
50
67
  }
51
68
 
52
- .Label--outline-green {
53
- color: $text-green;
54
- border: 1px solid $border-green;
69
+ .Label--danger {
70
+ color: var(--color-danger-fg);
71
+ border-color: var(--color-danger-emphasis);
55
72
  }
56
73
 
57
- .Label--gray-darker {
58
- background-color: $gray;
74
+ .Label--done {
75
+ color: var(--color-done-fg);
76
+ border-color: var(--color-done-emphasis);
59
77
  }
60
78
 
61
- .Label--orange {
62
- background-color: $bg-orange;
79
+ .Label--sponsors {
80
+ color: var(--color-sponsors-fg);
81
+ border-color: var(--color-sponsors-emphasis);
63
82
  }
@@ -0,0 +1,32 @@
1
+ // Label mixins
2
+
3
+ // Default: 20px
4
+ // Large: 24px
5
+ // Inline: em based
6
+
7
+ @mixin labels-base {
8
+ display: inline-block;
9
+ padding: 0 7px;
10
+ font-size: $font-size-small;
11
+ font-weight: $font-weight-semibold;
12
+ line-height: 18px;
13
+ border: $border-width $border-style transparent;
14
+ border-radius: 2em;
15
+ }
16
+
17
+ @mixin labels-large {
18
+ padding-right: 10px;
19
+ padding-left: 10px;
20
+ line-height: 22px;
21
+ }
22
+
23
+ // Inline
24
+ //
25
+ // Doesn't increase height of parent element
26
+ // Can be used with different font-sizes
27
+
28
+ @mixin labels--inline {
29
+ display: inline;
30
+ padding: 0.1667em 0.5em;
31
+ font-size: 0.9em;
32
+ }
@@ -1,33 +1,54 @@
1
1
  // A rounded corner box containing a label "open" or "closed"
2
- // The default state is gray.
3
- //
4
- // open - $green background
5
- // reopened - $green background
6
- // closed - $red background
7
- // merged - $purple background
8
-
9
- // .state to be deprecated in replace of .State
10
- .state,
2
+
3
+ // Default 32px
4
+ // Small 24px
5
+
6
+ .state, // TODO: Deprecate
11
7
  .State {
12
8
  display: inline-block;
13
- padding: $spacer-1 $spacer-2;
14
- font-weight: $font-weight-bold;
9
+ // stylelint-disable-next-line primer/spacing
10
+ padding: 5px 12px;
11
+ font-size: $body-font-size;
12
+ font-weight: $font-weight-semibold;
13
+ // stylelint-disable-next-line primer/typography
15
14
  line-height: 20px;
16
- color: $text-white;
17
15
  text-align: center;
18
- background-color: $gray-500;
19
- border-radius: 3px;
16
+ white-space: nowrap;
17
+ // stylelint-disable-next-line primer/borders
18
+ border-radius: 2em;
19
+ }
20
+
21
+ .state, // TODO: Deprecate
22
+ .State,
23
+ .State--draft {
24
+ color: var(--color-fg-on-emphasis);
25
+ background-color: var(--color-neutral-emphasis);
26
+ border: $border-width $border-style transparent;
20
27
  }
21
28
 
22
- .State--green { background-color: darken($green-400, 5%); }
29
+ .State--open {
30
+ color: var(--color-fg-on-emphasis);
31
+ background-color: var(--color-success-emphasis);
32
+ }
33
+
34
+ .State--merged {
35
+ color: var(--color-fg-on-emphasis);
36
+ background-color: var(--color-done-emphasis);
37
+ }
23
38
 
24
- .State--purple { background-color: $bg-purple; }
39
+ .State--closed {
40
+ color: var(--color-fg-on-emphasis);
41
+ background-color: var(--color-danger-emphasis);
42
+ }
25
43
 
26
- .State--red { background-color: $red-600; }
44
+ // Small
27
45
 
28
46
  .State--small {
29
- padding: $em-spacer-2 $spacer-1;
30
- font-size: $h6-size;
47
+ // stylelint-disable-next-line primer/spacing
48
+ padding: 0 10px;
49
+ font-size: $font-size-small;
50
+ // stylelint-disable-next-line primer/typography
51
+ line-height: $size-3;
31
52
 
32
53
  .octicon {
33
54
  width: 1em; // Ensures different icons don't change State indicator width
package/layout/README.md CHANGED
@@ -1,37 +1,25 @@
1
- # Primer Layout
1
+ ---
2
+ bundle: "layout"
3
+ generated: true
4
+ ---
2
5
 
3
- > Primer’s layout includes basic page containers and a single-tiered, fraction-based grid system. That sounds more complicated than it really is though—it’s just containers, rows, and columns.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `layout` 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-layout/index.scss";
13
+ @import "@primer/css/layout/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/objects/layout](https://primer.style/css/objects/layout).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/layout.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,12 +1,4 @@
1
1
  // Fixed-width, centered column for site content.
2
- // This will be deprecated and replaced with container-lg in future
3
- .container {
4
- width: $container-width;
5
- margin-right: auto;
6
- margin-left: auto;
7
- @include clearfix;
8
- }
9
-
10
2
  // Handy container styles that match our breakpoints
11
3
 
12
4
  // 544px
@@ -4,16 +4,16 @@
4
4
 
5
5
  @each $breakpoint, $variant in $responsive-variants {
6
6
  @include breakpoint($breakpoint) {
7
- .offset#{$variant}-1 { margin-left: (1 / 12 * 100%) !important; }
8
- .offset#{$variant}-2 { margin-left: (2 / 12 * 100%) !important; }
9
- .offset#{$variant}-3 { margin-left: (3 / 12 * 100%) !important; }
10
- .offset#{$variant}-4 { margin-left: (4 / 12 * 100%) !important; }
11
- .offset#{$variant}-5 { margin-left: (5 / 12 * 100%) !important; }
12
- .offset#{$variant}-6 { margin-left: (6 / 12 * 100%) !important; }
13
- .offset#{$variant}-7 { margin-left: (7 / 12 * 100%) !important; }
14
- .offset#{$variant}-8 { margin-left: (8 / 12 * 100%) !important; }
15
- .offset#{$variant}-9 { margin-left: (9 / 12 * 100%) !important; }
16
- .offset#{$variant}-10 { margin-left: (10 / 12 * 100%) !important; }
17
- .offset#{$variant}-11 { margin-left: (11 / 12 * 100%) !important; }
7
+ .offset#{$variant}-1 { margin-left: (1 * 0.0833333333 * 100%) !important; }
8
+ .offset#{$variant}-2 { margin-left: (2 * 0.0833333333 * 100%) !important; }
9
+ .offset#{$variant}-3 { margin-left: (3 * 0.0833333333 * 100%) !important; }
10
+ .offset#{$variant}-4 { margin-left: (4 * 0.0833333333 * 100%) !important; }
11
+ .offset#{$variant}-5 { margin-left: (5 * 0.0833333333 * 100%) !important; }
12
+ .offset#{$variant}-6 { margin-left: (6 * 0.0833333333 * 100%) !important; }
13
+ .offset#{$variant}-7 { margin-left: (7 * 0.0833333333 * 100%) !important; }
14
+ .offset#{$variant}-8 { margin-left: (8 * 0.0833333333 * 100%) !important; }
15
+ .offset#{$variant}-9 { margin-left: (9 * 0.0833333333 * 100%) !important; }
16
+ .offset#{$variant}-10 { margin-left: (10 * 0.0833333333 * 100%) !important; }
17
+ .offset#{$variant}-11 { margin-left: (11 * 0.0833333333 * 100%) !important; }
18
18
  }
19
19
  }
package/layout/grid.scss CHANGED
@@ -1,32 +1,32 @@
1
1
  // GRID
2
2
 
3
3
  // Columns
4
- .col-1 { width: (1 / 12 * 100%); }
5
- .col-2 { width: (2 / 12 * 100%); }
6
- .col-3 { width: (3 / 12 * 100%); }
7
- .col-4 { width: (4 / 12 * 100%); }
8
- .col-5 { width: (5 / 12 * 100%); }
9
- .col-6 { width: (6 / 12 * 100%); }
10
- .col-7 { width: (7 / 12 * 100%); }
11
- .col-8 { width: (8 / 12 * 100%); }
12
- .col-9 { width: (9 / 12 * 100%); }
13
- .col-10 { width: (10 / 12 * 100%); }
14
- .col-11 { width: (11 / 12 * 100%); }
4
+ .col-1 { width: (1 * 0.0833333333 * 100%); }
5
+ .col-2 { width: (2 * 0.0833333333 * 100%); }
6
+ .col-3 { width: (3 * 0.0833333333 * 100%); }
7
+ .col-4 { width: (4 * 0.0833333333 * 100%); }
8
+ .col-5 { width: (5 * 0.0833333333 * 100%); }
9
+ .col-6 { width: (6 * 0.0833333333 * 100%); }
10
+ .col-7 { width: (7 * 0.0833333333 * 100%); }
11
+ .col-8 { width: (8 * 0.0833333333 * 100%); }
12
+ .col-9 { width: (9 * 0.0833333333 * 100%); }
13
+ .col-10 { width: (10 * 0.0833333333 * 100%); }
14
+ .col-11 { width: (11 * 0.0833333333 * 100%); }
15
15
  .col-12 { width: 100%; }
16
16
 
17
17
  @each $breakpoint in map-keys($breakpoints) {
18
18
  @include breakpoint($breakpoint) {
19
- .col-#{$breakpoint}-1 { width: ( 1 / 12 * 100%); }
20
- .col-#{$breakpoint}-2 { width: ( 2 / 12 * 100%); }
21
- .col-#{$breakpoint}-3 { width: ( 3 / 12 * 100%); }
22
- .col-#{$breakpoint}-4 { width: ( 4 / 12 * 100%); }
23
- .col-#{$breakpoint}-5 { width: ( 5 / 12 * 100%); }
24
- .col-#{$breakpoint}-6 { width: ( 6 / 12 * 100%); }
25
- .col-#{$breakpoint}-7 { width: ( 7 / 12 * 100%); }
26
- .col-#{$breakpoint}-8 { width: ( 8 / 12 * 100%); }
27
- .col-#{$breakpoint}-9 { width: ( 9 / 12 * 100%); }
28
- .col-#{$breakpoint}-10 { width: ( 10 / 12 * 100%); }
29
- .col-#{$breakpoint}-11 { width: ( 11 / 12 * 100%); }
19
+ .col-#{$breakpoint}-1 { width: ( 1 * 0.0833333333 * 100%); }
20
+ .col-#{$breakpoint}-2 { width: ( 2 * 0.0833333333 * 100%); }
21
+ .col-#{$breakpoint}-3 { width: ( 3 * 0.0833333333 * 100%); }
22
+ .col-#{$breakpoint}-4 { width: ( 4 * 0.0833333333 * 100%); }
23
+ .col-#{$breakpoint}-5 { width: ( 5 * 0.0833333333 * 100%); }
24
+ .col-#{$breakpoint}-6 { width: ( 6 * 0.0833333333 * 100%); }
25
+ .col-#{$breakpoint}-7 { width: ( 7 * 0.0833333333 * 100%); }
26
+ .col-#{$breakpoint}-8 { width: ( 8 * 0.0833333333 * 100%); }
27
+ .col-#{$breakpoint}-9 { width: ( 9 * 0.0833333333 * 100%); }
28
+ .col-#{$breakpoint}-10 { width: ( 10 * 0.0833333333 * 100%); }
29
+ .col-#{$breakpoint}-11 { width: ( 11 * 0.0833333333 * 100%); }
30
30
  .col-#{$breakpoint}-12 { width: 100%; }
31
31
  }
32
32
  }
@@ -37,7 +37,7 @@
37
37
  margin-right: -$gutter-width;
38
38
  margin-left: -$gutter-width;
39
39
 
40
- > [class*="col-"] {
40
+ > [class*='col-'] {
41
41
  padding-right: $gutter-width !important;
42
42
  padding-left: $gutter-width !important;
43
43
  }
package/layout/index.scss CHANGED
@@ -1,5 +1,8 @@
1
- @import "../support/index.scss";
2
- @import "./container.scss";
3
- @import "./columns.scss";
4
- @import "./grid.scss";
5
- @import "./grid-offset.scss";
1
+ @import '../support/index.scss';
2
+ @import './mixins.scss';
3
+
4
+ @import './container.scss';
5
+ @import './grid.scss';
6
+ @import './grid-offset.scss';
7
+ @import './layout.scss';
8
+ @import './layout-beta.scss';