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

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 +1225 -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 +317 -274
  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 +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 +44 -35
  284. package/navigation/sidenav.scss +108 -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 -107
  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 +9 -12
  313. package/support/mixins/typography.scss +1 -1
  314. package/support/variables/layout.scss +106 -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 +124 -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 +29 -65
  334. package/utilities/box-shadow.scss +8 -9
  335. package/utilities/colors.scss +71 -110
  336. package/utilities/details.scss +12 -4
  337. package/utilities/flexbox.scss +14 -14
  338. package/utilities/index.scss +12 -12
  339. package/utilities/layout.scss +28 -22
  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
package/support/README.md CHANGED
@@ -1,31 +1,25 @@
1
- # Primer Support
1
+ ---
2
+ bundle: "support"
3
+ generated: true
4
+ ---
2
5
 
3
- > Support files are Sass variables, mixins, and functions that we import into different bases for use across components, objects, and utilities. Sharing these common properties across GitHub sites helps us to keep our styles more consistent.
4
- >
5
- > Most of the time to include these you'll only need to add `@import "support/support";` to the top of your bundle. If you want only a specific partial you can import them separately.
6
-
7
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `support` bundle
8
7
 
9
8
  ## Usage
10
9
 
11
- 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:
12
11
 
13
12
  ```scss
14
- @import "primer-support/index.scss";
13
+ @import "@primer/css/support/index.scss";
15
14
  ```
16
15
 
17
- 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._
18
-
19
- ## Documentation
16
+ ## Build
20
17
 
