@papillonbits/css 1.4.0 → 1.5.0
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/LICENSE +1 -1
- package/build/primer/autocomplete/README.md +20 -0
- package/build/primer/autocomplete/index.scss +3 -0
- package/build/primer/autocomplete/suggester.scss +101 -0
- package/build/primer/avatars/README.md +20 -0
- package/build/primer/avatars/avatar-parent-child.scss +17 -0
- package/build/primer/avatars/circle-badge.scss +55 -0
- package/build/primer/avatars/index.scss +5 -0
- package/build/primer/base/README.md +20 -0
- package/build/primer/base/base.scss +2 -5
- package/build/primer/base/kbd.scss +2 -6
- package/build/primer/base/typography-base.scss +0 -3
- package/build/primer/box/README.md +20 -0
- package/build/primer/box/box-overlay.scss +45 -0
- package/build/primer/box/index.scss +2 -0
- package/build/primer/branch-name/README.md +20 -0
- package/build/primer/branch-name/branch-name.scss +33 -0
- package/build/primer/branch-name/index.scss +3 -0
- package/build/primer/buttons/README.md +20 -0
- package/build/primer/buttons/button-group.scss +104 -0
- package/build/primer/buttons/button.scss +347 -0
- package/build/primer/buttons/index.scss +4 -0
- package/build/primer/buttons/misc.scss +244 -0
- package/build/primer/color-modes/themes/dark.scss +1 -1
- package/build/primer/color-modes/themes/dark_colorblind.scss +1 -1
- package/build/primer/color-modes/themes/dark_dimmed.scss +1 -1
- package/build/primer/color-modes/themes/dark_high_contrast.scss +1 -1
- package/build/primer/color-modes/themes/dark_tritanopia.scss +1 -1
- package/build/primer/color-modes/themes/light.scss +1 -1
- package/build/primer/color-modes/themes/light_colorblind.scss +1 -1
- package/build/primer/color-modes/themes/light_high_contrast.scss +1 -1
- package/build/primer/color-modes/themes/light_tritanopia.scss +1 -1
- package/build/primer/core/README.md +20 -0
- package/build/primer/core/index.scss +18 -0
- package/build/primer/docs.scss +7 -0
- package/build/primer/forms/README.md +20 -0
- package/build/primer/forms/form-control.scss +286 -0
- package/build/primer/forms/form-group.scss +297 -0
- package/build/primer/forms/form-select.scss +47 -0
- package/build/primer/forms/index.scss +6 -0
- package/build/primer/forms/input-group.scss +81 -0
- package/build/primer/forms/radio-group.scss +68 -0
- package/build/primer/header/README.md +20 -0
- package/build/primer/header/header.scss +51 -0
- package/build/primer/header/index.scss +2 -0
- package/build/primer/index.scss +8 -3
- package/build/primer/labels/README.md +20 -0
- package/build/primer/labels/index.scss +3 -0
- package/build/primer/labels/issue-labels.scss +26 -0
- package/build/primer/labels/mixins.scss +44 -0
- package/build/primer/layout/README.md +20 -0
- package/build/primer/layout/app-frame.scss +156 -0
- package/build/primer/layout/container.scss +30 -0
- package/build/primer/layout/grid-offset.scss +19 -0
- package/build/primer/layout/grid.scss +77 -0
- package/build/primer/layout/index.scss +7 -0
- package/build/primer/layout/page-layout.scss +417 -0
- package/build/primer/layout/stack.scss +220 -0
- package/build/primer/loaders/README.md +20 -0
- package/build/primer/loaders/index.scss +2 -0
- package/build/primer/loaders/loaders.scss +19 -0
- package/build/primer/markdown/README.md +20 -0
- package/build/primer/markdown/blob-csv.scss +32 -0
- package/build/primer/markdown/code.scss +79 -0
- package/build/primer/markdown/footnotes.scss +59 -0
- package/build/primer/markdown/headings.scss +101 -0
- package/build/primer/markdown/images.scss +130 -0
- package/build/primer/markdown/index.scss +9 -0
- package/build/primer/markdown/lists.scss +101 -0
- package/build/primer/markdown/markdown-body.scss +101 -0
- package/build/primer/markdown/tables.scss +46 -0
- package/build/primer/marketing/README.md +20 -0
- package/build/primer/marketing/buttons/button.scss +171 -0
- package/build/primer/marketing/buttons/index.scss +3 -0
- package/build/primer/marketing/index.scss +8 -0
- package/build/primer/marketing/links/index.scss +3 -0
- package/build/primer/marketing/links/link.scss +51 -0
- package/build/primer/marketing/support/index.scss +2 -0
- package/build/primer/marketing/support/variables.scss +140 -0
- package/build/primer/marketing/type/index.scss +3 -0
- package/build/primer/marketing/type/typography.scss +140 -0
- package/build/primer/marketing/utilities/animations.scss +52 -0
- package/build/primer/marketing/utilities/borders.scss +4 -0
- package/build/primer/marketing/utilities/filters.scss +3 -0
- package/build/primer/marketing/utilities/index.scss +6 -0
- package/build/primer/marketing/utilities/layout.scss +58 -0
- package/build/primer/navigation/README.md +20 -0
- package/build/primer/navigation/filter-list.scss +86 -0
- package/build/primer/navigation/index.scss +5 -0
- package/build/primer/navigation/sidenav.scss +102 -0
- package/build/primer/navigation/subnav.scss +154 -0
- package/build/primer/pagination/README.md +20 -0
- package/build/primer/pagination/index.scss +3 -0
- package/build/primer/pagination/pagination.scss +157 -0
- package/build/primer/primitives/index.scss +8 -19
- package/build/primer/primitives/temp-typography-tokens.scss +22 -0
- package/build/primer/product/README.md +20 -0
- package/build/primer/product/index.scss +13 -0
- package/build/primer/select-menu/README.md +20 -0
- package/build/primer/select-menu/index.scss +3 -0
- package/build/primer/select-menu/select-menu.scss +486 -0
- package/build/primer/support/README.md +20 -0
- package/build/primer/support/mixins/layout.scss +1 -1
- package/build/primer/support/mixins/misc.scss +2 -0
- package/build/primer/support/mixins/typography.scss +0 -2
- package/build/primer/support/variables/typography.scss +1 -1
- package/build/primer/table-object/index.scss +1 -0
- package/build/primer/table-object/table-object.scss +23 -0
- package/build/primer/toasts/README.md +20 -0
- package/build/primer/toasts/index.scss +2 -0
- package/build/primer/toasts/toasts.scss +129 -0
- package/build/primer/tooltips/README.md +20 -0
- package/build/primer/tooltips/index.scss +2 -0
- package/build/primer/tooltips/tooltips.scss +228 -0
- package/build/primer/utilities/README.md +20 -0
- package/build/primer/utilities/borders.scss +12 -3
- package/build/primer/utilities/box-shadow.scss +0 -2
- package/build/primer/utilities/colors.scss +0 -1
- package/build/primer/utilities/details.scss +1 -1
- package/build/primer/utilities/flexbox.scss +2 -1
- package/build/primer/utilities/layout.scss +2 -2
- package/build/primer/utilities/margin.scss +2 -3
- package/build/primer/utilities/padding.scss +2 -3
- package/build/primer/utilities/typography.scss +4 -3
- package/build/primer/utilities/visibility-display.scss +2 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
bundle: "forms"
|
|
3
|
+
generated: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Primer CSS: `forms` bundle
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Primer CSS source files are written in [SCSS]. To include this Primer CSS module in your own build, ensure that your `node_modules` directory is listed in your Sass include paths, then import it with:
|
|
11
|
+
|
|
12
|
+
```scss
|
|
13
|
+
@import "@primer/css/forms/index.scss";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Build
|
|
17
|
+
|
|
18
|
+
The `@primer/css` npm package includes a standalone CSS build of this module in `dist/forms.css`.
|
|
19
|
+
|
|
20
|
+
[scss]: https://sass-lang.com/documentation/syntax#scss
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// Needs refactoring
|
|
2
|
+
// stylelint-disable selector-no-qualifying-type, selector-max-compound-selectors
|
|
3
|
+
// stylelint-disable selector-max-type
|
|
4
|
+
// Base form controls
|
|
5
|
+
//
|
|
6
|
+
// Overrides for common inputs for easier styling.
|
|
7
|
+
|
|
8
|
+
.form-control,
|
|
9
|
+
.form-select {
|
|
10
|
+
// stylelint-disable-next-line primer/spacing
|
|
11
|
+
padding: 5px 12px;
|
|
12
|
+
// stylelint-disable-next-line primer/typography
|
|
13
|
+
font-size: $body-font-size;
|
|
14
|
+
// stylelint-disable-next-line primer/typography
|
|
15
|
+
line-height: 20px;
|
|
16
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
background-color: var(--bgColor-default, var(--color-canvas-default));
|
|
19
|
+
background-repeat: no-repeat; // Repeat and position set for form states (success, error, etc)
|
|
20
|
+
background-position: right 8px center; // For form validation. This keeps images 8px from right and centered vertically.
|
|
21
|
+
// stylelint-disable-next-line primer/borders, primer/colors
|
|
22
|
+
border: $border-width $border-style var(--control-borderColor-rest, var(--color-border-default));
|
|
23
|
+
// stylelint-disable-next-line primer/borders
|
|
24
|
+
border-radius: $border-radius;
|
|
25
|
+
box-shadow: var(--shadow-inset, var(--color-primer-shadow-inset));
|
|
26
|
+
transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
|
|
27
|
+
transition-property: color, background-color, box-shadow, border-color;
|
|
28
|
+
|
|
29
|
+
&:focus {
|
|
30
|
+
@include focusBoxShadowInset;
|
|
31
|
+
|
|
32
|
+
// remove fallback :focus if :focus-visible is supported
|
|
33
|
+
&:not(:focus-visible) {
|
|
34
|
+
border-color: transparent;
|
|
35
|
+
|
|
36
|
+
@include focusBoxShadowInset(1px, transparent);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// default focus state
|
|
41
|
+
&:focus-visible {
|
|
42
|
+
@include focusBoxShadowInset;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// override form controls with no border in focused state
|
|
46
|
+
&.border-0 {
|
|
47
|
+
&:focus,
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
// stylelint-disable-next-line primer/borders, primer/colors
|
|
50
|
+
border: $border-width $border-style var(--borderColor-accent-emphasis, var(--color-accent-fg)) !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&[disabled],
|
|
55
|
+
fieldset[disabled] & {
|
|
56
|
+
color: var(--control-fgColor-disabled, var(--color-primer-fg-disabled));
|
|
57
|
+
background-color: var(--control-bgColor-disabled, var(--color-input-disabled-bg));
|
|
58
|
+
border-color: var(--control-borderColor-disabled, var(--color-border-default));
|
|
59
|
+
-webkit-text-fill-color: var(--control-fgColor-disabled, var(--color-primer-fg-disabled)); // Fix for Safari
|
|
60
|
+
opacity: 1; // Fix for Safari iOS
|
|
61
|
+
|
|
62
|
+
&::placeholder {
|
|
63
|
+
color: var(--control-fgColor-disabled, var(--color-primer-fg-disabled));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Ensures inputs don't zoom on mobile iPhone but are body-font size on iPad
|
|
68
|
+
@supports (-webkit-touch-callout: none) {
|
|
69
|
+
// stylelint-disable-next-line primer/typography
|
|
70
|
+
font-size: $h4-size;
|
|
71
|
+
|
|
72
|
+
@include breakpoint(md) {
|
|
73
|
+
// stylelint-disable-next-line primer/typography
|
|
74
|
+
font-size: $body-font-size;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Textarea
|
|
80
|
+
textarea.form-control {
|
|
81
|
+
padding-top: var(--base-size-8);
|
|
82
|
+
padding-bottom: var(--base-size-8);
|
|
83
|
+
// stylelint-disable-next-line primer/typography
|
|
84
|
+
line-height: $lh-default;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Inputs with contrast for easy light gray backgrounds against white.
|
|
88
|
+
.input-contrast {
|
|
89
|
+
background-color: var(--bgColor-muted, var(--color-canvas-inset));
|
|
90
|
+
|
|
91
|
+
&:focus {
|
|
92
|
+
background-color: var(--bgColor-default, var(--color-canvas-default));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Mini inputs, to match .minibutton
|
|
97
|
+
.input-sm {
|
|
98
|
+
min-height: $size-4;
|
|
99
|
+
// stylelint-disable-next-line primer/spacing
|
|
100
|
+
padding-top: 3px;
|
|
101
|
+
// stylelint-disable-next-line primer/spacing
|
|
102
|
+
padding-bottom: 3px;
|
|
103
|
+
// stylelint-disable-next-line primer/typography
|
|
104
|
+
font-size: $font-size-small;
|
|
105
|
+
// stylelint-disable-next-line primer/typography
|
|
106
|
+
line-height: 20px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Large inputs
|
|
110
|
+
.input-lg {
|
|
111
|
+
// stylelint-disable-next-line primer/typography
|
|
112
|
+
font-size: $h4-size;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Full-width inputs
|
|
116
|
+
.input-block {
|
|
117
|
+
display: block;
|
|
118
|
+
width: 100%;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Inputs with monospace text
|
|
122
|
+
.input-monospace {
|
|
123
|
+
// stylelint-disable-next-line primer/typography
|
|
124
|
+
font-family: $mono-font;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Hide the icon that tries to autofill contact info in webkit
|
|
128
|
+
.input-hide-webkit-autofill {
|
|
129
|
+
&::-webkit-contacts-auto-fill-button {
|
|
130
|
+
position: absolute;
|
|
131
|
+
right: 0;
|
|
132
|
+
display: none !important;
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
visibility: hidden;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Checkboxes and Radiobuttons
|
|
139
|
+
//
|
|
140
|
+
// For checkboxes and radio button selections.
|
|
141
|
+
.form-checkbox {
|
|
142
|
+
// stylelint-disable-next-line primer/spacing
|
|
143
|
+
padding-left: 20px;
|
|
144
|
+
// stylelint-disable-next-line primer/spacing
|
|
145
|
+
margin: 15px 0;
|
|
146
|
+
vertical-align: middle;
|
|
147
|
+
|
|
148
|
+
label {
|
|
149
|
+
em.highlight {
|
|
150
|
+
position: relative;
|
|
151
|
+
left: calc(var(--base-size-4) * -1);
|
|
152
|
+
// stylelint-disable-next-line primer/spacing
|
|
153
|
+
padding: 2px var(--base-size-4);
|
|
154
|
+
font-style: normal;
|
|
155
|
+
background: var(--bgColor-attention-muted, var(--color-attention-subtle));
|
|
156
|
+
// stylelint-disable-next-line primer/borders
|
|
157
|
+
border-radius: $border-radius;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
input[type='checkbox'],
|
|
162
|
+
input[type='radio'] {
|
|
163
|
+
float: left;
|
|
164
|
+
// stylelint-disable-next-line primer/spacing
|
|
165
|
+
margin: 5px 0 0 -20px;
|
|
166
|
+
vertical-align: middle;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.note {
|
|
170
|
+
display: block;
|
|
171
|
+
margin: 0;
|
|
172
|
+
// stylelint-disable-next-line primer/typography
|
|
173
|
+
font-size: $font-size-small;
|
|
174
|
+
// stylelint-disable-next-line primer/typography
|
|
175
|
+
font-weight: $font-weight-normal;
|
|
176
|
+
color: var(--fgColor-muted, var(--color-fg-muted));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.form-checkbox-details {
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.form-checkbox-details-trigger {
|
|
185
|
+
&:checked {
|
|
186
|
+
// child of sibling or sibling
|
|
187
|
+
~ * .form-checkbox-details,
|
|
188
|
+
~ .form-checkbox-details {
|
|
189
|
+
display: block;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Field groups
|
|
195
|
+
//
|
|
196
|
+
// Wrap field groups in `<div.hfields>` to lay them out horizontally - great for
|
|
197
|
+
// the top of pages with autosave.
|
|
198
|
+
.hfields {
|
|
199
|
+
// stylelint-disable-next-line primer/spacing
|
|
200
|
+
margin: 15px 0;
|
|
201
|
+
|
|
202
|
+
@include clearfix;
|
|
203
|
+
|
|
204
|
+
.form-group {
|
|
205
|
+
float: left;
|
|
206
|
+
// stylelint-disable-next-line primer/spacing
|
|
207
|
+
margin: 0 30px 0 0;
|
|
208
|
+
|
|
209
|
+
dt, // TODO: Deprecate
|
|
210
|
+
.form-group-header {
|
|
211
|
+
label {
|
|
212
|
+
display: inline-block;
|
|
213
|
+
// stylelint-disable-next-line primer/spacing
|
|
214
|
+
margin: 5px 0 0;
|
|
215
|
+
color: var(--fgColor-muted, var(--color-fg-muted));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
img {
|
|
219
|
+
position: relative;
|
|
220
|
+
// stylelint-disable-next-line primer/spacing
|
|
221
|
+
top: -2px;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.btn {
|
|
227
|
+
float: left;
|
|
228
|
+
// stylelint-disable-next-line primer/spacing
|
|
229
|
+
margin: 28px 25px 0 -20px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.form-select {
|
|
233
|
+
// stylelint-disable-next-line primer/spacing
|
|
234
|
+
margin-top: 5px;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Hide the up/down buttons in <input type="number"> in the login form, the
|
|
239
|
+
// input is used for two-factor auth codes, type="number" makes it more usable
|
|
240
|
+
// on phones
|
|
241
|
+
input::-webkit-outer-spin-button,
|
|
242
|
+
input::-webkit-inner-spin-button {
|
|
243
|
+
margin: 0;
|
|
244
|
+
appearance: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Input groups
|
|
248
|
+
|
|
249
|
+
.form-actions {
|
|
250
|
+
@include clearfix;
|
|
251
|
+
|
|
252
|
+
.btn {
|
|
253
|
+
float: right;
|
|
254
|
+
|
|
255
|
+
+ .btn {
|
|
256
|
+
// stylelint-disable-next-line primer/spacing
|
|
257
|
+
margin-right: 5px;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.form-warning {
|
|
263
|
+
// stylelint-disable-next-line primer/spacing
|
|
264
|
+
padding: var(--base-size-8) 10px;
|
|
265
|
+
// stylelint-disable-next-line primer/spacing
|
|
266
|
+
margin: 10px 0;
|
|
267
|
+
// stylelint-disable-next-line primer/typography
|
|
268
|
+
font-size: $h5-size;
|
|
269
|
+
color: var(--fgColor-attention, var(--color-attention-fg));
|
|
270
|
+
background: var(--bgColor-attention-muted, var(--color-attention-subtle));
|
|
271
|
+
// stylelint-disable-next-line primer/borders, primer/colors
|
|
272
|
+
border: $border-width $border-style var(--borderColor-attention-emphasis, var(--color-attention-emphasis));
|
|
273
|
+
// stylelint-disable-next-line primer/borders
|
|
274
|
+
border-radius: $border-radius;
|
|
275
|
+
|
|
276
|
+
p {
|
|
277
|
+
margin: 0;
|
|
278
|
+
// stylelint-disable-next-line primer/typography
|
|
279
|
+
line-height: $lh-default;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
a {
|
|
283
|
+
// stylelint-disable-next-line primer/typography
|
|
284
|
+
font-weight: $font-weight-bold;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
// stylelint-disable selector-max-compound-selectors
|
|
2
|
+
// stylelint-disable selector-max-type
|
|
3
|
+
|
|
4
|
+
// Form groups
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
//
|
|
8
|
+
// <div class="form-group">
|
|
9
|
+
// <div class="form-group-header"> containing the label
|
|
10
|
+
// <div class="form-group-body"> containing the form elements
|
|
11
|
+
// </div>
|
|
12
|
+
|
|
13
|
+
.form-group {
|
|
14
|
+
// stylelint-disable-next-line primer/spacing
|
|
15
|
+
margin: 15px 0;
|
|
16
|
+
|
|
17
|
+
// Autocomplete with embedded icon
|
|
18
|
+
.form-control.autocomplete-embedded-icon-wrap {
|
|
19
|
+
&:focus-within {
|
|
20
|
+
background-color: var(--bgColor-default, var(--color-canvas-default));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Text fields
|
|
25
|
+
.form-control {
|
|
26
|
+
// stylelint-disable-next-line primer/responsive-widths
|
|
27
|
+
width: 440px;
|
|
28
|
+
max-width: 100%;
|
|
29
|
+
// stylelint-disable-next-line primer/spacing
|
|
30
|
+
margin-right: 5px;
|
|
31
|
+
background-color: var(--bgColor-muted, var(--color-canvas-inset));
|
|
32
|
+
|
|
33
|
+
&:focus {
|
|
34
|
+
background-color: var(--bgColor-default, var(--color-canvas-default));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.shorter {
|
|
38
|
+
width: 130px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.short {
|
|
42
|
+
width: 250px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&.input-block,
|
|
46
|
+
&.long {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Textarea
|
|
52
|
+
// stylelint-disable selector-no-qualifying-type
|
|
53
|
+
textarea.form-control {
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 200px;
|
|
56
|
+
min-height: 200px;
|
|
57
|
+
|
|
58
|
+
&.short {
|
|
59
|
+
height: 50px;
|
|
60
|
+
min-height: 50px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// stylelint-enable selector-no-qualifying-type
|
|
64
|
+
|
|
65
|
+
// The Label
|
|
66
|
+
dt, // TODO: Deprecate
|
|
67
|
+
.form-group-header {
|
|
68
|
+
// stylelint-disable-next-line primer/spacing
|
|
69
|
+
margin: 0 0 6px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
label {
|
|
73
|
+
// fix for chrome bug, see https://github.com/github/github/issues/53931
|
|
74
|
+
position: static;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.flattened dt, // TODO: Deprecate
|
|
78
|
+
&.flattened .form-group-header {
|
|
79
|
+
float: left;
|
|
80
|
+
margin: 0;
|
|
81
|
+
// stylelint-disable-next-line primer/typography
|
|
82
|
+
line-height: 32px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.flattened dd, // TODO: Deprecate
|
|
86
|
+
&.flattened .form-group-body {
|
|
87
|
+
// stylelint-disable-next-line primer/typography
|
|
88
|
+
line-height: 32px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//
|
|
92
|
+
// Form Elements
|
|
93
|
+
//
|
|
94
|
+
// stylelint-disable selector-no-qualifying-type
|
|
95
|
+
dd, // TODO: Deprecate
|
|
96
|
+
.form-group-body {
|
|
97
|
+
h4 {
|
|
98
|
+
margin: var(--base-size-4) 0 0;
|
|
99
|
+
|
|
100
|
+
&.is-error {
|
|
101
|
+
color: var(--fgColor-danger, var(--color-danger-fg));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.is-success {
|
|
105
|
+
color: var(--fgColor-success, var(--color-success-fg));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
+ .note {
|
|
109
|
+
margin-top: 0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// stylelint-enable selector-no-qualifying-type
|
|
114
|
+
|
|
115
|
+
//
|
|
116
|
+
// Variants
|
|
117
|
+
//
|
|
118
|
+
|
|
119
|
+
&.required {
|
|
120
|
+
dt label::after, // TODO: Deprecate
|
|
121
|
+
.form-group-header label::after {
|
|
122
|
+
// stylelint-disable-next-line primer/spacing
|
|
123
|
+
padding-left: 5px;
|
|
124
|
+
color: var(--fgColor-danger, var(--color-danger-fg));
|
|
125
|
+
content: '*';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Form AJAX states
|
|
130
|
+
//
|
|
131
|
+
// Form fields that need feedback for AJAX loading, success
|
|
132
|
+
// states and errored states.
|
|
133
|
+
.success,
|
|
134
|
+
.error,
|
|
135
|
+
.indicator {
|
|
136
|
+
display: none;
|
|
137
|
+
// stylelint-disable-next-line primer/typography
|
|
138
|
+
font-size: $font-size-small;
|
|
139
|
+
// stylelint-disable-next-line primer/typography
|
|
140
|
+
font-weight: $font-weight-bold;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.loading {
|
|
144
|
+
opacity: 0.5;
|
|
145
|
+
|
|
146
|
+
.indicator {
|
|
147
|
+
display: inline;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.spinner {
|
|
151
|
+
display: inline-block;
|
|
152
|
+
vertical-align: middle;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.successful {
|
|
157
|
+
.success {
|
|
158
|
+
display: inline;
|
|
159
|
+
color: var(--fgColor-success, var(--color-success-fg));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Form validation
|
|
164
|
+
//
|
|
165
|
+
// Our inline errors
|
|
166
|
+
|
|
167
|
+
&.successed,
|
|
168
|
+
&.warn,
|
|
169
|
+
&.errored {
|
|
170
|
+
.success,
|
|
171
|
+
.warning,
|
|
172
|
+
.error {
|
|
173
|
+
position: absolute;
|
|
174
|
+
z-index: 10;
|
|
175
|
+
display: block; // Show up in errored/warn state
|
|
176
|
+
max-width: 450px; // Keep our long errors readable
|
|
177
|
+
padding: var(--base-size-4) var(--base-size-8);
|
|
178
|
+
margin: var(--base-size-8) 0 0;
|
|
179
|
+
// stylelint-disable-next-line primer/typography
|
|
180
|
+
font-size: $font-size-small;
|
|
181
|
+
// stylelint-disable-next-line primer/typography
|
|
182
|
+
font-weight: $font-weight-normal;
|
|
183
|
+
// stylelint-disable-next-line primer/borders
|
|
184
|
+
border-style: $border-style;
|
|
185
|
+
// stylelint-disable-next-line primer/borders
|
|
186
|
+
border-width: $border-width;
|
|
187
|
+
// stylelint-disable-next-line primer/borders
|
|
188
|
+
border-radius: $border-radius;
|
|
189
|
+
|
|
190
|
+
&::after,
|
|
191
|
+
&::before {
|
|
192
|
+
position: absolute;
|
|
193
|
+
bottom: 100%;
|
|
194
|
+
// stylelint-disable-next-line primer/spacing
|
|
195
|
+
left: 10px;
|
|
196
|
+
z-index: 15;
|
|
197
|
+
width: 0;
|
|
198
|
+
height: 0;
|
|
199
|
+
pointer-events: none;
|
|
200
|
+
content: ' ';
|
|
201
|
+
// stylelint-disable-next-line primer/borders, primer/colors
|
|
202
|
+
border: $border-style transparent;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&::after {
|
|
206
|
+
// stylelint-disable-next-line primer/borders
|
|
207
|
+
border-width: 5px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&::before {
|
|
211
|
+
// stylelint-disable-next-line primer/spacing
|
|
212
|
+
margin-left: -1px;
|
|
213
|
+
// stylelint-disable-next-line primer/borders
|
|
214
|
+
border-width: 6px;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&.successed {
|
|
220
|
+
.success {
|
|
221
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
222
|
+
background-color: var(--bgColor-default, var(--color-canvas-default)); // Makes sure the background is opaque to cover any content underneath
|
|
223
|
+
background-image: linear-gradient(var(--bgColor-success-muted, var(--bgColor-success-muted, var(--color-success-subtle))), var(--color-success-subtle));
|
|
224
|
+
border-color: var(--borderColor-success-muted, var(--color-success-muted));
|
|
225
|
+
|
|
226
|
+
&::after {
|
|
227
|
+
border-bottom-color: var(--borderColor-success-muted, var(--color-success-muted));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&::before {
|
|
231
|
+
border-bottom-color: var(--borderColor-success-muted, var(--color-success-muted));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&.warn {
|
|
237
|
+
.form-control:not(:focus, :focus-visible) {
|
|
238
|
+
border-color: var(--borderColor-attention-emphasis, var(--color-attention-emphasis));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.warning {
|
|
242
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
243
|
+
background-color: var(--bgColor-default, var(--color-canvas-default)); // Makes sure the background is opaque to cover any content underneath
|
|
244
|
+
background-image: linear-gradient(var(--bgColor-attention-muted, var(--bgColor-attention-muted, var(--color-attention-subtle))), var(--color-attention-subtle));
|
|
245
|
+
border-color: var(--borderColor-attention-muted, var(--color-attention-muted));
|
|
246
|
+
|
|
247
|
+
&::after {
|
|
248
|
+
border-bottom-color: var(--borderColor-attention-muted, var(--color-attention-muted));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&::before {
|
|
252
|
+
border-bottom-color: var(--borderColor-attention-muted, var(--color-attention-muted));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&.errored {
|
|
258
|
+
.form-control:not(:focus, :focus-visible) {
|
|
259
|
+
border-color: var(--borderColor-danger-emphasis, var(--color-danger-emphasis));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
label {
|
|
263
|
+
color: var(--fgColor-danger, var(--color-danger-fg));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.error {
|
|
267
|
+
color: var(--fgColor-default, var(--color-fg-default));
|
|
268
|
+
background-color: var(--bgColor-default, var(--color-canvas-default)); // Makes sure the background is opaque to cover any content underneath
|
|
269
|
+
background-image: linear-gradient(var(--bgColor-danger-muted, var(--bgColor-danger-muted, var(--color-danger-subtle))), var(--color-danger-subtle));
|
|
270
|
+
border-color: var(--borderColor-danger-muted, var(--color-danger-muted));
|
|
271
|
+
|
|
272
|
+
&::after {
|
|
273
|
+
border-bottom-color: var(--borderColor-danger-muted, var(--color-danger-muted));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
&::before {
|
|
277
|
+
border-bottom-color: var(--borderColor-danger-muted, var(--color-danger-muted));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// tooltip
|
|
284
|
+
.note {
|
|
285
|
+
min-height: 17px;
|
|
286
|
+
// stylelint-disable-next-line primer/spacing
|
|
287
|
+
margin: var(--base-size-4) 0 2px;
|
|
288
|
+
// stylelint-disable-next-line primer/typography
|
|
289
|
+
font-size: $font-size-small;
|
|
290
|
+
color: var(--fgColor-muted, var(--color-fg-muted));
|
|
291
|
+
|
|
292
|
+
.spinner {
|
|
293
|
+
// stylelint-disable-next-line primer/spacing
|
|
294
|
+
margin-right: 3px;
|
|
295
|
+
vertical-align: middle;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Custom select
|
|
2
|
+
//
|
|
3
|
+
// Apply `.select` to any `<select>` element for custom styles.
|
|
4
|
+
.form-select {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
height: $size-5;
|
|
8
|
+
padding-right: var(--base-size-24);
|
|
9
|
+
background-color: var(--bgColor-default, var(--color-canvas-default));
|
|
10
|
+
// SVG with fill: #586069 (--color-icon-secondary)
|
|
11
|
+
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzU4NjA2OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=');
|
|
12
|
+
background-repeat: no-repeat;
|
|
13
|
+
background-position: right 4px center;
|
|
14
|
+
background-size: 16px;
|
|
15
|
+
appearance: none;
|
|
16
|
+
|
|
17
|
+
// Hides the default caret in IE11
|
|
18
|
+
&::-ms-expand {
|
|
19
|
+
opacity: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&[multiple] {
|
|
23
|
+
height: auto;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include color-mode(dark) {
|
|
28
|
+
.form-select {
|
|
29
|
+
// SVG with fill: #6e7681 (--color-icon-secondary)
|
|
30
|
+
background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzZlNzY4MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.select-sm {
|
|
35
|
+
height: $size-4;
|
|
36
|
+
// stylelint-disable-next-line primer/spacing
|
|
37
|
+
padding-top: 3px;
|
|
38
|
+
// stylelint-disable-next-line primer/spacing
|
|
39
|
+
padding-bottom: 3px;
|
|
40
|
+
// stylelint-disable-next-line primer/typography
|
|
41
|
+
font-size: $font-size-small;
|
|
42
|
+
|
|
43
|
+
&[multiple] {
|
|
44
|
+
height: auto;
|
|
45
|
+
min-height: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|