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

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 (358) 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 +15 -15
  7. package/RELEASING.md +5 -72
  8. package/alerts/README.md +11 -22
  9. package/alerts/flash.scss +91 -21
  10. package/alerts/index.scss +2 -2
  11. package/autocomplete/README.md +25 -0
  12. package/autocomplete/autocomplete.scss +58 -0
  13. package/autocomplete/index.scss +4 -0
  14. package/autocomplete/suggester.scss +92 -0
  15. package/avatars/README.md +11 -23
  16. package/avatars/avatar-parent-child.scss +4 -3
  17. package/avatars/avatar-stack.scss +21 -13
  18. package/avatars/avatar.scss +31 -3
  19. package/avatars/circle-badge.scss +5 -4
  20. package/avatars/index.scss +5 -5
  21. package/base/README.md +11 -22
  22. package/base/base.scss +5 -4
  23. package/base/index.scss +6 -4
  24. package/base/kbd.scss +20 -0
  25. package/base/normalize.scss +5 -5
  26. package/base/octicons.scss +6 -0
  27. package/base/typography-base.scss +2 -0
  28. package/blankslate/README.md +11 -23
  29. package/blankslate/blankslate.scss +25 -12
  30. package/blankslate/index.scss +2 -2
  31. package/box/README.md +11 -23
  32. package/box/box.scss +52 -44
  33. package/box/index.scss +2 -2
  34. package/branch-name/README.md +11 -23
  35. package/branch-name/branch-name.scss +18 -8
  36. package/branch-name/index.scss +2 -2
  37. package/breadcrumb/README.md +17 -13
  38. package/breadcrumb/breadcrumb.scss +15 -5
  39. package/breadcrumb/index.scss +2 -2
  40. package/buttons/README.md +11 -23
  41. package/buttons/button-group.scss +2 -0
  42. package/buttons/button.scss +243 -143
  43. package/buttons/index.scss +4 -3
  44. package/buttons/misc.scss +222 -0
  45. package/color-modes/index.scss +9 -0
  46. package/color-modes/native.scss +10 -0
  47. package/color-modes/themes/dark.scss +7 -0
  48. package/color-modes/themes/dark_colorblind.scss +7 -0
  49. package/color-modes/themes/dark_dimmed.scss +7 -0
  50. package/color-modes/themes/dark_high_contrast.scss +7 -0
  51. package/color-modes/themes/light.scss +7 -0
  52. package/color-modes/themes/light_colorblind.scss +7 -0
  53. package/core/README.md +11 -23
  54. package/core/index.scss +18 -20
  55. package/deprecations.js +24 -0
  56. package/deprecations.json +539 -0
  57. package/dist/alerts.css +1 -2
  58. package/dist/alerts.css.map +1 -1
  59. package/dist/alerts.js +1 -1
  60. package/dist/autocomplete.css +2 -0
  61. package/dist/autocomplete.css.map +1 -0
  62. package/dist/autocomplete.js +1 -0
  63. package/dist/avatars.css +1 -2
  64. package/dist/avatars.css.map +1 -1
  65. package/dist/avatars.js +1 -1
  66. package/dist/base.css +1 -2
  67. package/dist/base.css.map +1 -1
  68. package/dist/base.js +1 -1
  69. package/dist/blankslate.css +1 -2
  70. package/dist/blankslate.css.map +1 -1
  71. package/dist/blankslate.js +1 -1
  72. package/dist/box.css +1 -2
  73. package/dist/box.css.map +1 -1
  74. package/dist/box.js +1 -1
  75. package/dist/branch-name.css +1 -2
  76. package/dist/branch-name.css.map +1 -1
  77. package/dist/branch-name.js +1 -1
  78. package/dist/breadcrumb.css +1 -2
  79. package/dist/breadcrumb.css.map +1 -1
  80. package/dist/breadcrumb.js +1 -1
  81. package/dist/buttons.css +1 -2
  82. package/dist/buttons.css.map +1 -1
  83. package/dist/buttons.js +1 -1
  84. package/dist/color-modes.css +2 -0
  85. package/dist/color-modes.css.map +1 -0
  86. package/dist/color-modes.js +1 -0
  87. package/dist/core.css +3 -4
  88. package/dist/core.css.map +1 -1
  89. package/dist/core.js +1 -1
  90. package/dist/deprecations.json +539 -0
  91. package/dist/dropdown.css +2 -0
  92. package/dist/dropdown.css.map +1 -0
  93. package/dist/dropdown.js +1 -0
  94. package/dist/forms.css +1 -2
  95. package/dist/forms.css.map +1 -1
  96. package/dist/forms.js +1 -1
  97. package/dist/header.css +2 -0
  98. package/dist/header.css.map +1 -0
  99. package/dist/header.js +1 -0
  100. package/dist/labels.css +1 -2
  101. package/dist/labels.css.map +1 -1
  102. package/dist/labels.js +1 -1
  103. package/dist/layout.css +1 -2
  104. package/dist/layout.css.map +1 -1
  105. package/dist/layout.js +1 -1
  106. package/dist/links.css +2 -0
  107. package/dist/links.css.map +1 -0
  108. package/dist/links.js +1 -0
  109. package/dist/loaders.css +2 -0
  110. package/dist/loaders.css.map +1 -0
  111. package/dist/loaders.js +1 -0
  112. package/dist/markdown.css +1 -2
  113. package/dist/markdown.css.map +1 -1
  114. package/dist/markdown.js +1 -1
  115. package/dist/marketing-buttons.css +1 -2
  116. package/dist/marketing-buttons.css.map +1 -1
  117. package/dist/marketing-buttons.js +1 -1
  118. package/dist/marketing-support.css +1 -2
  119. package/dist/marketing-support.js +1 -1
  120. package/dist/marketing-type.css +1 -2
  121. package/dist/marketing-type.css.map +1 -1
  122. package/dist/marketing-type.js +1 -1
  123. package/dist/marketing-utilities.css +1 -2
  124. package/dist/marketing-utilities.css.map +1 -1
  125. package/dist/marketing-utilities.js +1 -1
  126. package/dist/marketing.css +3 -4
  127. package/dist/marketing.css.map +1 -1
  128. package/dist/marketing.js +1 -1
  129. package/dist/meta.json +305 -273
  130. package/dist/navigation.css +1 -2
  131. package/dist/navigation.css.map +1 -1
  132. package/dist/navigation.js +1 -1
  133. package/dist/pagination.css +1 -2
  134. package/dist/pagination.css.map +1 -1
  135. package/dist/pagination.js +1 -1
  136. package/dist/popover.css +1 -2
  137. package/dist/popover.css.map +1 -1
  138. package/dist/popover.js +1 -1
  139. package/dist/primer.css +13 -14
  140. package/dist/primer.css.map +1 -1
  141. package/dist/primer.js +1 -1
  142. package/dist/product.css +3 -4
  143. package/dist/product.css.map +1 -1
  144. package/dist/product.js +1 -1
  145. package/dist/progress.css +1 -2
  146. package/dist/progress.css.map +1 -1
  147. package/dist/progress.js +1 -1
  148. package/dist/select-menu.css +2 -0
  149. package/dist/select-menu.css.map +1 -0
  150. package/dist/select-menu.js +1 -0
  151. package/dist/stats/alerts.json +1 -1
  152. package/dist/stats/autocomplete.json +1 -0
  153. package/dist/stats/avatars.json +1 -1
  154. package/dist/stats/base.json +1 -1
  155. package/dist/stats/blankslate.json +1 -1
  156. package/dist/stats/box.json +1 -1
  157. package/dist/stats/branch-name.json +1 -1
  158. package/dist/stats/breadcrumb.json +1 -1
  159. package/dist/stats/buttons.json +1 -1
  160. package/dist/stats/color-modes.json +1 -0
  161. package/dist/stats/core.json +1 -1
  162. package/dist/stats/dropdown.json +1 -0
  163. package/dist/stats/forms.json +1 -1
  164. package/dist/stats/header.json +1 -0
  165. package/dist/stats/labels.json +1 -1
  166. package/dist/stats/layout.json +1 -1
  167. package/dist/stats/links.json +1 -0
  168. package/dist/stats/loaders.json +1 -0
  169. package/dist/stats/markdown.json +1 -1
  170. package/dist/stats/marketing-buttons.json +1 -1
  171. package/dist/stats/marketing-support.json +1 -1
  172. package/dist/stats/marketing-type.json +1 -1
  173. package/dist/stats/marketing-utilities.json +1 -1
  174. package/dist/stats/marketing.json +1 -1
  175. package/dist/stats/navigation.json +1 -1
  176. package/dist/stats/pagination.json +1 -1
  177. package/dist/stats/popover.json +1 -1
  178. package/dist/stats/primer.json +1 -1
  179. package/dist/stats/product.json +1 -1
  180. package/dist/stats/progress.json +1 -1
  181. package/dist/stats/select-menu.json +1 -0
  182. package/dist/stats/subhead.json +1 -1
  183. package/dist/stats/support.json +1 -1
  184. package/dist/stats/table-object.json +1 -1
  185. package/dist/stats/timeline.json +1 -0
  186. package/dist/stats/toasts.json +1 -0
  187. package/dist/stats/tooltips.json +1 -1
  188. package/dist/stats/truncate.json +1 -1
  189. package/dist/stats/utilities.json +1 -1
  190. package/dist/subhead.css +1 -2
  191. package/dist/subhead.css.map +1 -1
  192. package/dist/subhead.js +1 -1
  193. package/dist/support.css +1 -1
  194. package/dist/support.js +1 -1
  195. package/dist/table-object.css +0 -1
  196. package/dist/table-object.css.map +1 -1
  197. package/dist/table-object.js +1 -1
  198. package/dist/timeline.css +2 -0
  199. package/dist/timeline.css.map +1 -0
  200. package/dist/timeline.js +1 -0
  201. package/dist/toasts.css +2 -0
  202. package/dist/toasts.css.map +1 -0
  203. package/dist/toasts.js +1 -0
  204. package/dist/tooltips.css +1 -2
  205. package/dist/tooltips.css.map +1 -1
  206. package/dist/tooltips.js +1 -1
  207. package/dist/truncate.css +1 -2
  208. package/dist/truncate.css.map +1 -1
  209. package/dist/truncate.js +1 -1
  210. package/dist/utilities.css +1 -2
  211. package/dist/utilities.css.map +1 -1
  212. package/dist/utilities.js +1 -1
  213. package/dist/variables.json +1352 -0
  214. package/dropdown/README.md +25 -0
  215. package/dropdown/dropdown.scss +272 -0
  216. package/dropdown/index.scss +2 -0
  217. package/forms/README.md +11 -23
  218. package/forms/form-control.scss +76 -32
  219. package/forms/form-group.scss +83 -46
  220. package/forms/form-select.scss +17 -5
  221. package/forms/form-validation.scss +51 -32
  222. package/forms/index.scss +7 -6
  223. package/forms/input-group.scss +2 -0
  224. package/forms/radio-group.scss +62 -0
  225. package/header/README.md +25 -0
  226. package/header/header.scss +47 -0
  227. package/header/index.scss +2 -0
  228. package/index.scss +7 -4
  229. package/labels/README.md +11 -23
  230. package/labels/counters.scss +24 -13
  231. package/labels/diffstat.scss +37 -0
  232. package/labels/index.scss +8 -4
  233. package/labels/issue-labels.scss +23 -0
  234. package/labels/labels.scss +59 -40
  235. package/labels/mixins.scss +32 -0
  236. package/labels/states.scss +40 -19
  237. package/layout/README.md +11 -23
  238. package/layout/container.scss +0 -8
  239. package/layout/grid-offset.scss +11 -11
  240. package/layout/grid.scss +23 -23
  241. package/layout/index.scss +7 -5
  242. package/layout/layout.scss +185 -0
  243. package/layout/mixins.scss +79 -0
  244. package/links/README.md +25 -0
  245. package/links/index.scss +3 -0
  246. package/links/link.scss +55 -0
  247. package/loaders/README.md +25 -0
  248. package/loaders/index.scss +2 -0
  249. package/loaders/loaders.scss +19 -0
  250. package/markdown/README.md +11 -23
  251. package/markdown/blob-csv.scss +4 -2
  252. package/markdown/code.scss +11 -3
  253. package/markdown/footnotes.scss +37 -0
  254. package/markdown/headings.scss +13 -4
  255. package/markdown/images.scss +15 -4
  256. package/markdown/index.scss +9 -8
  257. package/markdown/lists.scss +19 -5
  258. package/markdown/markdown-body.scss +15 -18
  259. package/markdown/tables.scss +8 -5
  260. package/marketing/README.md +11 -23
  261. package/marketing/buttons/button.scss +82 -61
  262. package/marketing/index.scss +6 -11
  263. package/marketing/support/index.scss +1 -0
  264. package/marketing/support/mixins.scss +66 -0
  265. package/marketing/support/variables.scss +110 -51
  266. package/marketing/type/typography.scss +100 -62
  267. package/marketing/utilities/animations.scss +9 -0
  268. package/marketing/utilities/filters.scss +0 -1
  269. package/marketing/utilities/index.scss +2 -3
  270. package/marketing/utilities/layout.scss +32 -11
  271. package/navigation/README.md +11 -23
  272. package/navigation/filter-list.scss +16 -14
  273. package/navigation/index.scss +7 -6
  274. package/navigation/menu.scss +44 -35
  275. package/navigation/sidenav.scss +108 -0
  276. package/navigation/subnav.scss +28 -21
  277. package/navigation/tabnav.scss +45 -21
  278. package/navigation/underline-nav.scss +36 -22
  279. package/package.json +78 -107
  280. package/pagination/README.md +12 -14
  281. package/pagination/index.scss +2 -2
  282. package/pagination/pagination.scss +61 -37
  283. package/popover/README.md +11 -24
  284. package/popover/index.scss +2 -2
  285. package/popover/popover.scss +18 -9
  286. package/postcss.config.cjs +22 -0
  287. package/prettier.config.cjs +1 -0
  288. package/product/README.md +11 -23
  289. package/product/index.scss +19 -17
  290. package/progress/README.md +11 -23
  291. package/progress/index.scss +2 -2
  292. package/progress/progress.scss +11 -1
  293. package/select-menu/README.md +25 -0
  294. package/select-menu/index.scss +3 -0
  295. package/select-menu/select-menu.scss +464 -0
  296. package/stylelint.config.cjs +16 -0
  297. package/subhead/README.md +11 -25
  298. package/subhead/index.scss +2 -2
  299. package/subhead/subhead.scss +10 -4
  300. package/support/README.md +12 -18
  301. package/support/index.scss +7 -8
  302. package/support/mixins/color-modes.scss +106 -0
  303. package/support/mixins/misc.scss +9 -12
  304. package/support/mixins/typography.scss +1 -1
  305. package/support/variables/layout.scss +106 -11
  306. package/support/variables/misc.scss +7 -30
  307. package/support/variables/typography.scss +4 -4
  308. package/table-object/README.md +11 -24
  309. package/table-object/index.scss +1 -1
  310. package/timeline/README.md +25 -0
  311. package/timeline/index.scss +2 -0
  312. package/timeline/timeline-item.scss +95 -0
  313. package/toasts/README.md +25 -0
  314. package/toasts/index.scss +2 -0
  315. package/toasts/toasts.scss +124 -0
  316. package/tooltips/README.md +11 -24
  317. package/tooltips/index.scss +2 -2
  318. package/tooltips/tooltips.scss +17 -8
  319. package/truncate/README.md +11 -24
  320. package/truncate/index.scss +2 -1
  321. package/truncate/truncate.scss +41 -7
  322. package/utilities/README.md +11 -23
  323. package/utilities/animations.scss +14 -2
  324. package/utilities/borders.scss +29 -65
  325. package/utilities/box-shadow.scss +8 -9
  326. package/utilities/colors.scss +71 -110
  327. package/utilities/details.scss +12 -4
  328. package/utilities/flexbox.scss +14 -14
  329. package/utilities/index.scss +12 -12
  330. package/utilities/layout.scss +28 -22
  331. package/utilities/margin.scss +34 -17
  332. package/utilities/padding.scss +13 -9
  333. package/utilities/typography.scss +54 -25
  334. package/utilities/visibility-display.scss +0 -13
  335. package/.browserslistrc +0 -6
  336. package/.eslintrc.json +0 -13
  337. package/.stylelintrc.json +0 -9
  338. package/MIGRATING.md +0 -70
  339. package/bin/primer-migrate +0 -86
  340. package/build/build.css +0 -23
  341. package/build/build.json +0 -1
  342. package/build/index.js +0 -1
  343. package/dist/marketing-support.css.map +0 -1
  344. package/dist/support.css.map +0 -1
  345. package/fonts/Inter-Medium.woff +0 -0
  346. package/fonts/Inter-Regular.woff +0 -0
  347. package/layout/columns.scss +0 -56
  348. package/marketing/buttons/README.md +0 -39
  349. package/marketing/support/README.md +0 -31
  350. package/marketing/type/README.md +0 -39
  351. package/marketing/utilities/README.md +0 -36
  352. package/marketing/utilities/margin.scss +0 -18
  353. package/marketing/utilities/padding.scss +0 -28
  354. package/postcss.config.js +0 -14
  355. package/prettier.config.js +0 -1
  356. package/support/mixins/buttons.scss +0 -160
  357. package/support/variables/color-system.scss +0 -243
  358. package/support/variables/colors.scss +0 -70
