@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
@@ -1,67 +1,126 @@
1
- $marketing-font-path: "/primer-marketing-support/fonts/" !default;
1
+ // stylelint-disable unit-no-unknown
2
+ // Typography
3
+ $marketing-font-path: "/fonts/" !default;
2
4
 
3
- // Type
4
- @font-face {
5
- font-family: Inter;
6
- font-style: normal;
7
- font-weight: $font-weight-normal;
8
- src: local("Inter"), local("Inter-Regular"), url("#{$marketing-font-path}Inter-Regular.woff") format("woff");
9
- }
5
+ $font-mktg: $body-font !default;
6
+ $font-weight-medium: 450 !default;
7
+ $font-weight-extrabold: 800 !default;
10
8
 
11
- @font-face {
12
- font-family: Inter;
13
- font-style: normal;
14
- font-weight: $font-weight-semibold;
15
- src: local("Inter Medium"), local("Inter-Medium"), url("#{$marketing-font-path}Inter-Medium.woff") format("woff");
16
- }
9
+ $mktg-font-feature-settings: 'ss02' on, 'ss01' on !default;
10
+ $mktg-header-spacing-large: -0.03em !default;
11
+ $mktg-header-spacing-default: -0.01em !default;
12
+ $mktg-header-spacing-threshold: 48px !default;
13
+ $mktg-header-weight-large: $font-weight-extrabold !default;
14
+ $mktg-header-weight-default: $font-weight-bold !default;
15
+ $mktg-header-weight-threshold: 24px !default;
17
16
 
18
- $font-mktg: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
17
+ // Header size steps
18
+ $mktg-h-size-0: 96px !default;
19
+ $mktg-h-size-1: 72px !default;
20
+ $mktg-h-size-2: 64px !default;
21
+ $mktg-h-size-3: 56px !default;
22
+ $mktg-h-size-4: 48px !default;
23
+ $mktg-h-size-5: 40px !default;
24
+ $mktg-h-size-6: 32px !default;
25
+ $mktg-h-size-7: 28px !default;
26
+ $mktg-h-size-8: 24px !default;
27
+ $mktg-h-size-9: 20px !default;
28
+ $mktg-h-size-10: 16px !default;
19
29
 
20
- // Builds upon primer-support/variables/typography.scss
21
- $h000-size: 64px !default;
22
- $h000-size-mobile: 48px !default;
30
+ // Header Line-height steps
31
+ $mktg-h-lh-0: 100px !default;
32
+ $mktg-h-lh-1: 76px !default;
33
+ $mktg-h-lh-2: 68px !default;
34
+ $mktg-h-lh-3: 60px !default;
35
+ $mktg-h-lh-4: 52px !default;
36
+ $mktg-h-lh-5: 44px !default;
37
+ $mktg-h-lh-6: 36px !default;
38
+ $mktg-h-lh-7: 32px !default;
39
+ $mktg-h-lh-8: 28px !default;
40
+ $mktg-h-lh-9: 24px !default;
41
+ $mktg-h-lh-10: 20px !default;
23
42
 
24
- // Colors
25
- $green-mktg: mix($green-500, $green-400, 50%);
26
- $blue-mktg: mix($blue-400, $blue-500, 42%);
43
+ $mktg-header-pairings: (
44
+ 0: (size: $mktg-h-size-0, lh: $mktg-h-lh-0),
45
+ 1: (size: $mktg-h-size-1, lh: $mktg-h-lh-1),
46
+ 2: (size: $mktg-h-size-2, lh: $mktg-h-lh-2),
47
+ 3: (size: $mktg-h-size-3, lh: $mktg-h-lh-3),
48
+ 4: (size: $mktg-h-size-4, lh: $mktg-h-lh-4),
49
+ 5: (size: $mktg-h-size-5, lh: $mktg-h-lh-5),
50
+ 6: (size: $mktg-h-size-6, lh: $mktg-h-lh-6),
51
+ 7: (size: $mktg-h-size-7, lh: $mktg-h-lh-7),
52
+ 8: (size: $mktg-h-size-8, lh: $mktg-h-lh-8),
53
+ 9: (size: $mktg-h-size-9, lh: $mktg-h-lh-9),
54
+ 10: (size: $mktg-h-size-10, lh: $mktg-h-lh-10)
55
+ ) !default;
27
56
 