21
- Find further documentation at [primer.style/css/support](https://primer.style/css/support).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/support.css`.
22
19
 
23
20
  ## License
24
21
 
25
- [MIT](./LICENSE) © [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
26
24
 
27
- [primer]: https://github.com/primer/css
28
- [docs]: https://primer.style/css/support
29
- [npm]: https://www.npmjs.com/
30
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
31
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1,11 +1,10 @@
1
1
  // variables
2
- @import "./variables/typography.scss";
3
- @import "./variables/colors.scss";
4
- @import "./variables/layout.scss";
5
- @import "./variables/misc.scss";
2
+ @import './variables/typography.scss';
3
+ @import './variables/layout.scss';
4
+ @import './variables/misc.scss';
6
5
 
7
6
  // mixins
8
- @import "./mixins/typography.scss";
9
- @import "./mixins/layout.scss";
10
- @import "./mixins/buttons.scss";
11
- @import "./mixins/misc.scss";
7
+ @import './mixins/color-modes.scss';
8
+ @import './mixins/typography.scss';
9
+ @import './mixins/layout.scss';
10
+ @import './mixins/misc.scss';
@@ -0,0 +1,106 @@
1
+ @mixin color-mode-theme($theme-name, $include-root: false) {
2
+ @if $include-root {
3
+ :root,
4
+ [data-color-mode="light"][data-light-theme="#{$theme-name}"],
5
+ [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
6
+ @content;
7
+
8
+ /*! */ // This is a fix for a cssstats bug see https://github.com/cssstats/cssstats/issues/331
9
+ }
10
+ }
11
+ @else {
12
+ [data-color-mode="light"][data-light-theme="#{$theme-name}"],
13
+ [data-color-mode="dark"][data-dark-theme="#{$theme-name}"] {
14
+ @content;
15
+ }
16
+ }
17
+
18
+ @media (prefers-color-scheme: light) {
19
+ [data-color-mode="auto"][data-light-theme="#{$theme-name}"] {
20
+ @content;
21
+ }
22
+ }
23
+
24
+ @media (prefers-color-scheme: dark) {
25
+ [data-color-mode="auto"][data-dark-theme="#{$theme-name}"] {
26
+ @content;
27
+ }
28
+ }
29
+ }
30
+
31
+ @mixin color-mode($mode) {
32
+ @if $mode == light {
33
+ :root,
34
+ [data-color-mode="light"][data-light-theme*="#{$mode}"],
35
+ [data-color-mode="dark"][data-dark-theme*="#{$mode}"] {
36
+ @content;
37
+ }
38
+ }
39
+ @else {
40
+ [data-color-mode="light"][data-light-theme*="#{$mode}"],
41
+ [data-color-mode="dark"][data-dark-theme*="#{$mode}"] {
42
+ @content;
43
+ }
44
+ }
45
+
46
+ @media (prefers-color-scheme: light) {
47
+ [data-color-mode="auto"][data-light-theme*="#{$mode}"] {
48
+ @content;
49
+ }
50
+ }
51
+
52
+ @media (prefers-color-scheme: dark) {
53
+ [data-color-mode="auto"][data-dark-theme*="#{$mode}"] {
54
+ @content;
55
+ }
56
+ }
57
+ }
58
+
59
+ // This mixin takes a map of color mode vars and splits them into dark and light mode
60
+ // The goal is to reduce the amount of dark/light mode selectors compiled.
61
+ //
62
+ // Example input for $color-map
63
+ //
64
+ // @include color-variables(("custom-css-variable-1": (
65
+ // light: var(--color-scale-gray-3),
66
+ // dark: var(--color-scale-gray-5)
67
+ // ),
68
+ // "custom-css-variable-2": (
69
+ // light: var(--color-scale-gray-2),
70
+ // dark: var(--color-scale-gray-6)
71
+ // ),
72
+ // "custom-css-variable-3": (
73
+ // light: var(--color-scale-gray-2),
74
+ // dark: var(--color-scale-gray-6)
75
+ // )
76
+ // ));
77
+ @mixin color-variables($color-map) {
78
+ // Create map to store incoming variables
79
+ $dark-colors: ();
80
+ $light-colors: ();
81
+
82
+ @each $name, $value in $color-map {
83
+ @each $type, $color in $value {
84
+ @if $type == dark {
85
+ $dark-colors: append($dark-colors, (--color-#{$name}, #{$color}));
86
+ }
87
+ @else {
88
+ $light-colors: append($light-colors, (--color-#{$name}, #{$color}));
89
+ }
90
+ }
91
+ }
92
+
93
+ $mode-colors: (
94
+ dark: $dark-colors,
95
+ light: $light-colors
96
+ );
97
+
98
+ // Loop through sorted list
99
+ @each $mode, $variables in $mode-colors {
100
+ @include color-mode($mode) {
101
+ @each $prop, $val in $variables {
102
+ #{$prop}: $val;
103
+ }
104
+ }
105
+ }
106
+ }
@@ -1,29 +1,26 @@
1
1
  // Generate a two-color caret for any element.
2
- @mixin double-caret($foreground: $text-white, $background: lighten($gray-300, 5%)) {
2
+ @mixin double-caret($background: var(--color-canvas-default), $border: var(--color-border-default)) {
3
3
  &::after,
4
4
  &::before {
5
5
  position: absolute;
6
6
  top: 11px;
7
7
  right: 100%;
8
- left: -16px;
8
+ left: -8px;
9
9
  display: block;
10
- width: 0;
11
- height: 0;
10
+ width: 8px;
11
+ height: 16px;
12
12
  pointer-events: none;
13
13
  content: " ";
14
- border-color: transparent;
15
- border-style: solid solid outset;
14
+ clip-path: polygon(0 50%, 100% 0, 100% 100%);
16
15
  }
17
16
 
18
17
  &::after {
19
- margin-top: 1px;
20
- margin-left: 2px;
21
- border-width: 7px;
22
- border-right-color: $foreground;
18
+ margin-left: 1px;
19
+ background-color: var(--color-canvas-default);
20
+ background-image: linear-gradient($background, $background);
23
21
  }
24
22
 
25
23
  &::before {
26
- border-width: 8px;
27
- border-right-color: $background;
24
+ background-color: $border;
28
25
  }
29
26
  }
@@ -40,7 +40,7 @@
40
40
  }
41
41
 
42
42
  // Responsive heading mixins
43
- // There are no responsive mixins for h4h6 because they are small
43
+ // There are no responsive mixins for h4-h6 because they are small
44
44
  // and don't need to be smaller on mobile.
45
45
  @mixin f1-responsive {
46
46
  font-size: $h1-size-mobile;
@@ -1,5 +1,24 @@
1
1
  // Layout variables
2
- // stylelint-disable declaration-bang-space-before
2
+
3
+ // these are values for the display CSS property
4
+ $display-values: (
5
+ block,
6
+ flex,
7
+ inline,
8
+ inline-block,
9
+ inline-flex,
10
+ none,
11
+ table,
12
+ table-cell
13
+ ) !default;
14
+
15
+ // maps edges to respective corners for border-radius
16
+ $edges: (
17
+ top: (top-left, top-right),
18
+ right: (top-right, bottom-right),
19
+ bottom: (bottom-right, bottom-left),
20
+ left: (bottom-left, top-left)
21
+ ) !default;
3
22
 
4
23
  // These are our margin and padding utility spacers. The default step size we
5
24
  // use is 8px. This gives us a key of:
@@ -14,7 +33,7 @@ $spacer: 8px !default;
14
33
 
15
34
  // Our spacing scale
16
35
  $spacer-0: 0 !default; // 0
17
- $spacer-1: round($spacer / 2) !default; // 4px
36
+ $spacer-1: $spacer * 0.5 !default; // 4px
18
37
  $spacer-2: $spacer !default; // 8px
19
38
  $spacer-3: $spacer * 2 !default; // 16px
20
39
  $spacer-4: $spacer * 3 !default; // 24px
@@ -44,6 +63,38 @@ $spacer-map: (
44
63
  6: $spacer-6,
45
64
  ) !default;
46
65
 
66
+ // Increases the core spacing scale first by 8px for $spacer-7, then by 16px
67
+ // increments from $spacer-8 to $spacer-12, i.e. after 40px, we have 48, 64,
68
+ // 80, 96, etc.
69
+ $spacer-7: $spacer * 6 !default; // 48px
70
+ $spacer-8: $spacer * 8 !default; // 64px
71
+ $spacer-9: $spacer * 10 !default; // 80px
72
+ $spacer-10: $spacer * 12 !default; // 96px
73
+ $spacer-11: $spacer * 14 !default; // 112px
74
+ $spacer-12: $spacer * 16 !default; // 128px
75
+
76
+ $spacers-large: (
77
+ 7: $spacer-7,
78
+ 8: $spacer-8,
79
+ 9: $spacer-9,
80
+ 10: $spacer-10,
81
+ 11: $spacer-11,
82
+ 12: $spacer-12,
83
+ ) !default;
84
+
85
+ $spacer-map-extended: map-merge(
86
+ (
87
+ 0: 0,
88
+ 1: $spacer-1,
89
+ 2: $spacer-2,
90
+ 3: $spacer-3,
91
+ 4: $spacer-4,
92
+ 5: $spacer-5,
93
+ 6: $spacer-6,
94
+ ),
95
+ $spacers-large,
96
+ ) !default;
97
+
47
98
  // Em spacer variables
48
99
  $em-spacer-1: 0.0625em !default; // 1/16
49
100
  $em-spacer-2: 0.125em !default; // 1/8
@@ -52,6 +103,20 @@ $em-spacer-4: 0.375em !default; // 3/8
52
103
  $em-spacer-5: 0.5em !default; // 1/2
53
104
  $em-spacer-6: 0.75em !default; // 3/4
54
105
 
106
+ // Size scale
107
+ // Used for buttons, inputs, labels, avatars etc.
108
+ $size: 16px !default;
109
+
110
+ $size-0: 0 !default;
111
+ $size-1: $size !default; // 16px
112
+ $size-2: $size-1 + 4px !default; // 20px
113
+ $size-3: $size-2 + 4px !default; // 24px
114
+ $size-4: $size-3 + 4px !default; // 28px
115
+ $size-5: $size-4 + 4px !default; // 32px
116
+ $size-6: $size-5 + 8px !default; // 40px
117
+ $size-7: $size-6 + 8px !default; // 48px
118
+ $size-8: $size-7 + 16px !default; // 64px
119
+
55
120
  // Fixed-width container variables
56
121
  $container-width: 980px !default;
57
122
  $grid-gutter: 10px !default;
@@ -84,14 +149,6 @@ $breakpoints: (
84
149
  // This map in the form (breakpoint: variant) is used to iterate over
85
150
  // breakpoints and create both responsive and non-responsive classes in one
86
151
  // loop:
87
- //
88
- // ```scss
89
- // @each $breakpoint, $variant of $responsive-variants {
90
- // @include breakpoint($breakpoint) {
91
- // .foo#{$variant}-bar { foo: bar !important; }
92
- // }
93
- // }
94
- // ```
95
152
  $responsive-variants: (
96
153
  "": "",
97
154
  sm: "-sm",
@@ -105,5 +162,43 @@ $responsive-positions: (
105
162
  static,
106
163
  relative,
107
164
  absolute,
108
- fixed
165
+ fixed,
166
+ sticky
167
+ ) !default;
168
+
169
+ $sidebar-width: (
170
+ sm: 220px,
171
+ md: 256px,
172
+ lg: 296px,
173
+ xl: 320px
174
+ ) !default;
175
+
176
+ $sidebar-narrow-width: (
177
+ md: 240px,
178
+ lg: 256px,
179
+ xl: 296px
180
+ ) !default;
181
+
182
+ $sidebar-wide-width: (
183
+ md: 296px,
184
+ lg: 320px,
185
+ xl: 344px
186
+ ) !default;
187
+
188
+ $gutter: (
189
+ md: $spacer-3,
190
+ lg: $spacer-4,
191
+ xl: $spacer-5
192
+ ) !default;
193
+
194
+ $gutter-condensed: (
195
+ md: $spacer-3,
196
+ lg: $spacer-3,
197
+ xl: $spacer-4
198
+ ) !default;
199
+
200
+ $gutter-spacious: (
201
+ md: $spacer-4,
202
+ lg: $spacer-5,
203
+ xl: $spacer-6
109
204
  ) !default;
@@ -1,40 +1,17 @@
1
1
  // Miscellaneous variables
2
- // stylelint-disable declaration-bang-space-before
3
2
 
4
- // Border size
3
+ // Border
5
4
  $border-width: 1px !default;
6
- $border-color: $border-gray !default;
7
5
  $border-style: solid !default;
8
- $border: $border-width $border-color $border-style !default;
9
- $border-radius: 3px !default;
6
+ $border: $border-width $border-style var(--color-border-default) !default;
10
7
 
11
- // Custom explore grid border
12
- $exploregrid-item-border-radius: 4px;
13
-
14
- // Box shadow
15
- $box-shadow: 0 1px 1px rgba($black, 0.1) !default;
16
- $box-shadow-medium: 0 1px 5px $black-fade-15 !default;
17
- $box-shadow-large: 0 1px 15px $black-fade-15 !default;
18
- $box-shadow-extra-large: 0 10px 50px rgba($black, 0.07) !default;
8
+ // Border Radius
9
+ $border-radius-1: 4px !default;
10
+ $border-radius-2: 6px !default;
11
+ $border-radius-3: 8px !default;
12
+ $border-radius: $border-radius-2 !default;
19
13
 
20
14
  // Tooltips
21
15
  $tooltip-max-width: 250px !default;
22
- $tooltip-background-color: $black;
23
- $tooltip-text-color: $white !default;
24
16
  $tooltip-delay: 0.4s !default;
25
17
  $tooltip-duration: 0.1s !default;
26
-
27
- // Should be moved into custom github css
28
- $stats-switcher-py: 10px;
29
- // Future proof this `height` value by finding the computed line-height, then
30
- // adding the total value of the vertical padding. This var is used to toggle
31
- // between the stats bar and language breakdown.
32
- $stats-viewport-height: ($body-font-size * $body-line-height) + ($stats-switcher-py * 2);
33
-
34
- $min_tab_size: 1;
35
- $max_tab_size: 12;
36
-
37
- // Button and form variables
38
- $form-control-shadow: inset 0 1px 2px rgba($black, 0.075);
39
- $btn-input-focus-shadow: 0 0 0 0.2em rgba($blue, 0.3);
40
- $btn-active-shadow: inset 0 0.15em 0.3em $black-fade-15;
@@ -1,8 +1,7 @@
1
1
  // Typography variables
2
- // stylelint-disable declaration-bang-space-before
3
2
 
4
3
  // Heading sizes - mobile
5
- // h4h6 remain the same size on both mobile & desktop
4
+ // h4-h6 remain the same size on both mobile & desktop
6
5
  $h00-size-mobile: 40px !default;
7
6
  $h0-size-mobile: 32px !default;
8
7
  $h1-size-mobile: 26px !default;
@@ -33,10 +32,11 @@ $lh-condensed: 1.25 !default;
33
32
  $lh-default: 1.5 !default;
34
33
 
35
34
  // Font stacks
36
- $body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
35
+ $body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !default;
37
36
 
38
37
  // Monospace font stack
39
- $mono-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace !default;
38
+ // Note: SFMono-Regular needs to come before SF Mono to fix an older version of the font in Chrome
39
+ $mono-font: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace !default;
40
40
 
41
41
  // The base body size
42
42
  $body-font-size: 14px !default;
@@ -1,38 +1,25 @@
1
- # Primer table object
1
+ ---
2
+ bundle: "table-object"
3
+ generated: true
4
+ ---
2
5
 
3
- > Table object is a module for creating dynamically resizable elements that always sit on the same horizontal line (e.g., they never break to a new line). Using table styles in our CSS means it’s cross browser friendly back to at least IE9.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `table-object` 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-table-object/index.scss";
13
+ @import "@primer/css/table-object/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/table-object](https://primer.style/css/objects/table-object).
28
-
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/table-object.css`.
29
19
 
30
20
  ## License
31
21
 
32
- [MIT](./LICENSE) © [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
33
24
 
34
- [primer]: https://github.com/primer/css
35
- [docs]: https://primer.style/css
36
- [npm]: https://www.npmjs.com/
37
- [install-npm]: https://docs.npmjs.com/getting-started/installing-node
38
- [sass]: http://sass-lang.com/
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -1 +1 @@
1
- @import "./table-object.scss";
1
+ @import './table-object.scss';
@@ -0,0 +1,25 @@
1
+ ---
2
+ bundle: "timeline"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `timeline` bundle
7
+
8
+ ## Usage
9
+
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:
11
+
12
+ ```scss
13
+ @import "@primer/css/timeline/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/timeline.css`.
19
+
20
+ ## License
21
+
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
24
+
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,2 @@
1
+ @import '../support/index.scss';
2
+ @import './timeline-item.scss';
@@ -0,0 +1,95 @@
1
+ .TimelineItem {
2
+ position: relative;
3
+ display: flex;
4
+ padding: $spacer-3 0;
5
+ margin-left: $spacer-3;
6
+
7
+ // The Timeline
8
+ &::before {
9
+ position: absolute;
10
+ top: 0;
11
+ bottom: 0;
12
+ left: 0;
13
+ display: block;
14
+ width: 2px;
15
+ content: '';
16
+ background-color: var(--color-border-muted);
17
+ }
18
+
19
+ &:target .TimelineItem-badge {
20
+ border-color: var(--color-accent-emphasis);
21
+ // stylelint-disable-next-line primer/box-shadow
22
+ box-shadow: 0 0 0.2em var(--color-accent-muted);
23
+ }
24
+ }
25
+
26
+ .TimelineItem-badge {
27
+ position: relative;
28
+ z-index: 1;
29
+ display: flex;
30
+ width: $spacer-5;
31
+ height: $spacer-5;
32
+ margin-right: $spacer-2;
33
+ margin-left: -$spacer-3 + 1;
34
+ color: var(--color-fg-muted);
35
+ align-items: center;
36
+ background-color: var(--color-timeline-badge-bg);
37
+ // stylelint-disable-next-line primer/borders
38
+ border: 2px $border-style var(--color-canvas-default);
39
+ border-radius: 50%;
40
+ justify-content: center;
41
+ flex-shrink: 0;
42
+
43
+ &--success {
44
+ color: var(--color-fg-on-emphasis);
45
+ background-color: var(--color-success-emphasis);
46
+ border: $border-width $border-style transparent;
47
+ }
48
+ }
49
+
50
+ .TimelineItem-body {
51
+ min-width: 0;
52
+ max-width: 100%;
53
+ margin-top: $spacer-1;
54
+ color: var(--color-fg-muted);
55
+ flex: auto;
56
+ }
57
+
58
+ .TimelineItem-avatar {
59
+ position: absolute;
60
+ left: -($spacer-6 + $spacer-5);
61
+ z-index: 1;
62
+ }
63
+
64
+ .TimelineItem-break {
65
+ position: relative;
66
+ z-index: 1;
67
+ height: $spacer-4;
68
+ margin: 0;
69
+ margin-bottom: -$spacer-3;
70
+ // stylelint-disable-next-line primer/spacing
71
+ margin-left: -($spacer-6 + $spacer-3);
72
+ background-color: var(--color-canvas-default);
73
+ border: 0;
74
+ // stylelint-disable-next-line primer/borders
75
+ border-top: 4px $border-style var(--color-border-default);
76
+ }
77
+
78
+ .TimelineItem--condensed {
79
+ padding-top: $spacer-1;
80
+ padding-bottom: 0;
81
+
82
+ // TimelineItem--condensed is often grouped. (commits)
83
+ &:last-child {
84
+ padding-bottom: $spacer-3;
85
+ }
86
+
87
+ .TimelineItem-badge {
88
+ height: $spacer-3;
89
+ margin-top: $spacer-2;
90
+ margin-bottom: $spacer-2;
91
+ color: var(--color-fg-muted);
92
+ background-color: var(--color-canvas-default);
93
+ border: 0;
94
+ }
95
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ bundle: "toasts"
3
+ generated: true
4
+ ---
5
+
6
+ # Primer CSS: `toasts` bundle
7
+
8
+ ## Usage
9
+
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:
11
+
12
+ ```scss
13
+ @import "@primer/css/toasts/index.scss";
14
+ ```
15
+
16
+ ## Build
17
+
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/toasts.css`.
19
+
20
+ ## License
21
+
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
23
+
24
+
25
+ [scss]: https://sass-lang.com/documentation/syntax#scss
@@ -0,0 +1,2 @@
1
+ @import '../support/index.scss';
2
+ @import './toasts.scss';