@@ -0,0 +1,124 @@
1
+ // Toast
2
+
3
+ .Toast {
4
+ display: flex;
5
+ margin: $spacer-2;
6
+ color: var(--color-fg-default);
7
+ background-color: var(--color-canvas-default);
8
+ border-radius: $border-radius;
9
+ box-shadow: inset 0 0 0 1px var(--color-border-default), var(--color-shadow-large);
10
+
11
+ @include breakpoint(sm) {
12
+ width: max-content;
13
+ max-width: 450px;
14
+ margin: $spacer-3;
15
+ }
16
+ }
17
+
18
+ .Toast-icon {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ width: $spacer-3 * 3;
23
+ flex-shrink: 0;
24
+ color: var(--color-fg-on-emphasis);
25
+ background-color: var(--color-accent-emphasis);
26
+ border: $border-width $border-style transparent;
27
+ border-right: 0;
28
+ border-top-left-radius: inherit;
29
+ border-bottom-left-radius: inherit;
30
+ }
31
+
32
+ .Toast-content {
33
+ padding: $spacer-3;
34
+ }
35
+
36
+ .Toast-dismissButton {
37
+ max-height: 54px; // keeps button aligned to the top
38
+ padding: $spacer-3;
39
+ color: inherit;
40
+ background-color: transparent;
41
+ border: 0;
42
+
43
+ &:focus,
44
+ &:hover {
45
+ outline: none;
46
+ opacity: 0.7;
47
+ }
48
+
49
+ &:active {
50
+ opacity: 0.5;
51
+ }
52
+ }
53
+
54
+ // Modifier
55
+
56
+ .Toast--loading {
57
+ color: var(--color-fg-default);
58
+ box-shadow: inset 0 0 0 1px var(--color-border-default), var(--color-shadow-large);
59
+
60
+ .Toast-icon {
61
+ background-color: var(--color-neutral-emphasis);
62
+ }
63
+ }
64
+
65
+ .Toast--error {
66
+ color: var(--color-fg-default);
67
+ box-shadow: inset 0 0 0 1px var(--color-border-default), var(--color-shadow-large);
68
+
69
+ .Toast-icon {
70
+ background-color: var(--color-danger-emphasis);
71
+ }
72
+ }
73
+
74
+ .Toast--warning {
75
+ color: var(--color-fg-default);
76
+ box-shadow: inset 0 0 0 1px var(--color-border-default), var(--color-shadow-large);
77
+
78
+ .Toast-icon {
79
+ background-color: var(--color-attention-emphasis);
80
+ }
81
+ }
82
+
83
+ .Toast--success {
84
+ color: var(--color-fg-default);
85
+ box-shadow: inset 0 0 0 1px var(--color-border-default), var(--color-shadow-large);
86
+
87
+ .Toast-icon {
88
+ background-color: var(--color-success-emphasis);
89
+ }
90
+ }
91
+
92
+ // Animations
93
+
94
+ .Toast--animateIn {
95
+ animation: Toast--animateIn 0.18s cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
96
+ }
97
+
98
+ @keyframes Toast--animateIn {
99
+ 0% {
100
+ opacity: 0;
101
+ transform: translateY(100%);
102
+ }
103
+ }
104
+
105
+ .Toast--animateOut {
106
+ animation: Toast--animateOut 0.18s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
107
+ }
108
+
109
+ @keyframes Toast--animateOut {
110
+ 100% {
111
+ pointer-events: none;
112
+ opacity: 0;
113
+ transform: translateY(100%);
114
+ }
115
+ }
116
+
117
+ .Toast--spinner {
118
+ animation: Toast--spinner 1000ms linear infinite;
119
+ }
120
+
121
+ @keyframes Toast--spinner {
122
+ from { transform: rotate(0deg); }
123
+ to { transform: rotate(360deg); }
124
+ }
@@ -1,38 +1,25 @@
1
- # Primer Tooltips
1
+ ---
2
+ bundle: "tooltips"
3
+ generated: true
4
+ ---
2
5
 
