@wwtdev/bsds-css 1.2.0 → 1.4.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/dist/components/_accordions.scss +3 -3
- package/dist/components/_dropdown.scss +193 -0
- package/dist/components/_form-booleans.scss +4 -1
- package/dist/components/_form-elements.scss +5 -94
- package/dist/components/_form-hints.scss +3 -0
- package/dist/components/_form-input-composite.scss +206 -0
- package/dist/components/_form-text-fields.scss +103 -0
- package/dist/components/accordions.css +3 -3
- package/dist/components/dropdown.css +189 -0
- package/dist/components/form-booleans.css +4 -1
- package/dist/components/form-elements.css +4 -93
- package/dist/components/form-hints.css +3 -0
- package/dist/components/form-input-composite.css +202 -0
- package/dist/components/form-text-fields.css +99 -0
- package/dist/wwt-bsds.css +392 -35
- package/dist/wwt-bsds.min.css +1 -1
- package/package.json +1 -5
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
transform: rotate(180deg);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.bs-accordion :where(header button) > :where(
|
|
69
|
+
.bs-accordion :where(header button) > :where(span) {
|
|
70
70
|
grid-area: main;
|
|
71
71
|
margin-right: var(--bs-space-2);
|
|
72
72
|
text-align: left;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
.bs-accordion :where(header button) > :where(
|
|
75
|
+
.bs-accordion :where(header button) > :where(span) {
|
|
76
76
|
vertical-align: middle;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
@media (min-width: 957px) {
|
|
80
|
-
.bs-accordion :where(header button) > :where(
|
|
80
|
+
.bs-accordion :where(header button) > :where(span) {
|
|
81
81
|
margin-right: var(--bs-space-3);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
@mixin dropdown() {
|
|
2
|
+
/* Positioning the parent */
|
|
3
|
+
.bs-dropdown {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* Option list */
|
|
9
|
+
.bs-dropdown :where(ul) {
|
|
10
|
+
background-color: var(--bs-white);
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
bottom: auto;
|
|
13
|
+
box-shadow: var(--bs-shadow-contentMedium);
|
|
14
|
+
line-height: 1.5rem;
|
|
15
|
+
list-style: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
max-height: 0;
|
|
18
|
+
max-width: 16.875rem;
|
|
19
|
+
opacity: 0;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
padding: 0;
|
|
22
|
+
position: absolute;
|
|
23
|
+
top: calc(100% + 0.5rem);
|
|
24
|
+
transition-duration: 75ms;
|
|
25
|
+
transition-property: opacity, max-height;
|
|
26
|
+
transition-timing-function: ease-in-out;
|
|
27
|
+
z-index: 999;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* (not) data-variant="fit" */
|
|
31
|
+
.bs-dropdown:not([data-variant="fit"]) :where(ul) {
|
|
32
|
+
width: 16.875rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* data-shown */
|
|
36
|
+
.bs-dropdown:where([data-shown]) :where(ul) {
|
|
37
|
+
max-height: 20rem;
|
|
38
|
+
opacity: 1;
|
|
39
|
+
padding-top: 0.75rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* data-position="top" */
|
|
43
|
+
.bs-dropdown:where([data-position="top"]) :where(ul) {
|
|
44
|
+
bottom: calc(100% + 0.5rem);
|
|
45
|
+
top: auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* data-justify="center" */
|
|
49
|
+
.bs-dropdown:where([data-justify="center"]) :where(ul) {
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translateX(-50%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Option list item */
|
|
55
|
+
.bs-dropdown :where(ul li) {
|
|
56
|
+
align-items: center;
|
|
57
|
+
border-bottom: 2px solid transparent;
|
|
58
|
+
border-left: 4px solid transparent;
|
|
59
|
+
border-radius: 3px;
|
|
60
|
+
border-right: 2px solid transparent;
|
|
61
|
+
border-top: 2px solid transparent;
|
|
62
|
+
color: var(--bs-ink-base);
|
|
63
|
+
column-gap: 0.5rem;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
display: grid;
|
|
66
|
+
margin-bottom: 0.5rem;
|
|
67
|
+
padding-bottom: 0.25rem;
|
|
68
|
+
padding-left: 0.5rem;
|
|
69
|
+
padding-right: 0.75rem;
|
|
70
|
+
padding-top: 0.25rem;
|
|
71
|
+
row-gap: 0.125rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* data-variant="search" (search input) */
|
|
75
|
+
.bs-dropdown :where(ul li[data-variant~="search"]) {
|
|
76
|
+
border-left: none;
|
|
77
|
+
cursor: default;
|
|
78
|
+
display: block;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* data-variant="break" (list item) */
|
|
82
|
+
.bs-dropdown :where(ul li[data-variant~="break"]) {
|
|
83
|
+
border-left: none;
|
|
84
|
+
cursor: default;
|
|
85
|
+
display: block;
|
|
86
|
+
padding: 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* data-variant="break" (actual line break) */
|
|
90
|
+
.bs-dropdown :where(ul li[data-variant~="break"] hr) {
|
|
91
|
+
background: var(--bs-navy-200);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* data-variant="2-col" */
|
|
95
|
+
.bs-dropdown :where(ul li[data-variant~="2-col"]) {
|
|
96
|
+
grid-template-columns: min-content 1fr;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* data-variant="description" */
|
|
100
|
+
/* Description will be the 2nd child in a 1-column item */
|
|
101
|
+
.bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"] :nth-child(2)) {
|
|
102
|
+
color: var(--bs-ink-light);
|
|
103
|
+
font-size: var(--bs-text-xs);
|
|
104
|
+
height: 1.125rem;
|
|
105
|
+
line-height: 1.125rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* data-variant="2-col description" */
|
|
109
|
+
/* Description will be the 3rd child in a 2-column item */
|
|
110
|
+
.bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"] :nth-child(3)) {
|
|
111
|
+
color: var(--bs-ink-light);
|
|
112
|
+
font-size: var(--bs-text-xs);
|
|
113
|
+
grid-column-start: 2;
|
|
114
|
+
height: 1.125rem;
|
|
115
|
+
line-height: 1.125rem;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* List item hover or data-selected */
|
|
119
|
+
.bs-dropdown :where(ul li:hover),
|
|
120
|
+
.bs-dropdown :where(ul li[data-selected]) {
|
|
121
|
+
background-color: var(--bs-bg-subtle);
|
|
122
|
+
border-left: 4px solid var(--bs-blue-400);
|
|
123
|
+
color: var(--bs-blue-400);
|
|
124
|
+
outline: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* data-variant="search" or data-variant="break" hover */
|
|
128
|
+
.bs-dropdown :where(ul li[data-variant~="search"]:hover),
|
|
129
|
+
.bs-dropdown :where(ul li[data-variant~="break"]:hover) {
|
|
130
|
+
background-color: transparent;
|
|
131
|
+
border-left: none;
|
|
132
|
+
color: var(--bs-ink-base);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* data-variant="negative" hover, data-selected, and both */
|
|
136
|
+
.bs-dropdown :where(ul li[data-variant~="negative"]:hover),
|
|
137
|
+
.bs-dropdown :where(ul li[data-variant~="negative"][data-selected]),
|
|
138
|
+
.bs-dropdown :where(ul li[data-variant~="negative"][data-selected]:hover) {
|
|
139
|
+
/* 25% alpha version of --bs-red-400 */
|
|
140
|
+
background-color: rgba(248, 169, 170, 0.25);
|
|
141
|
+
border-left: 4px solid var(--bs-red-500);
|
|
142
|
+
color: var(--bs-red-500);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* data-variant="description" or data-variant="2-col description" hover or data-selected */
|
|
146
|
+
.bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
|
|
147
|
+
.bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
|
|
148
|
+
.bs-dropdown :where(ul li:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
|
|
149
|
+
.bs-dropdown :where(ul li[data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
|
|
150
|
+
color: var(--bs-blue-400);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* data-variant="negative description" or data-variant="2-col negative description" hover or data-selected */
|
|
154
|
+
.bs-dropdown :where(ul li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"]:hover :nth-child(2)),
|
|
155
|
+
.bs-dropdown :where(ul li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"]:hover :nth-child(3)),
|
|
156
|
+
.bs-dropdown :where(ul li[data-variant~="negative"]:not([data-variant~="2-col"])[data-variant~="description"][data-selected] :nth-child(2)),
|
|
157
|
+
.bs-dropdown :where(ul li[data-variant~="negative"][data-variant~="2-col"][data-variant~="description"][data-selected] :nth-child(3)) {
|
|
158
|
+
color: var(--bs-red-500);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* List option mouse click focus (do not show) */
|
|
162
|
+
.bs-dropdown :where(ul li:focus:not(:focus-visible)){
|
|
163
|
+
outline: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* data-variant="negative" list option mouse click focus (do not show) */
|
|
167
|
+
li[data-variant~="negative"]:focus:not(:focus-visible) {
|
|
168
|
+
outline: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* List option keyboard navigation focus */
|
|
172
|
+
.bs-dropdown :where(ul li:focus-visible) {
|
|
173
|
+
--focus-border-color: var(--bs-blue-400);
|
|
174
|
+
border: 2px solid var(--focus-border-color);
|
|
175
|
+
outline: none;
|
|
176
|
+
padding-left: 0.625rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Navigation focus on a selected element should preserve 4px left border */
|
|
180
|
+
.bs-dropdown :where(ul li[data-selected]:focus-visible) {
|
|
181
|
+
border-left: 4px solid var(--focus-border-color);
|
|
182
|
+
padding-left: 0.5rem;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* data-variant="negative" list option keyboard navigation focus */
|
|
186
|
+
.bs-dropdown :where(ul li[data-variant~="negative"]:focus-visible) {
|
|
187
|
+
--focus-border-color: var(--bs-red-200);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
appearance: none;
|
|
44
44
|
background-color: var(--bg-base);
|
|
45
45
|
box-shadow: inset 0 0 0 0.125rem var(--box-shadow);
|
|
46
|
+
cursor: pointer;
|
|
46
47
|
display: grid;
|
|
47
48
|
height: 1rem;
|
|
48
49
|
margin: 0;
|
|
@@ -161,6 +162,7 @@ input:where([type='checkbox']:checked, [type='checkbox']:indeterminate, [type='r
|
|
|
161
162
|
input:where([type='checkbox'], [type='radio']):disabled {
|
|
162
163
|
--box-shadow: var(--bs-gray-400);
|
|
163
164
|
background-color: transparent;
|
|
165
|
+
cursor: default;
|
|
164
166
|
}
|
|
165
167
|
|
|
166
168
|
input:where([type='checkbox']):checked:disabled::before,
|
|
@@ -176,7 +178,8 @@ input:where([type='radio']):checked:disabled::before {
|
|
|
176
178
|
/* Error state */
|
|
177
179
|
|
|
178
180
|
input:where([type='checkbox'], [type='radio'])[data-error] {
|
|
179
|
-
--box-shadow: var(--bs-red-
|
|
181
|
+
--box-shadow: var(--bs-red-500);
|
|
182
|
+
--outline-color: var(--bs-red-200);
|
|
180
183
|
}
|
|
181
184
|
|
|
182
185
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@mixin form-elements() {
|
|
2
|
-
|
|
2
|
+
/* Generally applicable (all input types) */
|
|
3
|
+
:where([data-required]) {
|
|
3
4
|
color: var(--bs-red-500);
|
|
4
5
|
font-weight: var(--bs-font-bold, 600);
|
|
5
6
|
}
|
|
@@ -8,106 +9,16 @@
|
|
|
8
9
|
color: var(--bs-gray-400);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
|
-
:where(
|
|
12
|
-
:where(label + textarea, label > textarea),
|
|
13
|
-
:where(label + select, label > select) {
|
|
14
|
-
margin-top: 0.25rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='range'])),
|
|
18
|
-
textarea, select {
|
|
19
|
-
appearance: none;
|
|
20
|
-
background-color: var(--input-bg, var(--bs-bg-base));
|
|
21
|
-
border: 1px solid var(--input-border, var(--bs-violet-300));
|
|
22
|
-
border-radius: 0.25rem;
|
|
23
|
-
color: var(--bs-ink-base);
|
|
24
|
-
font-size: var(--bs-text-base);
|
|
25
|
-
font-weight: 400;
|
|
26
|
-
height: 2.5rem;
|
|
27
|
-
line-height: var(--bs-leading-base);
|
|
28
|
-
min-height: 2.5rem;
|
|
29
|
-
padding-inline: 0.75rem;
|
|
30
|
-
width: 100%;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
textarea {
|
|
34
|
-
height: auto;
|
|
35
|
-
padding-block: 0.5rem;
|
|
36
|
-
resize: vertical;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Generally applicable (all input types) */
|
|
40
|
-
:is(input, textarea, select)::placeholder {
|
|
41
|
-
color: var(--bs-violet-200);
|
|
42
|
-
opacity: 1;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:is(input:where(:not([type='checkbox'], [type='radio']), textarea, select):where(:focus)) {
|
|
47
|
-
box-shadow: 0 0 0 2px var(--offset-color, var(--bs-bg-base)),
|
|
48
|
-
0 0 0 4px var(--outline-color, var(--bs-blue-400));
|
|
49
|
-
outline: 2px solid transparent;
|
|
50
|
-
}
|
|
51
|
-
:where(.box) :is(input, textarea, select):where(:focus) {
|
|
12
|
+
:where(.box) :is(input, textarea, select):where(:focus-visible) {
|
|
52
13
|
--offset-color: var(--bs-bg-subtle);
|
|
53
14
|
}
|
|
54
|
-
:where(.box[data-invert]) :is(input, textarea, select):where(:focus) {
|
|
15
|
+
:where(.box[data-invert]) :is(input, textarea, select):where(:focus-visible) {
|
|
55
16
|
--offset-color: var(--bs-bg-invert);
|
|
56
17
|
}
|
|
57
18
|
|
|
58
|
-
:is(input, textarea, select):where([data-error]) {
|
|
59
|
-
--outline-color: var(--bs-red-200);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
:is(input:where(:not([type='checkbox'],[type='radio'])), textarea, select):where(:disabled) {
|
|
63
|
-
background-color: var(--bs-gray-200);
|
|
64
|
-
border-color: var(--bs-gray-400);
|
|
65
|
-
color: var(--bs-gray-400);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/*
|
|
69
|
-
Removes the built-in 'margin' on bottom of textarea
|
|
70
|
-
see https://bugs.chromium.org/p/chromium/issues/detail?id=89530
|
|
71
|
-
:has not fully supported yet but will work for most
|
|
72
|
-
*/
|
|
73
|
-
:has(> textarea:only-child) {
|
|
74
|
-
display: block;
|
|
75
|
-
line-height: 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* chrome user agent styling was applying opacity: 0.7 */
|
|
79
|
-
:where(select:disabled) {
|
|
80
|
-
opacity: 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:is(input, textarea, select):disabled::placeholder,
|
|
84
|
-
:is(input, textarea, select)[disabled]::placeholder {
|
|
85
|
-
color: var(--bs-gray-400);
|
|
86
|
-
opacity: 1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Select */
|
|
90
|
-
|
|
91
|
-
select {
|
|
92
|
-
/* URL Encoded SVG dropdown caret so there is something there */
|
|
93
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%230A0B19' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
94
|
-
background-position: right 0.75rem center;
|
|
95
|
-
background-repeat: no-repeat;
|
|
96
|
-
background-size: 1em 1em;
|
|
97
|
-
}
|
|
98
|
-
.dark select {
|
|
99
|
-
/* URL Encoded SVG dropdown caret so there is something there */
|
|
100
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.dark select:disabled {
|
|
104
|
-
/* URL Encoded SVG dropdown caret so there is something there */
|
|
105
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23555775' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
106
|
-
}
|
|
107
|
-
|
|
108
19
|
/* Errors and Messages */
|
|
109
20
|
:is(input, select, textarea):where([data-error]) {
|
|
110
|
-
--input-border: var(--bs-red-
|
|
21
|
+
--input-border: var(--bs-red-500);
|
|
111
22
|
}
|
|
112
23
|
|
|
113
24
|
/* Fieldset */
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
@mixin form-hints() {
|
|
2
2
|
.bs-hint {
|
|
3
|
+
min-width: 0;
|
|
3
4
|
color: var(--bs-ink-light);
|
|
4
5
|
font-size: var(--bs-text-xs);
|
|
5
6
|
padding: 0;
|
|
6
7
|
margin: 0;
|
|
7
8
|
list-style: none;
|
|
9
|
+
overflow-wrap: break-word;
|
|
8
10
|
}
|
|
11
|
+
|
|
9
12
|
.bs-hint:where([data-error]) {
|
|
10
13
|
color: var(--bs-red-400);
|
|
11
14
|
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
@mixin form-input-composite() {
|
|
2
|
+
.bs-input-addon {
|
|
3
|
+
--input-border: var(--bs-violet-300);
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: var(--input-bg, var(--bs-bg-base));
|
|
6
|
+
border-radius: .25rem;
|
|
7
|
+
color: var(--bs-ink-base);
|
|
8
|
+
display: flex;
|
|
9
|
+
height: 2.5rem;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
padding: 0;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
Implement an outer 'border' via pseudo-element instead of
|
|
18
|
+
on main element to avoid content shifting, double-stroke effect,
|
|
19
|
+
and issues with box-sizing
|
|
20
|
+
*/
|
|
21
|
+
.bs-input-addon::after,
|
|
22
|
+
.bs-input-addon::before,
|
|
23
|
+
.bs-input-addon ::after,
|
|
24
|
+
.bs-input-addon ::before {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.bs-input-addon::after,
|
|
29
|
+
.bs-input-addon::before {
|
|
30
|
+
content: '';
|
|
31
|
+
height: 100%;
|
|
32
|
+
left: 0;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0;
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.bs-input-addon::after {
|
|
39
|
+
border-radius: .25rem;
|
|
40
|
+
border: 1px solid var(--input-border);
|
|
41
|
+
}
|
|
42
|
+
.bs-input-addon :where(.bs-input-addon)::after {
|
|
43
|
+
border: 1px solid var(--input-addon-nested-border);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.bs-input-addon > * {
|
|
47
|
+
flex-grow: 0;
|
|
48
|
+
flex-shrink: 0;
|
|
49
|
+
position: relative;
|
|
50
|
+
}
|
|
51
|
+
.bs-input-addon > :where([data-autowidth]:not([data-autowidth="false"]), .bs-input-addon, bs-input) {
|
|
52
|
+
flex-grow: 1;
|
|
53
|
+
flex-shrink: 1;
|
|
54
|
+
}
|
|
55
|
+
.bs-input-addon > :where([data-autowidth]:not([data-autowidth="false"])) > :where(input, select) {
|
|
56
|
+
width: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.bs-input-addon > *:where(:not(.bs-input-addon)) {
|
|
60
|
+
background-color: var(--input-bg, var(--bs-bg-base));
|
|
61
|
+
border-width: 0px;
|
|
62
|
+
display: flex;
|
|
63
|
+
height: 100%;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
pointer-events: auto;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Remove (hide) children's borders, outlines */
|
|
69
|
+
.bs-input-addon > *,
|
|
70
|
+
.bs-input-addon :where(input, select),
|
|
71
|
+
.bs-input-addon :is(bs-input, bs-select) :where(input, select),
|
|
72
|
+
.bs-input-addon :where(.bs-input-addon) {
|
|
73
|
+
--input-border: transparent;
|
|
74
|
+
--input-border-width: 0px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.bs-input-addon {
|
|
78
|
+
--input-addon-nested-border: transparent;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bs-input-addon :where(:focus-within) :where(input, select),
|
|
82
|
+
.bs-input-addon :where(:focus-within) :is(bs-input, bs-select) :where(input, select),
|
|
83
|
+
.bs-input-addon :where(input, select):where(:focus, :focus-within, :focus-visible),
|
|
84
|
+
.bs-input-addon :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
|
|
85
|
+
--input-border: transparent;
|
|
86
|
+
box-shadow: none;
|
|
87
|
+
outline: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* -------- Inner-bordered styles -------- */
|
|
91
|
+
/** Inner borders should be straight; shown only if variant: "inner-bordered" */
|
|
92
|
+
.bs-input-addon:where([data-variant="inner-bordered"]),
|
|
93
|
+
.bs-input-addon:where([data-variant="inner-bordered"]) :where(.bs-input-addon) {
|
|
94
|
+
--input-addon-nested-border: var(--bs-violet-100);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.bs-input-addon > :where(.bs-input-addon:not(:last-child, :focus-within)),
|
|
98
|
+
.bs-input-addon > :where(:not(:last-child, :focus-within))::after {
|
|
99
|
+
border-top-right-radius: 0;
|
|
100
|
+
border-bottom-right-radius: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.bs-input-addon > :where(.bs-input-addon:not(:first-child, :focus-within)),
|
|
104
|
+
.bs-input-addon > :where(:not(:first-child, :focus-within))::after {
|
|
105
|
+
border-top-left-radius: 0;
|
|
106
|
+
border-bottom-left-radius: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.bs-input-addon:where([data-variant="inner-bordered"]) > :where(:not(:focus, :focus-within))::after {
|
|
110
|
+
border-left-width: 0px;
|
|
111
|
+
border-right-width: 1px;
|
|
112
|
+
border-right-color: var(--input-addon-nested-border);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.bs-input-addon:where([data-variant="inner-bordered"]) > :where(:not(.bs-input-addon, :focus, :focus-within))::after {
|
|
116
|
+
content: '';
|
|
117
|
+
height: 100%;
|
|
118
|
+
left: 0;
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 0;
|
|
121
|
+
width: 100%;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.bs-input-addon:where([data-variant="inner-bordered"]) > :where(.bs-input-addon)::after {
|
|
125
|
+
border-radius: 0px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
/* -------- Focus styles -------- */
|
|
130
|
+
.bs-input-addon {
|
|
131
|
+
--focus-border: var(--bs-blue-400);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.bs-input-addon:where(:not([data-multifocus]):focus-within),
|
|
135
|
+
.bs-input-addon:where([data-multifocus]) :where(input, select):where(:focus, :focus-within, :focus-visible),
|
|
136
|
+
.bs-input-addon:where([data-multifocus]) :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
|
|
137
|
+
--input-border: var(--focus-border);
|
|
138
|
+
position: relative;
|
|
139
|
+
z-index: 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.bs-input-addon :where(.bs-input-addon:focus-within) {
|
|
143
|
+
--input-addon-nested-border: var(--focus-border);
|
|
144
|
+
z-index: 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.bs-input-addon :where(.bs-input-addon:focus-within)::after {
|
|
148
|
+
z-index: 1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.bs-input-addon:where([data-multifocus]) > :where(:not(.bs-input-addon)) > :where(input:focus, select:focus),
|
|
152
|
+
.bs-input-addon:where([data-multifocus]) > :is(bs-input, bs-select) :where(input:focus, select:focus),
|
|
153
|
+
.bs-input-addon:where([data-multifocus]) > :where(input:focus, select:focus) {
|
|
154
|
+
border-radius: .25rem;
|
|
155
|
+
box-shadow: var(--focus-border) 0px 0px 0px 1px inset;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.bs-input-addon:where(:not([data-multifocus]):focus-within)::after {
|
|
159
|
+
border-width: 1px;
|
|
160
|
+
border-radius: .25rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.bs-input-addon:where(:focus-within) :where(:not(:focus, :focus-within))::after,
|
|
164
|
+
.bs-input-addon:where(:focus-within) :where(:not(:focus, :focus-within)) {
|
|
165
|
+
border-color: transparent;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Straight-lined ::before border to fill the gap below the rounded ::after border */
|
|
169
|
+
.bs-input-addon:where([data-multifocus]) :where(:focus-within)::before {
|
|
170
|
+
border-bottom-width: 1px;
|
|
171
|
+
border-color: var(--bs-violet-300);
|
|
172
|
+
border-radius: 0;
|
|
173
|
+
border-top-width: 1px;
|
|
174
|
+
z-index: 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* -------- Disabled styles -------- */
|
|
178
|
+
.bs-input-addon:where([data-disabled]:not([data-disabled="false"])),
|
|
179
|
+
.bs-input-addon:where([data-disabled]:not([data-disabled="false"])) bs-button .bs-button {
|
|
180
|
+
--input-bg: var(--bs-gray-200);
|
|
181
|
+
--input-border: var(--bs-gray-400);
|
|
182
|
+
color: var(--bs-gray-400);
|
|
183
|
+
}
|
|
184
|
+
.bs-input-addon:where([data-disabled]:not([data-disabled="false"])) * {
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* -------- Error styles -------- */
|
|
189
|
+
.bs-input-addon:where([data-error]),
|
|
190
|
+
.bs-input-addon:where([data-error]) :where(.bs-input-addon) {
|
|
191
|
+
--focus-border: var(--bs-red-400);
|
|
192
|
+
--input-border: var(--bs-red-400);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.bs-input-addon:where([data-error],[data-disabled]) > *::before,
|
|
196
|
+
.bs-input-addon:where(.bs-input-addon[data-error] .bs-input-addon, .bs-input-addon[data-disabled] .bs-input-addon) > *::before {
|
|
197
|
+
border-color: var(--input-border);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* -------- Label margin -------- */
|
|
201
|
+
:where(label, .bs-label, bs-label) + .bs-input-addon {
|
|
202
|
+
margin-top: 0.25rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
@mixin form-text-fields() {
|
|
2
|
+
:where(label + input, label > input):where(:not([type='checkbox'], [type='radio'])),
|
|
3
|
+
:where(label + textarea, label > textarea),
|
|
4
|
+
:where(label + select, label > select) {
|
|
5
|
+
margin-top: 0.25rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='range'])),
|
|
9
|
+
textarea, select {
|
|
10
|
+
appearance: none;
|
|
11
|
+
background-color: var(--input-bg, var(--bs-bg-base));
|
|
12
|
+
border-color: var(--input-border, var(--bs-violet-300));
|
|
13
|
+
border-radius: 0.25rem;
|
|
14
|
+
border-style: solid;
|
|
15
|
+
border-width: var(--input-border-width, 1px);
|
|
16
|
+
caret-color: var(--bs-blue-400);
|
|
17
|
+
color: var(--bs-ink-base);
|
|
18
|
+
font-size: var(--bs-text-base);
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
height: 2.5rem;
|
|
21
|
+
line-height: var(--bs-leading-base);
|
|
22
|
+
min-height: 2.5rem;
|
|
23
|
+
padding-inline: 0.75rem;
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
input:where([type='text'], [type='email'], [type='url']),
|
|
28
|
+
select {
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
textarea {
|
|
33
|
+
height: auto;
|
|
34
|
+
padding-block: 0.5rem;
|
|
35
|
+
resize: vertical;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:is(input, textarea, select)::placeholder {
|
|
39
|
+
color: var(--bs-violet-200);
|
|
40
|
+
}
|
|
41
|
+
:is(input, textarea, select):where(:focus-visible)::placeholder {
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:is(input:where(:not([type='checkbox'], [type='radio'])), textarea, select):where(:focus-visible) {
|
|
46
|
+
--input-border: var(--bs-blue-400);
|
|
47
|
+
outline-width: 0px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:is(input:where(:not([type='checkbox'],[type='radio'])), textarea, select):where(:disabled) {
|
|
51
|
+
--input-border: var(--bs-gray-400);
|
|
52
|
+
background-color: var(--bs-gray-200);
|
|
53
|
+
color: var(--bs-gray-400);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Errors and Messages */
|
|
57
|
+
:is(input, select, textarea):where([data-error]) {
|
|
58
|
+
--input-border: var(--bs-red-500);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/*
|
|
62
|
+
Removes the built-in 'margin' on bottom of textarea
|
|
63
|
+
see https://bugs.chromium.org/p/chromium/issues/detail?id=89530
|
|
64
|
+
:has not fully supported yet but will work for most
|
|
65
|
+
*/
|
|
66
|
+
:has(> textarea:only-child) {
|
|
67
|
+
display: block;
|
|
68
|
+
line-height: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* chrome user agent styling was applying opacity: 0.7 */
|
|
72
|
+
:where(select:disabled) {
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:is(input, textarea, select):disabled::placeholder,
|
|
77
|
+
:is(input, textarea, select)[disabled]::placeholder {
|
|
78
|
+
color: var(--bs-gray-400);
|
|
79
|
+
opacity: 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Select */
|
|
83
|
+
|
|
84
|
+
select {
|
|
85
|
+
/* URL Encoded SVG dropdown caret so there is something there */
|
|
86
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%230A0B19' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
87
|
+
background-position: right 0.75rem center;
|
|
88
|
+
background-repeat: no-repeat;
|
|
89
|
+
background-size: 1em 1em;
|
|
90
|
+
padding-right: var(--bs-space-9);
|
|
91
|
+
}
|
|
92
|
+
.dark select {
|
|
93
|
+
/* URL Encoded SVG dropdown caret so there is something there */
|
|
94
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.dark select:disabled {
|
|
98
|
+
/* URL Encoded SVG dropdown caret so there is something there */
|
|
99
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23555775' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|