@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.
- package/CHANGELOG.md +1225 -132
- package/CODE_OF_CONDUCT.md +1 -1
- package/CONTRIBUTING.md +85 -0
- package/DEVELOP.md +11 -69
- package/LICENSE +1 -1
- package/README.md +13 -15
- package/RELEASING.md +5 -72
- package/actionlist/action-list-item-divider.scss +42 -0
- package/actionlist/action-list-item.scss +444 -0
- package/actionlist/action-list-variables.scss +8 -0
- package/actionlist/action-list.scss +33 -0
- package/actionlist/index.scss +5 -0
- package/alerts/README.md +11 -22
- package/alerts/flash.scss +91 -21
- package/alerts/index.scss +2 -2
- package/autocomplete/README.md +25 -0
- package/autocomplete/autocomplete.scss +58 -0
- package/autocomplete/index.scss +4 -0
- package/autocomplete/suggester.scss +92 -0
- package/avatars/README.md +11 -23
- package/avatars/avatar-parent-child.scss +4 -3
- package/avatars/avatar-stack.scss +21 -13
- package/avatars/avatar.scss +31 -3
- package/avatars/circle-badge.scss +5 -4
- package/avatars/index.scss +5 -5
- package/base/README.md +11 -22
- package/base/base.scss +5 -4
- package/base/index.scss +6 -4
- package/base/kbd.scss +20 -0
- package/base/normalize.scss +5 -5
- package/base/octicons.scss +6 -0
- package/base/typography-base.scss +2 -0
- package/blankslate/README.md +11 -23
- package/blankslate/blankslate.scss +25 -12
- package/blankslate/index.scss +2 -2
- package/box/README.md +11 -23
- package/box/box.scss +52 -44
- package/box/index.scss +2 -2
- package/branch-name/README.md +11 -23
- package/branch-name/branch-name.scss +18 -8
- package/branch-name/index.scss +2 -2
- package/breadcrumb/README.md +17 -13
- package/breadcrumb/breadcrumb.scss +15 -5
- package/breadcrumb/index.scss +2 -2
- package/buttons/README.md +11 -23
- package/buttons/button-group.scss +2 -0
- package/buttons/button.scss +243 -143
- package/buttons/index.scss +4 -3
- package/buttons/misc.scss +222 -0
- package/color-modes/index.scss +9 -0
- package/color-modes/native.scss +10 -0
- package/color-modes/themes/dark.scss +7 -0
- package/color-modes/themes/dark_colorblind.scss +7 -0
- package/color-modes/themes/dark_dimmed.scss +7 -0
- package/color-modes/themes/dark_high_contrast.scss +7 -0
- package/color-modes/themes/light.scss +7 -0
- package/color-modes/themes/light_colorblind.scss +7 -0
- package/core/README.md +11 -23
- package/core/index.scss +19 -20
- package/deprecations.js +24 -0
- package/deprecations.json +539 -0
- package/dist/actionlist.css +2 -0
- package/dist/actionlist.css.map +1 -0
- package/dist/actionlist.js +1 -0
- package/dist/alerts.css +1 -2
- package/dist/alerts.css.map +1 -1
- package/dist/alerts.js +1 -1
- package/dist/autocomplete.css +2 -0
- package/dist/autocomplete.css.map +1 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatars.css +1 -2
- package/dist/avatars.css.map +1 -1
- package/dist/avatars.js +1 -1
- package/dist/base.css +1 -2
- package/dist/base.css.map +1 -1
- package/dist/base.js +1 -1
- package/dist/blankslate.css +1 -2
- package/dist/blankslate.css.map +1 -1
- package/dist/blankslate.js +1 -1
- package/dist/box.css +1 -2
- package/dist/box.css.map +1 -1
- package/dist/box.js +1 -1
- package/dist/branch-name.css +1 -2
- package/dist/branch-name.css.map +1 -1
- package/dist/branch-name.js +1 -1
- package/dist/breadcrumb.css +1 -2
- package/dist/breadcrumb.css.map +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/buttons.css +1 -2
- package/dist/buttons.css.map +1 -1
- package/dist/buttons.js +1 -1
- package/dist/color-modes.css +2 -0
- package/dist/color-modes.css.map +1 -0
- package/dist/color-modes.js +1 -0
- package/dist/core.css +3 -4
- package/dist/core.css.map +1 -1
- package/dist/core.js +1 -1
- package/dist/deprecations.json +539 -0
- package/dist/dropdown.css +2 -0
- package/dist/dropdown.css.map +1 -0
- package/dist/dropdown.js +1 -0
- package/dist/forms.css +1 -2
- package/dist/forms.css.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/header.css +2 -0
- package/dist/header.css.map +1 -0
- package/dist/header.js +1 -0
- package/dist/labels.css +1 -2
- package/dist/labels.css.map +1 -1
- package/dist/labels.js +1 -1
- package/dist/layout.css +1 -2
- package/dist/layout.css.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/links.css +2 -0
- package/dist/links.css.map +1 -0
- package/dist/links.js +1 -0
- package/dist/loaders.css +2 -0
- package/dist/loaders.css.map +1 -0
- package/dist/loaders.js +1 -0
- package/dist/markdown.css +1 -2
- package/dist/markdown.css.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/marketing-buttons.css +1 -2
- package/dist/marketing-buttons.css.map +1 -1
- package/dist/marketing-buttons.js +1 -1
- package/dist/marketing-support.css +1 -2
- package/dist/marketing-support.js +1 -1
- package/dist/marketing-type.css +1 -2
- package/dist/marketing-type.css.map +1 -1
- package/dist/marketing-type.js +1 -1
- package/dist/marketing-utilities.css +1 -2
- package/dist/marketing-utilities.css.map +1 -1
- package/dist/marketing-utilities.js +1 -1
- package/dist/marketing.css +3 -4
- package/dist/marketing.css.map +1 -1
- package/dist/marketing.js +1 -1
- package/dist/meta.json +317 -274
- package/dist/navigation.css +1 -2
- package/dist/navigation.css.map +1 -1
- package/dist/navigation.js +1 -1
- package/dist/pagination.css +1 -2
- package/dist/pagination.css.map +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.css +1 -2
- package/dist/popover.css.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/primer.css +13 -14
- package/dist/primer.css.map +1 -1
- package/dist/primer.js +1 -1
- package/dist/product.css +3 -4
- package/dist/product.css.map +1 -1
- package/dist/product.js +1 -1
- package/dist/progress.css +1 -2
- package/dist/progress.css.map +1 -1
- package/dist/progress.js +1 -1
- package/dist/select-menu.css +2 -0
- package/dist/select-menu.css.map +1 -0
- package/dist/select-menu.js +1 -0
- package/dist/stats/actionlist.json +1 -0
- package/dist/stats/alerts.json +1 -1
- package/dist/stats/autocomplete.json +1 -0
- package/dist/stats/avatars.json +1 -1
- package/dist/stats/base.json +1 -1
- package/dist/stats/blankslate.json +1 -1
- package/dist/stats/box.json +1 -1
- package/dist/stats/branch-name.json +1 -1
- package/dist/stats/breadcrumb.json +1 -1
- package/dist/stats/buttons.json +1 -1
- package/dist/stats/color-modes.json +1 -0
- package/dist/stats/core.json +1 -1
- package/dist/stats/dropdown.json +1 -0
- package/dist/stats/forms.json +1 -1
- package/dist/stats/header.json +1 -0
- package/dist/stats/labels.json +1 -1
- package/dist/stats/layout.json +1 -1
- package/dist/stats/links.json +1 -0
- package/dist/stats/loaders.json +1 -0
- package/dist/stats/markdown.json +1 -1
- package/dist/stats/marketing-buttons.json +1 -1
- package/dist/stats/marketing-support.json +1 -1
- package/dist/stats/marketing-type.json +1 -1
- package/dist/stats/marketing-utilities.json +1 -1
- package/dist/stats/marketing.json +1 -1
- package/dist/stats/navigation.json +1 -1
- package/dist/stats/pagination.json +1 -1
- package/dist/stats/popover.json +1 -1
- package/dist/stats/primer.json +1 -1
- package/dist/stats/product.json +1 -1
- package/dist/stats/progress.json +1 -1
- package/dist/stats/select-menu.json +1 -0
- package/dist/stats/subhead.json +1 -1
- package/dist/stats/support.json +1 -1
- package/dist/stats/table-object.json +1 -1
- package/dist/stats/timeline.json +1 -0
- package/dist/stats/toasts.json +1 -0
- package/dist/stats/tooltips.json +1 -1
- package/dist/stats/truncate.json +1 -1
- package/dist/stats/utilities.json +1 -1
- package/dist/subhead.css +1 -2
- package/dist/subhead.css.map +1 -1
- package/dist/subhead.js +1 -1
- package/dist/support.css +1 -1
- package/dist/support.js +1 -1
- package/dist/table-object.css +0 -1
- package/dist/table-object.css.map +1 -1
- package/dist/table-object.js +1 -1
- package/dist/timeline.css +2 -0
- package/dist/timeline.css.map +1 -0
- package/dist/timeline.js +1 -0
- package/dist/toasts.css +2 -0
- package/dist/toasts.css.map +1 -0
- package/dist/toasts.js +1 -0
- package/dist/tooltips.css +1 -2
- package/dist/tooltips.css.map +1 -1
- package/dist/tooltips.js +1 -1
- package/dist/truncate.css +1 -2
- package/dist/truncate.css.map +1 -1
- package/dist/truncate.js +1 -1
- package/dist/utilities.css +1 -2
- package/dist/utilities.css.map +1 -1
- package/dist/utilities.js +1 -1
- package/dist/variables.json +1352 -0
- package/dropdown/README.md +25 -0
- package/dropdown/dropdown.scss +272 -0
- package/dropdown/index.scss +2 -0
- package/forms/README.md +11 -23
- package/forms/form-control.scss +76 -32
- package/forms/form-group.scss +83 -46
- package/forms/form-select.scss +17 -5
- package/forms/form-validation.scss +51 -32
- package/forms/index.scss +7 -6
- package/forms/input-group.scss +2 -0
- package/forms/radio-group.scss +62 -0
- package/header/README.md +25 -0
- package/header/header.scss +47 -0
- package/header/index.scss +2 -0
- package/index.scss +7 -4
- package/labels/README.md +11 -23
- package/labels/counters.scss +24 -13
- package/labels/diffstat.scss +37 -0
- package/labels/index.scss +8 -4
- package/labels/issue-labels.scss +23 -0
- package/labels/labels.scss +59 -40
- package/labels/mixins.scss +32 -0
- package/labels/states.scss +40 -19
- package/layout/README.md +11 -23
- package/layout/container.scss +0 -8
- package/layout/grid-offset.scss +11 -11
- package/layout/grid.scss +23 -23
- package/layout/index.scss +7 -5
- package/layout/layout.scss +185 -0
- package/layout/mixins.scss +79 -0
- package/links/README.md +25 -0
- package/links/index.scss +3 -0
- package/links/link.scss +55 -0
- package/loaders/README.md +25 -0
- package/loaders/index.scss +2 -0
- package/loaders/loaders.scss +19 -0
- package/markdown/README.md +11 -23
- package/markdown/blob-csv.scss +4 -2
- package/markdown/code.scss +11 -3
- package/markdown/footnotes.scss +37 -0
- package/markdown/headings.scss +13 -4
- package/markdown/images.scss +15 -4
- package/markdown/index.scss +9 -8
- package/markdown/lists.scss +19 -5
- package/markdown/markdown-body.scss +15 -18
- package/markdown/tables.scss +8 -5
- package/marketing/README.md +11 -23
- package/marketing/buttons/button.scss +82 -61
- package/marketing/index.scss +6 -11
- package/marketing/support/index.scss +1 -0
- package/marketing/support/mixins.scss +66 -0
- package/marketing/support/variables.scss +110 -51
- package/marketing/type/typography.scss +100 -62
- package/marketing/utilities/animations.scss +9 -0
- package/marketing/utilities/filters.scss +0 -1
- package/marketing/utilities/index.scss +2 -3
- package/marketing/utilities/layout.scss +32 -11
- package/navigation/README.md +11 -23
- package/navigation/filter-list.scss +16 -14
- package/navigation/index.scss +7 -6
- package/navigation/menu.scss +44 -35
- package/navigation/sidenav.scss +108 -0
- package/navigation/subnav.scss +28 -21
- package/navigation/tabnav.scss +45 -21
- package/navigation/underline-nav.scss +36 -22
- package/package.json +78 -107
- package/pagination/README.md +12 -14
- package/pagination/index.scss +2 -2
- package/pagination/pagination.scss +61 -37
- package/popover/README.md +11 -24
- package/popover/index.scss +2 -2
- package/popover/popover.scss +18 -9
- package/postcss.config.cjs +22 -0
- package/prettier.config.cjs +1 -0
- package/product/README.md +11 -23
- package/product/index.scss +19 -17
- package/progress/README.md +11 -23
- package/progress/index.scss +2 -2
- package/progress/progress.scss +11 -1
- package/select-menu/README.md +25 -0
- package/select-menu/index.scss +3 -0
- package/select-menu/select-menu.scss +464 -0
- package/stylelint.config.cjs +16 -0
- package/subhead/README.md +11 -25
- package/subhead/index.scss +2 -2
- package/subhead/subhead.scss +10 -4
- package/support/README.md +12 -18
- package/support/index.scss +7 -8
- package/support/mixins/color-modes.scss +106 -0
- package/support/mixins/misc.scss +9 -12
- package/support/mixins/typography.scss +1 -1
- package/support/variables/layout.scss +106 -11
- package/support/variables/misc.scss +7 -30
- package/support/variables/typography.scss +4 -4
- package/table-object/README.md +11 -24
- package/table-object/index.scss +1 -1
- package/timeline/README.md +25 -0
- package/timeline/index.scss +2 -0
- package/timeline/timeline-item.scss +95 -0
- package/toasts/README.md +25 -0
- package/toasts/index.scss +2 -0
- package/toasts/toasts.scss +124 -0
- package/tooltips/README.md +11 -24
- package/tooltips/index.scss +2 -2
- package/tooltips/tooltips.scss +17 -8
- package/truncate/README.md +11 -24
- package/truncate/index.scss +2 -1
- package/truncate/truncate.scss +41 -7
- package/utilities/README.md +11 -23
- package/utilities/animations.scss +14 -2
- package/utilities/borders.scss +29 -65
- package/utilities/box-shadow.scss +8 -9
- package/utilities/colors.scss +71 -110
- package/utilities/details.scss +12 -4
- package/utilities/flexbox.scss +14 -14
- package/utilities/index.scss +12 -12
- package/utilities/layout.scss +28 -22
- package/utilities/margin.scss +34 -17
- package/utilities/padding.scss +13 -9
- package/utilities/typography.scss +54 -25
- package/utilities/visibility-display.scss +0 -13
- package/.browserslistrc +0 -6
- package/.eslintrc.json +0 -13
- package/.stylelintrc.json +0 -9
- package/MIGRATING.md +0 -70
- package/bin/primer-migrate +0 -86
- package/build/build.css +0 -23
- package/build/build.json +0 -1
- package/build/index.js +0 -1
- package/dist/marketing-support.css.map +0 -1
- package/dist/support.css.map +0 -1
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/layout/columns.scss +0 -56
- package/marketing/buttons/README.md +0 -39
- package/marketing/support/README.md +0 -31
- package/marketing/type/README.md +0 -39
- package/marketing/utilities/README.md +0 -36
- package/marketing/utilities/margin.scss +0 -18
- package/marketing/utilities/padding.scss +0 -28
- package/postcss.config.js +0 -14
- package/prettier.config.js +0 -1
- package/support/mixins/buttons.scss +0 -160
- package/support/variables/color-system.scss +0 -243
- package/support/variables/colors.scss +0 -70
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// stylelint-disable
|
|
2
|
-
// stylelint-disable block-closing-brace-space-before, selector-list-comma-newline-after, comment-empty-line-before
|
|
1
|
+
// stylelint-disable comment-empty-line-before
|
|
3
2
|
|
|
4
3
|
// Type scale variables found in ../support/lib/variables.scss
|
|
5
4
|
// $h00-size-mobile: 40px;
|
|
@@ -18,6 +17,7 @@
|
|
|
18
17
|
|
|
19
18
|
/* Set the font size to 26px */
|
|
20
19
|
.h1 {
|
|
20
|
+
// stylelint-disable-next-line primer/typography
|
|
21
21
|
font-size: $h1-size-mobile !important;
|
|
22
22
|
|
|
23
23
|
@include breakpoint(md) { font-size: $h1-size !important; }
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
/* Set the font size to 22px */
|
|
27
27
|
.h2 {
|
|
28
|
+
// stylelint-disable-next-line primer/typography
|
|
28
29
|
font-size: $h2-size-mobile !important;
|
|
29
30
|
|
|
30
31
|
@include breakpoint(md) { font-size: $h2-size !important; }
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
|
|
33
34
|
/* Set the font size to 18px */
|
|
34
35
|
.h3 {
|
|
36
|
+
// stylelint-disable-next-line primer/typography
|
|
35
37
|
font-size: $h3-size-mobile !important;
|
|
36
38
|
|
|
37
39
|
@include breakpoint(md) { font-size: $h3-size !important; }
|
|
@@ -51,11 +53,17 @@
|
|
|
51
53
|
.h6 { font-size: $h6-size !important; }
|
|
52
54
|
|
|
53
55
|
// Heading utilities
|
|
54
|
-
.h1,
|
|
56
|
+
.h1,
|
|
57
|
+
.h2,
|
|
58
|
+
.h3,
|
|
59
|
+
.h4,
|
|
60
|
+
.h5,
|
|
61
|
+
.h6 { font-weight: $font-weight-bold !important; }
|
|
55
62
|
|
|
56
63
|
// Type utilities that match type sale
|
|
57
64
|
/* Set the font size to 26px */
|
|
58
65
|
.f1 {
|
|
66
|
+
// stylelint-disable-next-line primer/typography
|
|
59
67
|
font-size: $h1-size-mobile !important;
|
|
60
68
|
|
|
61
69
|
@include breakpoint(md) { font-size: $h1-size !important; }
|
|
@@ -63,6 +71,7 @@
|
|
|
63
71
|
|
|
64
72
|
/* Set the font size to 22px */
|
|
65
73
|
.f2 {
|
|
74
|
+
// stylelint-disable-next-line primer/typography
|
|
66
75
|
font-size: $h2-size-mobile !important;
|
|
67
76
|
|
|
68
77
|
@include breakpoint(md) { font-size: $h2-size !important; }
|
|
@@ -70,6 +79,7 @@
|
|
|
70
79
|
|
|
71
80
|
/* Set the font size to 18px */
|
|
72
81
|
.f3 {
|
|
82
|
+
// stylelint-disable-next-line primer/typography
|
|
73
83
|
font-size: $h3-size-mobile !important;
|
|
74
84
|
|
|
75
85
|
@include breakpoint(md) { font-size: $h3-size !important; }
|
|
@@ -90,6 +100,7 @@
|
|
|
90
100
|
// Type utils with light weight that match type scale
|
|
91
101
|
/* Set the font size to 40px and weight to light */
|
|
92
102
|
.f00-light {
|
|
103
|
+
// stylelint-disable-next-line primer/typography
|
|
93
104
|
font-size: $h00-size-mobile !important;
|
|
94
105
|
font-weight: $font-weight-light !important;
|
|
95
106
|
|
|
@@ -98,6 +109,7 @@
|
|
|
98
109
|
|
|
99
110
|
/* Set the font size to 32px and weight to light */
|
|
100
111
|
.f0-light {
|
|
112
|
+
// stylelint-disable-next-line primer/typography
|
|
101
113
|
font-size: $h0-size-mobile !important;
|
|
102
114
|
font-weight: $font-weight-light !important;
|
|
103
115
|
|
|
@@ -106,6 +118,7 @@
|
|
|
106
118
|
|
|
107
119
|
/* Set the font size to 26px and weight to light */
|
|
108
120
|
.f1-light {
|
|
121
|
+
// stylelint-disable-next-line primer/typography
|
|
109
122
|
font-size: $h1-size-mobile !important;
|
|
110
123
|
font-weight: $font-weight-light !important;
|
|
111
124
|
|
|
@@ -114,6 +127,7 @@
|
|
|
114
127
|
|
|
115
128
|
/* Set the font size to 22px and weight to light */
|
|
116
129
|
.f2-light {
|
|
130
|
+
// stylelint-disable-next-line primer/typography
|
|
117
131
|
font-size: $h2-size-mobile !important;
|
|
118
132
|
font-weight: $font-weight-light !important;
|
|
119
133
|
|
|
@@ -123,6 +137,7 @@
|
|
|
123
137
|
// Same size and weight as .lead but without color property
|
|
124
138
|
/* Set the font size to 18px and weight to light */
|
|
125
139
|
.f3-light {
|
|
140
|
+
// stylelint-disable-next-line primer/typography
|
|
126
141
|
font-size: $h3-size-mobile !important;
|
|
127
142
|
font-weight: $font-weight-light !important;
|
|
128
143
|
|
|
@@ -135,24 +150,29 @@
|
|
|
135
150
|
|
|
136
151
|
/* Large leading paragraphs */
|
|
137
152
|
.lead {
|
|
153
|
+
// stylelint-disable-next-line primer/spacing
|
|
138
154
|
margin-bottom: 30px;
|
|
139
155
|
font-size: $h3-size;
|
|
140
156
|
font-weight: $font-weight-light;
|
|
141
|
-
color: $gray-600;
|
|
142
157
|
}
|
|
143
158
|
|
|
144
159
|
// Line-height variations
|
|
145
160
|
// Close to commonly used line-heights. Most line-heights
|
|
146
161
|
// combined with type size equate to whole pixels.
|
|
147
162
|
// Will be improved with future typography scale updates.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
163
|
+
// Responsive line-height
|
|
164
|
+
@each $breakpoint, $variant in $responsive-variants {
|
|
165
|
+
@include breakpoint($breakpoint) {
|
|
166
|
+
/* Set the line height to ultra condensed */
|
|
167
|
+
.lh#{$variant}-condensed-ultra { line-height: $lh-condensed-ultra !important; }
|
|
168
|
+
/* Set the line height to condensed */
|
|
169
|
+
.lh#{$variant}-condensed { line-height: $lh-condensed !important; }
|
|
170
|
+
/* Set the line height to default */
|
|
171
|
+
.lh#{$variant}-default { line-height: $lh-default !important; }
|
|
172
|
+
/* Set the line height to zero */
|
|
173
|
+
.lh#{$variant}-0 { line-height: 0 !important; }
|
|
174
|
+
}
|
|
175
|
+
}
|
|
156
176
|
|
|
157
177
|
// Text alignments
|
|
158
178
|
// Responsive text alignment
|
|
@@ -171,7 +191,9 @@
|
|
|
171
191
|
/* Set the font weight to normal */
|
|
172
192
|
.text-normal { font-weight: $font-weight-normal !important; }
|
|
173
193
|
/* Set the font weight to bold */
|
|
174
|
-
.text-bold { font-weight: $font-weight-bold !important;}
|
|
194
|
+
.text-bold { font-weight: $font-weight-bold !important; }
|
|
195
|
+
.text-semibold { font-weight: $font-weight-semibold !important; }
|
|
196
|
+
.text-light { font-weight: $font-weight-light !important; }
|
|
175
197
|
/* Set the font to italic */
|
|
176
198
|
.text-italic { font-style: italic !important; }
|
|
177
199
|
/* Make text uppercase */
|
|
@@ -184,27 +206,34 @@
|
|
|
184
206
|
.no-wrap { white-space: nowrap !important; }
|
|
185
207
|
/* Normal white space */
|
|
186
208
|
.ws-normal { white-space: normal !important; }
|
|
187
|
-
|
|
209
|
+
|
|
210
|
+
/* Force long "words" to wrap if they exceed the width of the container */
|
|
211
|
+
.wb-break-word {
|
|
212
|
+
word-break: break-word !important;
|
|
213
|
+
// this is for backwards compatibility with browsers that don't respect overflow-wrap
|
|
214
|
+
word-wrap: break-word !important;
|
|
215
|
+
overflow-wrap: break-word !important;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/*
|
|
219
|
+
* Specifically apply word-break: break-all; per MDN:
|
|
220
|
+
*
|
|
221
|
+
* > Note: In contrast to `word-break: break-word` and `overflow-wrap: break-word`,
|
|
222
|
+
* > `word-break: break-all` will create a break at the exact place where text would
|
|
223
|
+
* > otherwise overflow its container (even if putting an entire word on its own line
|
|
224
|
+
* > would negate the need for a break).
|
|
225
|
+
*
|
|
226
|
+
* see: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Values
|
|
227
|
+
*/
|
|
188
228
|
.wb-break-all { word-break: break-all !important; }
|
|
189
229
|
|
|
190
230
|
.text-emphasized {
|
|
191
231
|
font-weight: $font-weight-bold;
|
|
192
|
-
color: $text-gray-dark;
|
|
193
232
|
}
|
|
194
233
|
|
|
195
234
|
// List styles
|
|
196
235
|
.list-style-none { list-style: none !important; }
|
|
197
236
|
|
|
198
|
-
// Text Shadows
|
|
199
|
-
/* Add a dark text shadow */
|
|
200
|
-
.text-shadow-dark {
|
|
201
|
-
text-shadow: 0 1px 1px rgba($black, 0.25), 0 1px 25px rgba($black, 0.75);
|
|
202
|
-
}
|
|
203
|
-
/* Add a light text shadow */
|
|
204
|
-
.text-shadow-light {
|
|
205
|
-
text-shadow: 0 1px 0 rgba($white, 0.5);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
237
|
/* Set to monospace font */
|
|
209
238
|
.text-mono {
|
|
210
239
|
font-family: $mono-font !important;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
// Visibility and display utilities
|
|
2
|
-
// stylelint-disable primer/selector-no-utility
|
|
3
|
-
// stylelint-disable block-opening-brace-space-after, block-opening-brace-space-before, comment-empty-line-before
|
|
4
|
-
|
|
5
|
-
$display-values: (
|
|
6
|
-
block,
|
|
7
|
-
flex,
|
|
8
|
-
inline,
|
|
9
|
-
inline-block,
|
|
10
|
-
inline-flex,
|
|
11
|
-
none,
|
|
12
|
-
table,
|
|
13
|
-
table-cell
|
|
14
|
-
);
|
|
15
2
|
|
|
16
3
|
// Responsive display utilities
|
|
17
4
|
@each $breakpoint, $variant in $responsive-variants {
|
package/.browserslistrc
DELETED
package/.eslintrc.json
DELETED
package/.stylelintrc.json
DELETED
package/MIGRATING.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# 12.0.0
|
|
2
|
-
The v12 release marks a major transition from small, single-purpose npm packages (`primer-core`, `primer-marketing`, `primer-utilities`, etc.) to a single package — `@primer/css` — which contains all of the SCSS source files in subdirectories. Here's what you need to do to migrate different parts of your app:
|
|
3
|
-
|
|
4
|
-
## npm
|
|
5
|
-
First, install the new package.
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
npm install --save @primer/css
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
If you use the `primer` package, all you'll need to do is:
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
npm uninstall --save primer
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
If you use other packages, such as `primer-utilities`, you will need to uninstall each one by name or use a command line tool like [jq](https://stedolan.github.io/jq/) to list them:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
jq -r '.dependencies | keys[] | select(.|startswith("primer"))' package.json
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
And, if you're feeling saucy, uninstall them all by piping that to `xargs npm uninstall`. :sparkles:
|
|
24
|
-
|
|
25
|
-
## Sass
|
|
26
|
-
There are a couple of things you'll need to change in your Sass setup when migrating to v12. This section is intentionally vague because environments vary wildly between text editors, Sass implementations, and application frameworks. When in doubt, consult the relevant documentation, and feel free to [file an issue][help] if you think that we can help.
|
|
27
|
-
|
|
28
|
-
### Sass imports
|
|
29
|
-
Generally speaking, all of your Sass `@import` statements can be migrated with the following search-and-replace operations, **in the following order**:
|
|
30
|
-
|
|
31
|
-
* If you import `primer/index.scss` or `primer`, just replace `primer` with `@primer/css` and you're done!
|
|
32
|
-
* Otherwise...
|
|
33
|
-
1. Replace `primer-marketing-` with `@primer/css/marketing/`, e.g.
|
|
34
|
-
* `primer-marketing-buttons/index.scss` becomes `@primer/css/marketing/buttons/index.scss`
|
|
35
|
-
* `primer-marketing-utilities/index.scss` becomes `@primer/css/marketing/utilities/index.scss`
|
|
36
|
-
1. Replace `primer-` with `@primer/css/`, e.g.
|
|
37
|
-
* `primer-markdown/index.scss` becomes `@primer/css/markdown/index.scss`
|
|
38
|
-
* `primer-utilities/index.scss` becomes `@primer/css/utilities/index.scss`
|
|
39
|
-
1. Delete `lib/` from every Primer CSS path, e.g.
|
|
40
|
-
* `primer-forms/lib/form-control.scss` becomes `@primer/css/forms/form-control.scss`
|
|
41
|
-
* `primer-navigation/lib/subnav.scss` becomes `@primer/css/navigation/subnav.scss`
|
|
42
|
-
|
|
43
|
-
If your text editor supports search and replace regular expressions, the following patterns should work:
|
|
44
|
-
|
|
45
|
-
| find | replace |
|
|
46
|
-
| :--- | :--- |
|
|
47
|
-
| `primer-marketing-(\w+)(\/lib)?` | `@primer/css/marketing/$1` |
|
|
48
|
-
| `primer-(\w+)(\/lib)?` | `@primer/css/$1` |
|
|
49
|
-
| `primer\b` | `@primer/css`
|
|
50
|
-
|
|
51
|
-
#### `primer-migrate`
|
|
52
|
-
You can also use the included [`primer-migrate` script](bin/primer-migrate):
|
|
53
|
-
|
|
54
|
-
```sh
|
|
55
|
-
npx -p @primer/css primer-migrate path/to/**/*.scss
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Sass include paths
|
|
59
|
-
If you've installed Primer CSS with npm, you very likely already have `node_modules` listed in your Sass `includePaths` option, and you won't need to change anything. :tada:
|
|
60
|
-
|
|
61
|
-
If you've installed Primer CSS with something _other than_ npm, or you don't know how it was installed, consult the documentation for your setup first, then [let us know][help] if you still can't figure it out.
|
|
62
|
-
|
|
63
|
-
## Fonts
|
|
64
|
-
The marketing-specific font files published in the [`fonts` directory](https://unpkg.com/primer-marketing-support@2.0.0/fonts/) of `primer-marketing-support@2.0.0` are published in the `fonts` directory of `@primer/css`. If you use these fonts, you'll need to do the following:
|
|
65
|
-
|
|
66
|
-
1. Update any scripts that copy the `.woff` font files from `node_modules/primer-marketing-support/fonts` into your application to look for them in `node_modules/@primer/css/fonts`.
|
|
67
|
-
1. Update any webpack (or other bundler) resolution rules that look for fonts in `primer-marketing-support/fonts` to look for them in `@primer/css/fonts`.
|
|
68
|
-
1. Customize the [`$marketing-font-path` variable](src/marketing/support/variables.scss#L1) to match the path from which they're served.
|
|
69
|
-
|
|
70
|
-
[help]: https://github.com/primer/css/issues/new?title=Help!&labels=v12,migration
|
package/bin/primer-migrate
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* XXX: we use Node.js native modules only here to avoid
|
|
5
|
-
* requiring any runtime dependencies when folks install
|
|
6
|
-
* @primer/css
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const fs = require('fs')
|
|
10
|
-
const {promisify} = require('util')
|
|
11
|
-
const readFile = promisify(fs.readFile)
|
|
12
|
-
const writeFile = promisify(fs.writeFile)
|
|
13
|
-
const {dirname, join} = require('path')
|
|
14
|
-
|
|
15
|
-
const IMPORT_PATTERN = /\@import\s+['"]([^'"]+)['"]/g
|
|
16
|
-
const replacements = [
|
|
17
|
-
[/primer-marketing-(\w+)(\/lib)?/, '@primer/css/marketing/$1'],
|
|
18
|
-
[/primer-(\w+)(\/lib)?/, '@primer/css/$1'],
|
|
19
|
-
[/primer\b/, '@primer/css']
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
const paths = process.argv.slice(2)
|
|
23
|
-
const warn = (...args) => console.warn(...args)
|
|
24
|
-
|
|
25
|
-
if (paths.length) {
|
|
26
|
-
Promise.all(
|
|
27
|
-
paths.map(path => {
|
|
28
|
-
return migrate(path).then(reps => report(reps, path))
|
|
29
|
-
})
|
|
30
|
-
).catch(die)
|
|
31
|
-
} else {
|
|
32
|
-
readFile('/dev/stdin', 'utf8')
|
|
33
|
-
.then(input => {
|
|
34
|
-
const [output, reps] = replace(input)
|
|
35
|
-
report(reps, 'stdin')
|
|
36
|
-
process.stdout.write(output)
|
|
37
|
-
})
|
|
38
|
-
.catch(die)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function migrate(path) {
|
|
42
|
-
return readFile(path, 'utf8').then(input => {
|
|
43
|
-
if (!IMPORT_PATTERN.test(input)) {
|
|
44
|
-
warn(`No SCSS imports found in ${path}`)
|
|
45
|
-
return false
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const [output, reps] = replace(input)
|
|
49
|
-
if (reps.length) {
|
|
50
|
-
return writeFile(path, output, 'utf8').then(() => reps)
|
|
51
|
-
} else {
|
|
52
|
-
return false
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function replace(input) {
|
|
58
|
-
const reps = []
|
|
59
|
-
const output = input.replace(IMPORT_PATTERN, (str, path) => {
|
|
60
|
-
for (const [from, to] of replacements) {
|
|
61
|
-
if (from.test(path)) {
|
|
62
|
-
const replaced = str.replace(from, to)
|
|
63
|
-
reps.push([path, path.replace(from, to)])
|
|
64
|
-
return replaced
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return str
|
|
68
|
-
})
|
|
69
|
-
return [output, reps]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function report(reps, path) {
|
|
73
|
-
if (reps.length) {
|
|
74
|
-
warn(`Replaced ${reps.length} imports in ${path}:`)
|
|
75
|
-
for (const [i, [from, to]] of Object.entries(reps)) {
|
|
76
|
-
warn(` ${Number(i) + 1}. (${from}) -> (${to})`)
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
warn(`No legacy imports found in ${path}`)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function die(error) {
|
|
84
|
-
console.error(error)
|
|
85
|
-
process.exitCode = 1
|
|
86
|
-
}
|