3
- > Add tooltips built entirely in CSS to nearly any element. Just add a few classes and an aria-label attribute.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `tooltips` 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-tooltips/index.scss";
13
+ @import "@primer/css/tooltips/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/tooltips](https://primer.style/css/components/tooltips).
28
-
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/tooltips.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,2 +1,2 @@
1
- @import "../support/index.scss";
2
- @import "./tooltips.scss";
1
+ @import '../support/index.scss';
2
+ @import './tooltips.scss';
@@ -10,7 +10,7 @@
10
10
  padding: $em-spacer-5 $em-spacer-6;
11
11
  font: normal normal 11px/1.5 $body-font;
12
12
  -webkit-font-smoothing: subpixel-antialiased;
13
- color: $tooltip-text-color;
13
+ color: var(--color-fg-on-emphasis);
14
14
  text-align: center;
15
15
  text-decoration: none;
16
16
  text-shadow: none;
@@ -20,7 +20,7 @@
20
20
  white-space: pre;
21
21
  pointer-events: none;
22
22
  content: attr(aria-label);
23
- background: $tooltip-background-color;
23
+ background: var(--color-neutral-emphasis-plus);
24
24
  border-radius: $border-radius;
25
25
  opacity: 0;
26
26
  }
@@ -32,9 +32,10 @@
32
32
  display: none;