28
- // Animations
29
- $transition-time: 0.4s;
57
+ // Responsive headers, where first number is mobile (default), second is tablet/md, and third is desktop/lg
58
+ $mktg-headers: (
59
+ 0: [4, 1, 0],
60
+ 1: [5, 3, 1],
61
+ 2: [6, 4, 2],
62
+ 3: [7, 5, 4],
63
+ 4: [8, 7, 6],
64
+ 5: [9, 8, 8],
65
+ 6: [10, 9, 9]
66
+ ) !default;
67
+
68
+ // Body content
69
+ $mktg-body-spacing-threshold: 28px !default;
70
+ $mktg-body-weight-threshold: 24px !default;
71
+ $mktg-body-spacing-large: -0.01em !default;
30
72
 
31
- // Increases primer-core scale first by 8px for spacer-7 then by 16px step increments for spacer-8 to spacer-12
32
- // i.e. After 40px, we have 48, 64, 80, 96, etc.
33
- $spacer-7: $spacer * 6 !default; // 48px
34
- $spacer-8: $spacer * 8 !default; // 64px
35
- $spacer-9: $spacer * 10 !default; // 80px
36
- $spacer-10: $spacer * 12 !default; // 96px
37
- $spacer-11: $spacer * 14 !default; // 112px
38
- $spacer-12: $spacer * 16 !default; // 128px
73
+ // Body size steps
74
+ $mktg-body-size-0: 48px !default;
75
+ $mktg-body-size-1: 40px !default;
76
+ $mktg-body-size-2: 32px !default;
77
+ $mktg-body-size-3: 28px !default;
78
+ $mktg-body-size-4: 24px !default;
79
+ $mktg-body-size-5: 20px !default;
80
+ $mktg-body-size-6: 16px !default;
81
+ $mktg-body-size-7: 14px !default;
82
+ $mktg-body-size-8: 12px !default;
39
83
 
40
- $marketingSpacers: $spacer-7, $spacer-8, $spacer-9, $spacer-10, $spacer-11, $spacer-12;
41
- $allSpacers: $spacer-1, $spacer-2, $spacer-3, $spacer-4, $spacer-5, $spacer-6, $spacer-7, $spacer-8, $spacer-9, $spacer-10, $spacer-11, $spacer-12;
84
+ // Body line-height steps
85
+ $mktg-body-lh-0: 64px !default;
86
+ $mktg-body-lh-1: 52px !default;
87
+ $mktg-body-lh-2: 44px !default;
88
+ $mktg-body-lh-3: 40px !default;
89
+ $mktg-body-lh-4: 32px !default;
90
+ $mktg-body-lh-5: 28px !default;
91
+ $mktg-body-lh-6: 24px !default;
92
+ $mktg-body-lh-7: 20px !default;
93
+ $mktg-body-lh-8: 20px !default;
42
94
 
