@primer/css 0.0.0-1ea75fe → 0.0.0-202110100305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1231 -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 +316 -273
- 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 +8 -5
- package/layout/layout-beta.scss +339 -0
- 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 +103 -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
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
// stylelint-disable selector-max-type
|
|
2
|
+
// selector-max-type is needed for body:not(.intent-mouse) to target keyboard only styles.
|
|
3
|
+
|
|
4
|
+
$SelectMenu-max-height: 480px !default;
|
|
5
|
+
|
|
6
|
+
// Select Menu
|
|
7
|
+
//
|
|
8
|
+
// A more advanced menu with support for navigation, filtering, and more.
|
|
9
|
+
|
|
10
|
+
.SelectMenu {
|
|
11
|
+
position: fixed;
|
|
12
|
+
top: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
z-index: 99;
|
|
17
|
+
display: flex;
|
|
18
|
+
padding: $spacer-3;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
|
|
22
|
+
@include breakpoint(sm) {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: auto;
|
|
25
|
+
right: auto;
|
|
26
|
+
bottom: auto;
|
|
27
|
+
left: auto;
|
|
28
|
+
padding: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Backdrop
|
|
33
|
+
//
|
|
34
|
+
// Adds a dark, semi transparent "cover" underneat the modal. Only visible for xs.
|
|
35
|
+
|
|
36
|
+
.SelectMenu::before {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
content: '';
|
|
44
|
+
background-color: var(--color-primer-canvas-backdrop);
|
|
45
|
+
|
|
46
|
+
@include breakpoint(sm) {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Modal
|
|
52
|
+
//
|
|
53
|
+
// The main "box" that contains the content
|
|
54
|
+
|
|
55
|
+
.SelectMenu-modal {
|
|
56
|
+
position: relative;
|
|
57
|
+
z-index: 99; // Needs to be higher than .details-overlay's z-index: 80.
|
|
58
|
+
display: flex;
|
|
59
|
+
max-height: 66%;
|
|
60
|
+
margin: auto 0;
|
|
61
|
+
overflow: hidden; // Enables border radius on scrollable child elements
|
|
62
|
+
pointer-events: auto;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
background-color: var(--color-canvas-overlay);
|
|
65
|
+
border: $border-width $border-style var(--color-select-menu-backdrop-border);
|
|
66
|
+
// stylelint-disable-next-line primer/borders
|
|
67
|
+
border-radius: $border-radius * 2;
|
|
68
|
+
box-shadow: var(--color-shadow-large);
|
|
69
|
+
animation: SelectMenu-modal-animation 0.12s cubic-bezier(0, 0.1, 0.1, 1) backwards;
|
|
70
|
+
|
|
71
|
+
@keyframes SelectMenu-modal-animation {
|
|
72
|
+
0% {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
transform: scale(0.9);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes SelectMenu-modal-animation--sm {
|
|
79
|
+
0% {
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transform: translateY(-$spacer-3);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@include breakpoint(sm) {
|
|
86
|
+
width: 300px;
|
|
87
|
+
height: auto;
|
|
88
|
+
max-height: $SelectMenu-max-height;
|
|
89
|
+
margin: $spacer-2 0 $spacer-3 0;
|
|
90
|
+
font-size: $font-size-small;
|
|
91
|
+
border-color: var(--color-border-default);
|
|
92
|
+
border-radius: $border-radius;
|
|
93
|
+
box-shadow: var(--color-shadow-large);
|
|
94
|
+
animation-name: SelectMenu-modal-animation--sm;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Header
|
|
99
|
+
//
|
|
100
|
+
// Used for showing a title and the close button. Close button is only visible for xs.
|
|
101
|
+
|
|
102
|
+
.SelectMenu-header {
|
|
103
|
+
display: flex;
|
|
104
|
+
padding: $spacer-3;
|
|
105
|
+
flex: none; // fixes header from getting squeezed in Safari iOS
|
|
106
|
+
align-items: center;
|
|
107
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
108
|
+
|
|
109
|
+
@include breakpoint(sm) {
|
|
110
|
+
// stylelint-disable-next-line primer/spacing
|
|
111
|
+
padding: 7px 7px 7px $spacer-3;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.SelectMenu-title {
|
|
116
|
+
flex: 1;
|
|
117
|
+
font-size: $body-font-size;
|
|
118
|
+
font-weight: $font-weight-bold;
|
|
119
|
+
|
|
120
|
+
@include breakpoint(sm) {
|
|
121
|
+
font-size: inherit;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.SelectMenu-closeButton {
|
|
126
|
+
padding: $spacer-3;
|
|
127
|
+
margin: -$spacer-3;
|
|
128
|
+
line-height: 1;
|
|
129
|
+
color: var(--color-fg-muted);
|
|
130
|
+
background-color: transparent;
|
|
131
|
+
border: 0;
|
|
132
|
+
|
|
133
|
+
@include breakpoint(sm) {
|
|
134
|
+
padding: $spacer-2;
|
|
135
|
+
// stylelint-disable-next-line primer/spacing
|
|
136
|
+
margin: (-$spacer-2) (-7px); // Using -7px fixes a :focus glitch
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Filter
|
|
141
|
+
//
|
|
142
|
+
// An input to filter a large list
|
|
143
|
+
|
|
144
|
+
.SelectMenu-filter {
|
|
145
|
+
padding: $spacer-3;
|
|
146
|
+
margin: 0;
|
|
147
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
148
|
+
|
|
149
|
+
@include breakpoint(sm) {
|
|
150
|
+
padding: $spacer-2;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.SelectMenu-input {
|
|
155
|
+
display: block;
|
|
156
|
+
width: 100%;
|
|
157
|
+
|
|
158
|
+
@include breakpoint(sm) {
|
|
159
|
+
font-size: $h5-size;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// List
|
|
164
|
+
//
|
|
165
|
+
// The container that holds all the list items. Starts scrolling when the list gets too long.
|
|
166
|
+
|
|
167
|
+
.SelectMenu-list {
|
|
168
|
+
position: relative;
|
|
169
|
+
padding: 0;
|
|
170
|
+
margin: 0;
|
|
171
|
+
// stylelint-disable-next-line primer/spacing
|
|
172
|
+
margin-bottom: -$border-width; // Hides the last border in the list
|
|
173
|
+
flex: auto;
|
|
174
|
+
overflow-x: hidden;
|
|
175
|
+
overflow-y: auto;
|
|
176
|
+
background-color: var(--color-canvas-overlay);
|
|
177
|
+
-webkit-overflow-scrolling: touch; // Adds momentum + bouncy scrolling
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// List Item
|
|
181
|
+
//
|
|
182
|
+
// The interactive element used to make a selection
|
|
183
|
+
|
|
184
|
+
.SelectMenu-item {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
width: 100%;
|
|
188
|
+
padding: $spacer-3;
|
|
189
|
+
overflow: hidden;
|
|
190
|
+
color: var(--color-fg-default);
|
|
191
|
+
text-align: left;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
background-color: var(--color-canvas-overlay);
|
|
194
|
+
border: 0;
|
|
195
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
196
|
+
|
|
197
|
+
@include breakpoint(sm) {
|
|
198
|
+
// stylelint-disable-next-line primer/spacing
|
|
199
|
+
padding-top: 7px;
|
|
200
|
+
// stylelint-disable-next-line primer/spacing
|
|
201
|
+
padding-bottom: 7px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Borderless
|
|
205
|
+
.SelectMenu-list--borderless & {
|
|
206
|
+
border-bottom: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Icon
|
|
211
|
+
//
|
|
212
|
+
// Icon shown on the left of a list item.
|
|
213
|
+
|
|
214
|
+
.SelectMenu-icon {
|
|
215
|
+
width: $spacer-3; // fixed width to make sure following content aligns
|
|
216
|
+
margin-right: $spacer-2;
|
|
217
|
+
flex-shrink: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Check icon
|
|
221
|
+
.SelectMenu-icon--check {
|
|
222
|
+
visibility: hidden;
|
|
223
|
+
transition: transform 0.12s cubic-bezier(0.5, 0.1, 1, 0.5), visibility 0s 0.12s linear;
|
|
224
|
+
transform: scale(0);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Tabs
|
|
228
|
+
//
|
|
229
|
+
// Allows switching between multiple lists
|
|
230
|
+
|
|
231
|
+
.SelectMenu-tabs {
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-shrink: 0;
|
|
234
|
+
overflow-x: auto;
|
|
235
|
+
overflow-y: hidden;
|
|
236
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
237
|
+
box-shadow: inset 0 -1px 0 var(--color-border-muted);
|
|
238
|
+
-webkit-overflow-scrolling: touch;
|
|
239
|
+
|
|
240
|
+
// Hide scrollbar so it doesn't cover the text
|
|
241
|
+
&::-webkit-scrollbar {
|
|
242
|
+
display: none;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@include breakpoint(sm) {
|
|
246
|
+
padding: $spacer-2 $spacer-2 0 $spacer-2;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.SelectMenu-tab {
|
|
251
|
+
flex: 1;
|
|
252
|
+
padding: $spacer-2 $spacer-3;
|
|
253
|
+
font-size: $font-size-small;
|
|
254
|
+
font-weight: $font-weight-semibold;
|
|
255
|
+
color: var(--color-fg-muted);
|
|
256
|
+
text-align: center;
|
|
257
|
+
background-color: transparent;
|
|
258
|
+
border: 0;
|
|
259
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
260
|
+
box-shadow: inset 0 -1px 0 var(--color-border-muted);
|
|
261
|
+
|
|
262
|
+
@include breakpoint(sm) {
|
|
263
|
+
flex: none;
|
|
264
|
+
padding: $spacer-1 $spacer-3;
|
|
265
|
+
border: $border-width $border-style transparent;
|
|
266
|
+
border-bottom-width: 0;
|
|
267
|
+
border-top-left-radius: $border-radius;
|
|
268
|
+
border-top-right-radius: $border-radius;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
&[aria-selected='true'] {
|
|
272
|
+
z-index: 1; // Keeps box-shadow visible when hovering
|
|
273
|
+
color: var(--color-fg-default);
|
|
274
|
+
cursor: default;
|
|
275
|
+
background-color: var(--color-canvas-overlay);
|
|
276
|
+
// stylelint-disable-next-line primer/box-shadow
|
|
277
|
+
box-shadow: 0 0 0 1px var(--color-border-muted);
|
|
278
|
+
|
|
279
|
+
@include breakpoint(sm) {
|
|
280
|
+
border-color: var(--color-border-muted);
|
|
281
|
+
box-shadow: none;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Message
|
|
287
|
+
//
|
|
288
|
+
// A container used to show different kinds of text messages.
|
|
289
|
+
|
|
290
|
+
.SelectMenu-message {
|
|
291
|
+
// stylelint-disable-next-line primer/spacing
|
|
292
|
+
padding: 7px $spacer-3;
|
|
293
|
+
text-align: center;
|
|
294
|
+
background-color: var(--color-canvas-overlay);
|
|
295
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Blankslate and Loading
|
|
299
|
+
//
|
|
300
|
+
// A container used to show a blankslate or the loading animation.
|
|
301
|
+
|
|
302
|
+
.SelectMenu-blankslate,
|
|
303
|
+
.SelectMenu-loading {
|
|
304
|
+
padding: $spacer-4 $spacer-3;
|
|
305
|
+
text-align: center;
|
|
306
|
+
background-color: var(--color-canvas-overlay);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Divider
|
|
310
|
+
//
|
|
311
|
+
// Can be used to divide the list into multiple groups
|
|
312
|
+
|
|
313
|
+
.SelectMenu-divider {
|
|
314
|
+
padding: $spacer-1 $spacer-3;
|
|
315
|
+
margin: 0;
|
|
316
|
+
font-size: $font-size-small;
|
|
317
|
+
font-weight: $font-weight-semibold;
|
|
318
|
+
color: var(--color-fg-muted);
|
|
319
|
+
background-color: var(--color-canvas-subtle);
|
|
320
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
321
|
+
|
|
322
|
+
// Borderless
|
|
323
|
+
.SelectMenu-list--borderless & {
|
|
324
|
+
border-top: $border-width $border-style var(--color-border-muted);
|
|
325
|
+
|
|
326
|
+
&:empty {
|
|
327
|
+
padding: 0;
|
|
328
|
+
border-top: 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Footer
|
|
334
|
+
//
|
|
335
|
+
// A container at the bottom.
|
|
336
|
+
|
|
337
|
+
.SelectMenu-footer {
|
|
338
|
+
z-index: 0; // Avoid top border from getting covered by the negative margin of the list
|
|
339
|
+
padding: $spacer-2 $spacer-3;
|
|
340
|
+
font-size: $font-size-small;
|
|
341
|
+
color: var(--color-fg-muted);
|
|
342
|
+
text-align: center;
|
|
343
|
+
border-top: $border-width $border-style var(--color-border-muted);
|
|
344
|
+
|
|
345
|
+
@include breakpoint(sm) {
|
|
346
|
+
// stylelint-disable-next-line primer/spacing
|
|
347
|
+
padding: 7px $spacer-3;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Has Filter (modifier)
|
|
352
|
+
//
|
|
353
|
+
// Makes sure that the filter input keeps a fixed position at the top while typing. Only visible for xs.
|
|
354
|
+
|
|
355
|
+
.SelectMenu--hasFilter {
|
|
356
|
+
.SelectMenu-modal {
|
|
357
|
+
height: 80%;
|
|
358
|
+
max-height: none;
|
|
359
|
+
margin-top: 0;
|
|
360
|
+
|
|
361
|
+
@include breakpoint(sm) {
|
|
362
|
+
height: auto;
|
|
363
|
+
max-height: $SelectMenu-max-height;
|
|
364
|
+
margin-top: $spacer-2;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// States
|
|
370
|
+
//
|
|
371
|
+
// Different states
|
|
372
|
+
|
|
373
|
+
// Reset outlines
|
|
374
|
+
.SelectMenu-closeButton:focus,
|
|
375
|
+
.SelectMenu-tab:focus,
|
|
376
|
+
.SelectMenu-item:focus {
|
|
377
|
+
outline: 0;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Reset <a> elements
|
|
381
|
+
.SelectMenu-item:hover {
|
|
382
|
+
text-decoration: none;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// Selected
|
|
386
|
+
//
|
|
387
|
+
// Visible when a user clicks/taps on a list item
|
|
388
|
+
|
|
389
|
+
.SelectMenu-item[aria-checked=true] {
|
|
390
|
+
font-weight: $font-weight-semibold;
|
|
391
|
+
color: var(--color-fg-default);
|
|
392
|
+
|
|
393
|
+
.SelectMenu-icon--check {
|
|
394
|
+
visibility: visible;
|
|
395
|
+
transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), visibility 0s linear;
|
|
396
|
+
transform: scale(1);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Disabled
|
|
401
|
+
//
|
|
402
|
+
// Prevent list items to be selected
|
|
403
|
+
|
|
404
|
+
.SelectMenu-item:disabled,
|
|
405
|
+
.SelectMenu-item[aria-disabled=true] {
|
|
406
|
+
color: var(--color-primer-fg-disabled);
|
|
407
|
+
pointer-events: none;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Can hover states
|
|
411
|
+
//
|
|
412
|
+
// For mouse/keyboard input
|
|
413
|
+
|
|
414
|
+
@media (hover: hover) {
|
|
415
|
+
body:not(.intent-mouse) .SelectMenu-closeButton:focus,
|
|
416
|
+
.SelectMenu-closeButton:hover {
|
|
417
|
+
color: var(--color-fg-default);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.SelectMenu-closeButton:active {
|
|
421
|
+
color: var(--color-fg-muted);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
body:not(.intent-mouse) .SelectMenu-item:focus,
|
|
425
|
+
.SelectMenu-item:hover {
|
|
426
|
+
background-color: var(--color-neutral-subtle);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.SelectMenu-item:active {
|
|
430
|
+
background-color: var(--color-canvas-subtle);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
body:not(.intent-mouse) .SelectMenu-tab:focus {
|
|
434
|
+
background-color: var(--color-select-menu-tap-focus-bg);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.SelectMenu-tab:hover {
|
|
438
|
+
color: var(--color-fg-default);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.SelectMenu-tab:not([aria-selected='true']):active {
|
|
442
|
+
color: var(--color-fg-default);
|
|
443
|
+
background-color: var(--color-canvas-subtle);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Can not hover states
|
|
448
|
+
//
|
|
449
|
+
// For touch input
|
|
450
|
+
|
|
451
|
+
@media (hover: none) {
|
|
452
|
+
// Android
|
|
453
|
+
.SelectMenu-item:focus,
|
|
454
|
+
.SelectMenu-item:active {
|
|
455
|
+
background-color: var(--color-canvas-subtle);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// iOS Safari
|
|
459
|
+
// :active would work if ontouchstart is added to the button
|
|
460
|
+
// Instead this tweaks the "native" highlight color
|
|
461
|
+
.SelectMenu-item {
|
|
462
|
+
-webkit-tap-highlight-color: var(--color-select-menu-tap-highlight);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@primer/stylelint-config'],
|
|
3
|
+
plugins: ['stylelint-scss'],
|
|
4
|
+
customSyntax: require('postcss-scss'),
|
|
5
|
+
ignoreFiles: ['src/fonts/**/*'],
|
|
6
|
+
rules: {
|
|
7
|
+
'scss/dollar-variable-default': [true, {ignore: 'local'}],
|
|
8
|
+
'primer/no-override': false,
|
|
9
|
+
'primer/colors': true,
|
|
10
|
+
'primer/borders': true,
|
|
11
|
+
'primer/spacing': true,
|
|
12
|
+
'primer/typography': true,
|
|
13
|
+
'primer/box-shadow': true,
|
|
14
|
+
'primer/no-undefined-vars': [true, {files: 'node_modules/@primer/primitives/dist/scss/colors*/*.scss'}]
|
|
15
|
+
}
|
|
16
|
+
}
|
package/subhead/README.md
CHANGED
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This repository is a module of the full [primer][primer] repository.
|
|
1
|
+
---
|
|
2
|
+
bundle: "subhead"
|
|
3
|
+
generated: true
|
|
4
|
+
---
|
|
6
5
|
|
|
6
|
+
# Primer CSS: `subhead` bundle
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
|
|
11
11
|
|
|
12
12
|
```scss
|
|
13
|
-
@import "primer
|
|
13
|
+
@import "@primer/css/subhead/index.scss";
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
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._
|
|
17
|
-
|
|
18
16
|
## Build
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
$ npm run build
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Documentation
|
|
27
|
-
|
|
28
|
-
Find further documentation at [primer.style/css/components/subhead](https://primer.style/css/components/subhead).
|
|
29
|
-
|
|
18
|
+
The `@primer/css` npm package includes a standalone CSS build of this module in `dist/subhead.css`.
|
|
30
19
|
|
|
31
20
|
## License
|
|
32
21
|
|
|
33
|
-
[MIT](
|
|
22
|
+
[MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
|
|
23
|
+
|
|
34
24
|
|
|
35
|
-
[
|
|
36
|
-
[docs]: https://primer.style/css
|
|
37
|
-
[npm]: https://www.npmjs.com/
|
|
38
|
-
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
|
39
|
-
[sass]: http://sass-lang.com/
|
|
25
|
+
[scss]: https://sass-lang.com/documentation/syntax#scss
|
package/subhead/index.scss
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// support files
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
2
|
+
@import '../support/index.scss';
|
|
3
|
+
@import './subhead.scss';
|
package/subhead/subhead.scss
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
padding-bottom: $spacer-2;
|
|
5
5
|
margin-bottom: $spacer-3;
|
|
6
|
-
border-bottom: $border;
|
|
6
|
+
border-bottom: $border-width $border-style var(--color-border-muted);
|
|
7
7
|
flex-flow: row wrap;
|
|
8
|
+
justify-content: flex-end; // Keep actions right aligned.
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
// Modifier class to give a lot of breathing room between sections of content.
|
|
@@ -15,25 +16,30 @@
|
|
|
15
16
|
// <h2> sized heading with normal font weight
|
|
16
17
|
.Subhead-heading {
|
|
17
18
|
font-size: $h2-size;
|
|
18
|
-
font-weight: normal;
|
|
19
|
+
font-weight: $font-weight-normal;
|
|
19
20
|
flex: 1 1 auto;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
// Make the text bold and red for dangerous content
|
|
23
24
|
.Subhead-heading--danger {
|
|
24
25
|
font-weight: $font-weight-bold;
|
|
25
|
-
color:
|
|
26
|
+
color: var(--color-danger-fg);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
// One-liner of supporting text
|
|
29
30
|
.Subhead-description {
|
|
30
31
|
font-size: $body-font-size;
|
|
31
|
-
color:
|
|
32
|
+
color: var(--color-fg-muted);
|
|
32
33
|
flex: 1 100%;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// Add 1 or 2 buttons to the right of the heading
|
|
36
37
|
.Subhead-actions {
|
|
38
|
+
margin: $spacer-1 0 $spacer-1 $spacer-1;
|
|
37
39
|
align-self: center;
|
|
38
40
|
justify-content: flex-end;
|
|
41
|
+
|
|
42
|
+
+ .Subhead-description {
|
|
43
|
+
margin-top: $spacer-1;
|
|
44
|
+
}
|
|
39
45
|
}
|
package/support/README.md
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
bundle: "support"
|
|
3
|
+
generated: true
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
>
|
|
5
|
-
> Most of the time to include these you'll only need to add `@import "support/support";` to the top of your bundle. If you want only a specific partial you can import them separately.
|
|
6
|
-
|
|
7
|
-
This repository is a module of the full [primer][primer] repository.
|
|
6
|
+
# Primer CSS: `support` bundle
|
|
8
7
|
|
|
9
8
|
## Usage
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
|
|
12
11
|
|
|
13
12
|
```scss
|
|
14
|
-
@import "primer
|
|
13
|
+
@import "@primer/css/support/index.scss";
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Documentation
|
|
16
|
+
## Build
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
The `@primer/css` npm package includes a standalone CSS build of this module in `dist/support.css`.
|
|
22
19
|
|
|
23
20
|
## License
|
|
24
21
|
|
|
25
|
-
[MIT](
|
|
22
|
+
[MIT](https://github.com/primer/css/blob/main/LICENSE) © [GitHub](https://github.com/)
|
|
23
|
+
|
|
26
24
|
|
|
27
|
-
[
|
|
28
|
-
[docs]: https://primer.style/css/support
|
|
29
|
-
[npm]: https://www.npmjs.com/
|
|
30
|
-
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
|
|
31
|
-
[sass]: http://sass-lang.com/
|
|
25
|
+
[scss]: https://sass-lang.com/documentation/syntax#scss
|
package/support/index.scss
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// variables
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
5
|
-
@import "./variables/misc.scss";
|
|
2
|
+
@import './variables/typography.scss';
|
|
3
|
+
@import './variables/layout.scss';
|
|
4
|
+
@import './variables/misc.scss';
|
|
6
5
|
|
|
7
6
|
// mixins
|
|
8
|
-
@import
|
|
9
|
-
@import
|
|
10
|
-
@import
|
|
11
|
-
@import
|
|
7
|
+
@import './mixins/color-modes.scss';
|
|
8
|
+
@import './mixins/typography.scss';
|
|
9
|
+
@import './mixins/layout.scss';
|
|
10
|
+
@import './mixins/misc.scss';
|