33
33
  width: 0;
34
34
  height: 0;
35
- color: $tooltip-background-color;
35
+ color: var(--color-neutral-emphasis-plus);
36
36
  pointer-events: none;
37
- content: "";
37
+ content: '';
38
+ // stylelint-disable-next-line primer/borders
38
39
  border: 6px $border-style transparent;
39
40
  opacity: 0;
40
41
  }
@@ -90,6 +91,7 @@
90
91
  &::after {
91
92
  top: 100%;
92
93
  right: 50%;
94
+ // stylelint-disable-next-line primer/spacing
93
95
  margin-top: 6px;
94
96
  }
95
97
 
@@ -97,8 +99,9 @@
97
99
  top: auto;
98
100
  right: 50%;
99
101
  bottom: -7px;
102
+ // stylelint-disable-next-line primer/spacing
100
103
  margin-right: -6px;
101
- border-bottom-color: $tooltip-background-color;
104
+ border-bottom-color: var(--color-neutral-emphasis-plus);
102
105
  }
103
106
  }
104
107
 
@@ -121,6 +124,7 @@
121
124
  &::after {
122
125
  right: 50%;
123
126
  bottom: 100%;
127
+ // stylelint-disable-next-line primer/spacing
124
128
  margin-bottom: 6px;
125
129
  }