43
- $marketing-spacers: (
44
- 7: $spacer-7,
45
- 8: $spacer-8,
46
- 9: $spacer-9,
47
- 10: $spacer-10,
48
- 11: $spacer-11,
49
- 12: $spacer-12,
95
+ $mktg-body-pairings: (
96
+ 0: (size: $mktg-body-size-0, lh: $mktg-body-lh-0),
97
+ 1: (size: $mktg-body-size-1, lh: $mktg-body-lh-1),
98
+ 2: (size: $mktg-body-size-2, lh: $mktg-body-lh-2),
99
+ 3: (size: $mktg-body-size-3, lh: $mktg-body-lh-3),
100
+ 4: (size: $mktg-body-size-4, lh: $mktg-body-lh-4),
101
+ 5: (size: $mktg-body-size-5, lh: $mktg-body-lh-5),
102
+ 6: (size: $mktg-body-size-6, lh: $mktg-body-lh-6),
103
+ 7: (size: $mktg-body-size-7, lh: $mktg-body-lh-7),
104
+ 8: (size: $mktg-body-size-8, lh: $mktg-body-lh-8)
50
105
  ) !default;
51
106
 
52
- $marketing-all-spacers: map-merge(
53
- (
54
- 0: 0,
55
- 1: $spacer-1,
56
- 2: $spacer-2,
57
- 3: $spacer-3,
58
- 4: $spacer-4,
59
- 5: $spacer-5,
60
- 6: $spacer-6,
61
- ),
62
- $marketing-spacers,
107
+ // Responsive body content, where first number is mobile (default), second is tablet/md, and third is desktop/lg
108
+ $mktg-body-spacing-large: -0.01em !default;
109
+
110
+ $mktg-bodies: (
111
+ 0: [3, 1, 0],
112
+ 1: [4, 3, 2],
113
+ 2: [5, 5, 4],
114
+ 3: [6, 5, 5],
115
+ 4: [6, 6, 6],
116
+ 5: [7, 7, 7],
117
+ 6: [8, 8, 8]
63
118
  ) !default;
64
119
 
120
+ // Animations
121
+ $transition-time: 0.4s !default;
122
+ $ease-mktg: cubic-bezier(0.16, 1, 0.3, 1) !default;
123
+
65
124
  $marketing-position-variants: (
66
125
  "": "",
67
126
  md: "-md",
@@ -1,81 +1,119 @@
1
1
  // Headings
2
-
3
- .h000-mktg,
4
- .h00-mktg,
5
2
  .h0-mktg,
6
3
  .h1-mktg,
7
4
  .h2-mktg,
8
5
  .h3-mktg,
9
6
  .h4-mktg,
10
7
  .h5-mktg,
11
- .h6-mktg,
12
- .lead-mktg {
8
+ .h6-mktg {
13
9
  font-family: $font-mktg;
14
- font-weight: $font-weight-semibold;
15
- }
16
-
17
- @mixin h000-mktg {
18
- font-size: $h000-size-mobile !important;
19
- @include breakpoint(md) { font-size: $h000-size !important; }
20
- }
21
-
22
- .h000-mktg { @include h000-mktg; }
23
-
24
- @mixin h00-mktg {
25
- font-size: $h00-size-mobile !important;
26
- @include breakpoint(md) { font-size: $h00-size !important; }
10
+ font-feature-settings: $mktg-font-feature-settings;
11
+ // stylelint-disable-next-line primer/typography
12
+ font-weight: $mktg-header-weight-default !important;
13
+ letter-spacing: $mktg-header-spacing-default !important;
27
14
  }
28
15
 
29
- .h00-mktg { @include h00-mktg; }
30
-
31
- @mixin h0-mktg {
32
- font-size: $h0-size-mobile !important;
33
- @include breakpoint(md) { font-size: $h0-size !important; }
34
- }
35
-
36
- .h0-mktg { @include h0-mktg; }
37
-
38
- @mixin h1-mktg {
39
- font-size: $h1-size-mobile !important;
40
- @include breakpoint(md) { font-size: $h1-size !important; }
41
- }
42
-
43
- .h1-mktg { @include h1-mktg; }
44
-
45
- @mixin h2-mktg {
46
- font-size: $h2-size-mobile !important;
47
- @include breakpoint(md) { font-size: $h2-size !important; }
48
- }
49
-
50
- .h2-mktg { @include h2-mktg; }
51
-
52
- @mixin h3-mktg {
53
- font-size: $h3-size-mobile !important;
54
- @include breakpoint(md) { font-size: $h3-size !important; }
55
- }
56
-
57
- .h3-mktg { @include h3-mktg; }
58
-
59
- .h4-mktg {
60
- font-size: $h4-size !important;
16
+ @each $header, $sizes in $mktg-headers {
17
+ .h#{$header}-mktg {
18
+ $pairing: map-get($mktg-header-pairings, nth($sizes, 1));
19
+ $pairing-md: map-get($mktg-header-pairings, nth($sizes, 2));
20
+ $pairing-lg: map-get($mktg-header-pairings, nth($sizes, 3));
21
+
22
+ font-size: map-get($pairing, "size") !important;
23
+ line-height: map-get($pairing, "lh") !important;
24
+ @if (map-get($pairing, "size") >= $mktg-header-weight-threshold) { font-weight: $mktg-header-weight-large !important; }
25
+
26
+ @if (nth($sizes, 1) != nth($sizes, 2)) {
27
+ @include breakpoint(md) {
28
+ font-size: map-get($pairing-md, "size") !important;
29
+ line-height: map-get($pairing-md, "lh") !important;
30
+
31
+ @if (map-get($pairing-md, "size") >= $mktg-header-spacing-threshold and map-get($pairing, "size") < $mktg-header-spacing-threshold) {
32
+ letter-spacing: $mktg-header-spacing-large !important;
33
+ }
34
+
35
+ @if (map-get($pairing-md, "size") >= $mktg-header-weight-threshold and map-get($pairing, "size") < $mktg-header-weight-threshold) {
36
+ font-weight: $mktg-header-weight-large !important;
37
+ }
38
+ }
39
+ }
40
+
41
+ @if (nth($sizes, 2) != nth($sizes, 3)) {
42
+ @include breakpoint(lg) {
43
+ font-size: map-get($pairing-lg, "size") !important;
44
+ line-height: map-get($pairing-lg, "lh") !important;
45
+
46
+ @if (map-get($pairing-lg, "size") >= $mktg-header-spacing-threshold and map-get($pairing-md, "size") < $mktg-header-spacing-threshold) {
47
+ letter-spacing: $mktg-header-spacing-large !important;
48
+ }
49
+
50
+ @if (map-get($pairing-lg, "size") >= $mktg-header-weight-threshold and map-get($pairing-md, "size") < $mktg-header-weight-threshold) {
51
+ font-weight: $mktg-header-weight-large !important;
52
+ }
53
+ }
54
+ }
55
+ }
61
56
  }
62
57
 
63
- .h5-mktg {
64
- font-size: $h5-size !important;
58
+ .f0-mktg,
59
+ .f1-mktg,
60
+ .f2-mktg,
61
+ .f3-mktg,
62
+ .f4-mktg,
63
+ .f5-mktg,
64
+ .f6-mktg {
65
+ font-family: $font-mktg;
66
+ font-feature-settings: $mktg-font-feature-settings;
67
+ font-weight: $font-weight-normal;
65
68
  }
66
69
 
67
- .h6-mktg {
68
- font-size: $h6-size !important;
70
+ @each $body, $sizes in $mktg-bodies {
71
+ .f#{$body}-mktg {
72
+ $pairing: map-get($mktg-body-pairings, nth($sizes, 1));
73
+ $pairing-md: map-get($mktg-body-pairings, nth($sizes, 2));
74
+ $pairing-lg: map-get($mktg-body-pairings, nth($sizes, 3));
75
+
76
+ font-size: map-get($pairing, "size") !important;
77
+ line-height: map-get($pairing, "lh") !important;
78
+ @if (map-get($pairing, "size") >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
79
+ @if (map-get($pairing, "size") >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold; }
80
+
81
+ @if (nth($sizes, 1) != nth($sizes, 2)) {
82
+ @include breakpoint(md) {
83
+ font-size: map-get($pairing-md, "size") !important;
84
+ line-height: map-get($pairing-md, "lh") !important;
85
+
86
+ @if (map-get($pairing-md, "size") >= $mktg-body-spacing-threshold and map-get($pairing, "size") < $mktg-body-spacing-threshold) {
87
+ letter-spacing: $mktg-body-spacing-large !important;
88
+ }
89
+
90
+ @if (map-get($pairing-md, "size") >= $mktg-body-weight-threshold and map-get($pairing, "size") < $mktg-body-weight-threshold) {
91
+ font-weight: $font-weight-medium;
92
+ }
93
+ }
94
+ }
95
+
96
+ @if (nth($sizes, 2) != nth($sizes, 3)) {
97
+ @include breakpoint(lg) {
98
+ font-size: map-get($pairing-lg, "size") !important;
99
+ line-height: map-get($pairing-lg, "lh") !important;
100
+
101
+ @if (map-get($pairing-lg, "size") >= $mktg-body-spacing-threshold and map-get($pairing-md, "size") < $mktg-body-spacing-threshold) {
102
+ letter-spacing: $mktg-body-spacing-large !important;
103
+ }
104
+
105
+ @if (map-get($pairing-lg, "size") >= $mktg-body-weight-threshold and map-get($pairing-md, "size") < $mktg-body-weight-threshold) {
106
+ font-weight: $font-weight-medium;
107
+ }
108
+ }
109
+ }
110
+ }
69
111
  }
70
112
 
71
- // Big opening paragraphs
72
- @mixin lead-mktg {
73
- font-size: $h3-size;
74
- font-weight: $font-weight-normal;
113
+ .text-medium {
114
+ font-weight: $font-weight-medium !important;
75
115
  }
76
116
 
77
- .lead-mktg { @include lead-mktg; }
78
-
79
117
  // Pullquote
80
118
 
81
119
  @mixin pullquote {
@@ -86,8 +124,8 @@
86
124
  font-family: $mono-font;
87
125
  font-size: $h4-size;
88
126
  line-height: 1.4;
89
- color: $text-gray;
90
- border-left: 3px solid $border-color;
127
+ color: var(--color-color-text-secondary);
128
+ border-left: 3px solid var(--color-border-default);
91
129
 
92
130
  @include breakpoint(md) {
93
131
  padding-left: $spacer * 1.5;
@@ -0,0 +1,9 @@
1
+ // Animation utilities for marketing
2
+
3
+ .hover-grow-mktg {
4
+ transition: transform 0.4s $ease-mktg;
5
+
6
+ &:hover {
7
+ transform: scale3d(1.025, 1.025, 1.025);
8
+ }
9
+ }
@@ -1,4 +1,3 @@
1
- // stylelint-disable no-unsupported-browser-features
2
1
  .grayscale {
3
2
  filter: grayscale(100%);
4
3
  }
@@ -1,7 +1,6 @@
1
1
  @import "../support/index.scss";
2
2
  // utilities
3
- @import "./filters.scss";
3
+ @import "./animations.scss";
4
4
  @import "./borders.scss";
5
+ @import "./filters.scss";
5
6
  @import "./layout.scss";
6
- @import "./margin.scss";
7
- @import "./padding.scss";
@@ -1,20 +1,24 @@
1
1
  // Layout utilities
2
- // stylelint-disable block-opening-brace-space-before, primer/selector-no-utility, comment-empty-line-before
2
+ // stylelint-disable block-opening-brace-space-before
3
3
 
4
4
  // Responsive utilities to position content
5
5
  // No utilities for sm and xl breakpoints
6
6
  @each $breakpoint, $variant in $marketing-position-variants {
7
7
  @include breakpoint($breakpoint) {
8
- @each $scale, $size in $marketing-all-spacers {
9
- .top#{$variant}-#{$scale} { top: $size !important; }
10
- .right#{$variant}-#{$scale} { right: $size !important; }
11
- .bottom#{$variant}-#{$scale} { bottom: $size !important; }
12
- .left#{$variant}-#{$scale} { left: $size !important; }
8
+ @each $scale, $size in $spacer-map-extended {
9
+ @if ($size != 0 or $variant != "") {
10
+ .top#{$variant}-#{$scale} { top: $size !important; }
11
+ .right#{$variant}-#{$scale} { right: $size !important; }
12
+ .bottom#{$variant}-#{$scale} { bottom: $size !important; }
13
+ .left#{$variant}-#{$scale} { left: $size !important; }
14
+ }
13
15
 
14
- .top#{$variant}-n#{$scale} { top: -$size !important; }
15
- .right#{$variant}-n#{$scale} { right: -$size !important; }
16
- .bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
17
- .left#{$variant}-n#{$scale} { left: -$size !important; }
16
+ @if ($size != 0) {
17
+ .top#{$variant}-n#{$scale} { top: -$size !important; }
18
+ .right#{$variant}-n#{$scale} { right: -$size !important; }
19
+ .bottom#{$variant}-n#{$scale} { bottom: -$size !important; }
20
+ .left#{$variant}-n#{$scale} { left: -$size !important; }
21
+ }
18
22
  }
19
23
  }
20
24
  }
@@ -23,7 +27,24 @@
23
27
  @each $breakpoint, $variant in $responsive-variants {
24
28
  @include breakpoint($breakpoint) {
25
29
  @for $offset from 1 through 7 {
26
- .offset#{$variant}-n#{$offset} { margin-left: -($offset / 12 * 100%); }
30
+ .offset#{$variant}-n#{$offset} { margin-left: -($offset * 0.0833333333 * 100%); }
27
31
  }
28
32
  }
29
33
  }
34
+
35
+ // Width and height utilities, especially needed when the
36
+ // dimensions of an image are set in HTML
37
+ .width-auto { width: auto !important; }
38
+ .height-auto { height: auto !important; }
39
+
40
+ // Make an object fill its parent
41
+ .object-fit-cover { object-fit: cover !important; }
42
+
43
+ // Handling z-index
44
+ .z-1 { z-index: 1 !important; }
45
+ .z-2 { z-index: 2 !important; }
46
+ .z-3 { z-index: 3 !important; }
47
+
48
+ // Negative z-index
49
+ .z-n1 { z-index: -1 !important; }
50
+ .z-n2 { z-index: -2 !important; }
@@ -1,37 +1,25 @@
1
- # Primer Navigation
1
+ ---
2
+ bundle: "navigation"
3
+ generated: true
4
+ ---
2
5
 
3
- > Primer comes with several navigation components. Some were designed with singular purposes, while others were design to be more flexible and appear quite frequently.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `navigation` 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-navigation/index.scss";
13
+ @import "@primer/css/navigation/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/navigation](https://primer.style/css/components/navigation).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/navigation.css`.
28
19
 
29
20
  ## License
30
21
 
31
- [MIT](./LICENSE) &copy; [GitHub](https://github.com/)
22
+ [MIT](https://github.com/primer/css/blob/main/LICENSE) &copy; [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
@@ -5,18 +5,18 @@
5
5
  list-style-type: none;
6
6
 
7
7
  &.small .filter-item {
8
- padding: $spacer-1 10px;
9
- margin: 0 0 2px;
8
+ // stylelint-disable-next-line primer/spacing
9
+ padding: 6px 12px;
10
10
  font-size: $font-size-small;
11
11
  }
12
12
 
13
13
  &.pjax-active .filter-item {
14
- color: $text-gray;
14
+ color: var(--color-fg-muted);
15
15
  background-color: transparent;
16
16
 
17
17
  &.pjax-active {
18
- color: $text-white;
19
- background-color: $bg-blue;
18
+ color: var(--color-fg-on-emphasis);
19
+ background-color: var(--color-accent-emphasis);
20
20
  }
21
21
  }
22
22
  }
@@ -24,25 +24,27 @@
24
24
  .filter-item {
25
25
  position: relative;
26
26
  display: block;
27
- padding: $spacer-2 10px;
28
- margin-bottom: 5px;
27
+ padding: $spacer-2 $spacer-3;
28
+ margin-bottom: $spacer-1;
29
29
  overflow: hidden;
30
30
  font-size: $h5-size;
31
- color: $text-gray;
31
+ color: var(--color-fg-muted);
32
32
  text-decoration: none;
33
33
  text-overflow: ellipsis;
34
34
  white-space: nowrap;
35
35
  cursor: pointer;
36
- border-radius: 3px;
36
+ border-radius: $border-radius;
37
37
 
38
38
  &:hover {
39
39
  text-decoration: none;
40
- background-color: lighten($gray-200, 3%);
40
+ background-color: var(--color-canvas-subtle);
41
41
  }
42
42
 
43
- &.selected {
44
- color: $text-white;
45
- background-color: $bg-blue;
43
+ &.selected,
44
+ &[aria-selected=true],
45
+ &[aria-current]:not([aria-current=false]) {
46
+ color: var(--color-fg-on-emphasis);
47
+ background-color: var(--color-accent-emphasis);
46
48
  }
47
49
 
48
50
  .count {
@@ -57,6 +59,6 @@
57
59
  bottom: 2px;
58
60
  z-index: -1;
59
61
  display: inline-block;
60
- background-color: darken($gray-100, 2%);
62
+ background-color: var(--color-neutral-subtle);
61
63
  }
62
64
  }
@@ -1,7 +1,8 @@
1
- @import "../support/index.scss";
1
+ @import '../support/index.scss';
2
2
  // Navigation
3
- @import "./menu.scss";
4
- @import "./tabnav.scss";
5
- @import "./filter-list.scss";
6
- @import "./subnav.scss";
7
- @import "./underline-nav.scss";
3
+ @import './menu.scss';
4
+ @import './tabnav.scss';
5
+ @import './filter-list.scss';
6
+ @import './sidenav.scss';
7
+ @import './subnav.scss';
8
+ @import './underline-nav.scss';