126
130
 
@@ -128,8 +132,9 @@
128
132
  top: -7px;
129
133
  right: 50%;
130
134
  bottom: auto;
135
+ // stylelint-disable-next-line primer/spacing
131
136
  margin-right: -6px;
132
- border-top-color: $tooltip-background-color;
137
+ border-top-color: var(--color-neutral-emphasis-plus);
133
138
  }
134
139
  }
135
140
 
@@ -156,6 +161,7 @@
156
161
  &::after {
157
162
  right: 100%;
158
163
  bottom: 50%;
164
+ // stylelint-disable-next-line primer/spacing
159
165
  margin-right: 6px;
160
166
  transform: translateY(50%);
161
167
  }
@@ -164,8 +170,9 @@
164
170
  top: 50%;
165
171
  bottom: 50%;
166
172
  left: -7px;
173
+ // stylelint-disable-next-line primer/spacing
167
174
  margin-top: -6px;
168
- border-left-color: $tooltip-background-color;
175
+ border-left-color: var(--color-neutral-emphasis-plus);
169
176
  }
170
177
  }
171
178
 
@@ -174,6 +181,7 @@
174
181
  &::after {
175
182
  bottom: 50%;
176
183
  left: 100%;
184
+ // stylelint-disable-next-line primer/spacing
177
185
  margin-left: 6px;
178
186
  transform: translateY(50%);
179
187
  }
@@ -182,8 +190,9 @@
182
190
  top: 50%;
183
191
  right: -7px;
184
192
  bottom: 50%;
193
+ // stylelint-disable-next-line primer/spacing
185
194
  margin-top: -6px;
186
- border-right-color: $tooltip-background-color;
195
+ border-right-color: var(--color-neutral-emphasis-plus);
187
196
  }
188
197
  }
189
198
 
@@ -1,38 +1,25 @@
1
- # Primer Truncate
1
+ ---
2
+ bundle: "truncate"
3
+ generated: true
4
+ ---
2
5
 
3
- > .css-truncate will shorten text with an ellipsis. The maximum width of the truncated text can be changed by overriding the max-width of the .css-truncate-target.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `truncate` 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-truncate/index.scss";
13
+ @import "@primer/css/truncate/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/truncate](https://primer.style/css/components/truncate).
28
-
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/truncate.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,2 @@
1
- @import "./truncate.scss";
1
+ @import '../support/index.scss';
2
+ @import './truncate.scss';
@@ -3,18 +3,22 @@
3
3
  // css-truncate will shorten text with an ellipsis.
4
4
 
5
5
  .css-truncate {
6
- // Truncate double target
7
- //
8
- // css-truncate will shorten text with an ellipsis. The maximum width
9
- // of the truncated text can be changed by overriding the max-width
10
- // of the .css-truncate-target
6
+
7
+ // css-truncate-auto will shorten text with an ellipsis when overflowing
8
+ &.css-truncate-overflow,
9
+ .css-truncate-overflow,
11
10
  &.css-truncate-target,
12
11
  .css-truncate-target {
13
- display: inline-block;
14
- max-width: 125px;
15
12
  overflow: hidden;
16
13
  text-overflow: ellipsis;
17
14
  white-space: nowrap;
15
+ }
16
+
17
+ // css-truncate-target will shorten text with an ellipsis and a max width
18
+ &.css-truncate-target,
19
+ .css-truncate-target {
20
+ display: inline-block;
21
+ max-width: 125px;
18
22
  vertical-align: top;
19
23
  }
20
24
 
@@ -25,3 +29,33 @@
25
29
  max-width: 10000px !important;
26
30
  }
27
31
  }
32
+
33
+ .Truncate {
34
+ display: inline-flex;
35
+ min-width: 0;
36
+ max-width: 100%;
37
+
38
+ > .Truncate-text {
39
+ min-width: 1ch;
40
+ max-width: fit-content;
41
+ overflow: hidden;
42
+ text-overflow: ellipsis;
43
+ white-space: nowrap;
44
+
45
+ + .Truncate-text {
46
+ margin-left: $spacer-1;
47
+ }
48
+
49
+ &.Truncate-text--primary {
50
+ flex-basis: 200%;
51
+ }
52
+
53
+ &.Truncate-text--expandable:hover,
54
+ &.Truncate-text--expandable:focus,
55
+ &.Truncate-text--expandable:active {
56
+ max-width: 100% !important;
57
+ flex-shrink: 0;
58
+ cursor: pointer;
59
+ }
60
+ }
61
+ }
@@ -1,37 +1,25 @@
1
- # Primer Utilities
1
+ ---
2
+ bundle: "utilities"
3
+ generated: true
4
+ ---
2
5
 
3
- > There are a handful of utilities in Primer for quick behaviors, floats, colors, alignment, and more.
4
-
5
- This repository is a module of the full [primer][primer] repository.
6
+ # Primer CSS: `utilities` 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-utilities/index.scss";
13
+ @import "@primer/css/utilities/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/utilities](https://primer.style/css/utilities).
18
+ The `@primer/css` npm package includes a standalone CSS build of this module in `dist/utilities.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,5 +1,4 @@
1
1
  // This file contains reusable animations for github.
2
- // stylelint-disable primer/selector-no-utility
3
2
 
4
3
  /* Fade in an element */
5
4
  .anim-fade-in {
@@ -26,6 +25,7 @@
26
25
  .anim-fade-out {
27
26
  animation-name: fade-out;
28
27
  animation-duration: 1s;
28
+ animation-fill-mode: forwards;
29
29
  animation-timing-function: ease-out;
30
30
 
31
31
  &.fast {
@@ -174,7 +174,8 @@
174
174
  }
175
175
 
176
176
  /* Increase scale of an element on hover */
177
- .hover-grow {
177
+ .hover-grow,
178
+ .anim-hover-grow {
178
179
  transition: transform 0.3s;
179
180
  backface-visibility: hidden;
180
181
 
@@ -182,3 +183,14 @@
182
183
  transform: scale(1.025);
183
184
  }
184
185
  }
186
+
187
+ /* Rotate an element 360 degrees over and over, used for spinners */
188
+ .anim-rotate {
189
+ animation: rotate-keyframes 1s linear infinite;
190
+ }
191
+
192
+ @keyframes rotate-keyframes {
193
+ 100% {
194
+ transform: rotate(360deg);
195
+ }
196
+ }
@@ -1,56 +1,41 @@
1
1
  // Core border utilities
2
- // stylelint-disable primer/selector-no-utility
3
- // stylelint-disable block-opening-brace-space-before, comment-empty-line-before
4
-
5
- /* Add a gray border on all sides */
6
- .border { border: $border !important; }
2
+ // stylelint-disable block-opening-brace-space-before
7
3
 
8
4
  /* Add a gray border to the left and right */
5
+ .border-x {
6
+ border-right: $border !important;
7
+ border-left: $border !important;
8
+ }
9
+
10
+ /* Add a gray border to the top and bottom */
9
11
  .border-y {
10
12
  border-top: $border !important;
11
13
  border-bottom: $border !important;
12
14
  }
13
15
 
14
- /* Remove borders from all sides */
15
- .border-0 { border: 0 !important; }
16
-
17
- .border-dashed { border-style: dashed !important; }
18
-
19
- $edges: (
20
- top: (top-left, top-right),
21
- right: (top-right, bottom-right),
22
- bottom: (bottom-right, bottom-left),
23
- left: (bottom-left, top-left)
24
- );
25
-
16
+ /* Responsive gray borders */
26
17
  @each $breakpoint, $variant in $responsive-variants {
27
18
  @include breakpoint($breakpoint) {
28
- /* Add a gray border */
29
- /* Add a gray border to the top */
19
+ /* Add a gray border on all sides at/above this breakpoint */
20
+ .border#{$variant} { border: $border !important; }
21
+ .border#{$variant}-0 { border: 0 !important; }
22
+
30
23
  .border#{$variant}-top { border-top: $border !important; }
31
- /* Add a gray border to the right */
32
24
  .border#{$variant}-right { border-right: $border !important; }
33
- /* Add a gray border to the bottom */
34
25
  .border#{$variant}-bottom { border-bottom: $border !important; }
35
- /* Add a gray border to the left */
36
26
  .border#{$variant}-left { border-left: $border !important; }
37
27
 
38
- /* Remove the top border */
39
28
  .border#{$variant}-top-0 { border-top: 0 !important; }
40
- /* Remove the right border */
41
29
  .border#{$variant}-right-0 { border-right: 0 !important; }
42
- /* Remove the bottom border */
43
30
  .border#{$variant}-bottom-0 { border-bottom: 0 !important; }
44
- /* Remove the left border */
45
31
  .border#{$variant}-left-0 { border-left: 0 !important; }
46
32
 
47
33
  // Rounded corners
48
- /* Remove the border-radius */
34
+ .rounded#{$variant} { border-radius: $border-radius !important; }
49
35
  .rounded#{$variant}-0 { border-radius: 0 !important; }
50
- /* Add a border-radius to all corners */
51
- .rounded#{$variant}-1 { border-radius: $border-radius !important; }
52
- /* Add a 2x border-radius to all corners */
53
- .rounded#{$variant}-2 { border-radius: $border-radius * 2 !important; }
36
+ .rounded#{$variant}-1 { border-radius: $border-radius-1 !important; }
37
+ .rounded#{$variant}-2 { border-radius: $border-radius-2 !important; }
38
+ .rounded#{$variant}-3 { border-radius: $border-radius-3 !important; }
54
39
 
55
40
  @each $edge, $corners in $edges {
56
41
  .rounded#{$variant}-#{$edge}-0 {
@@ -61,13 +46,19 @@ $edges: (
61
46
 
62
47
  .rounded#{$variant}-#{$edge}-1 {
63
48
  @each $corner in $corners {
64
- border-#{$corner}-radius: $border-radius !important;
49
+ border-#{$corner}-radius: $border-radius-1 !important;
65
50
  }
66
51
  }
67
52
 
68
53
  .rounded#{$variant}-#{$edge}-2 {
69
54
  @each $corner in $corners {
70
- border-#{$corner}-radius: $border-radius * 2 !important;
55
+ border-#{$corner}-radius: $border-radius-2 !important;
56
+ }
57
+ }
58
+
59
+ .rounded#{$variant}-#{$edge}-3 {
60
+ @each $corner in $corners {
61
+ border-#{$corner}-radius: $border-radius-3 !important;
71
62
  }
72
63
  }
73
64
  }
@@ -77,35 +68,8 @@ $edges: (
77
68
  /* Add a 50% border-radius to make something into a circle */
78
69
  .circle { border-radius: 50% !important; }
79
70
 
80
- /* Use with .border to turn the border blue */
81
- .border-blue { border-color: $border-blue !important; }
82
- /* Use with .border to turn the border blue-light */
83
- .border-blue-light { border-color: $border-blue-light !important; }
84
- /* Use with .border to turn the border green */
85
- .border-green { border-color: $border-green !important; }
86
- /* Use with .border to turn the border green light */
87
- .border-green-light { border-color: $border-green-light !important; }
88
- /* Use with .border to turn the border red */
89
- .border-red { border-color: $border-red !important; }
90
- /* Use with .border to turn the border red-light */
91
- .border-red-light { border-color: $border-red-light !important; }
92
- /* Use with .border to turn the border purple */
93
- .border-purple { border-color: $border-purple !important; }
94
- /* Use with .border to turn the border yellow */
95
- .border-yellow { border-color: $border-yellow !important; }
96
- /* Use with .border to turn the border gray-light */
97
- .border-gray-light { border-color: $border-gray-light !important; }
98
- /* Use with .border to turn the border gray-dark */
99
- .border-gray-dark { border-color: $border-gray-dark !important; }
100
-
101
- /* Use with .border to turn the border rgba black 0.15 */
102
- .border-black-fade { border-color: $border-black-fade !important; }
103
- /* Use with .border to turn the border rgba white 0.15 */
104
- .border-white-fade { border-color: $border-white-fade !important; }
105
-
106
- /* Use with .border to turn the border white w/varying transparency */
107
- .border-white-fade-15 { border-color: $white-fade-15 !important; }
108
- .border-white-fade-30 { border-color: $white-fade-30 !important; }
109
- .border-white-fade-50 { border-color: $white-fade-50 !important; }
110
- .border-white-fade-70 { border-color: $white-fade-70 !important; }
111
- .border-white-fade-85 { border-color: $white-fade-85 !important; }
71
+ /* Change the border style to dashed, in conjunction with another utility */
72
+ .border-dashed {
73
+ // stylelint-disable-next-line primer/borders
74
+ border-style: dashed !important;
75
+ }
@@ -1,22 +1,21 @@
1
1
  // Box shadow utilities
2
- // stylelint-disable primer/selector-no-utility
3
2
 
4
3
  // Box shadows
5
4
 
6
- .box-shadow {
7
- box-shadow: $box-shadow !important;
5
+ .color-shadow-small {
6
+ box-shadow: var(--color-shadow-small) !important;
8
7
  }
9
8
 
10
- .box-shadow-medium {
11
- box-shadow: $box-shadow-medium !important;
9
+ .color-shadow-medium {
10
+ box-shadow: var(--color-shadow-medium) !important;
12
11
  }
13
12
 
14
- .box-shadow-large {
15
- box-shadow: $box-shadow-large !important;
13
+ .color-shadow-large {
14
+ box-shadow: var(--color-shadow-large) !important;
16
15
  }
17
16
 
18
- .box-shadow-extra-large {
19
- box-shadow: $box-shadow-extra-large !important;
17
+ .color-shadow-extra-large {
18
+ box-shadow: var(--color-shadow-extra-large) !important;
20
19
  }
21
20
 
22
21
  // Turn off box shadow