modus-bootstrap 6.0.0-alpha.1 → 6.0.0-alpha.2
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/.browserslistrc +5 -5
- package/LICENSE +0 -0
- package/README.md +46 -89
- package/dist/css/modus-bootstrap-grid.css +684 -185
- package/dist/css/modus-bootstrap-grid.css.map +1 -1
- package/dist/css/modus-bootstrap-grid.min.css +2 -2
- package/dist/css/modus-bootstrap-grid.min.css.map +1 -1
- package/dist/css/modus-bootstrap-reboot.css +15 -6
- package/dist/css/modus-bootstrap-reboot.css.map +1 -1
- package/dist/css/modus-bootstrap-reboot.min.css +2 -2
- package/dist/css/modus-bootstrap-reboot.min.css.map +1 -1
- package/dist/css/modus-bootstrap-utilities.css +63 -56
- package/dist/css/modus-bootstrap-utilities.css.map +1 -1
- package/dist/css/modus-bootstrap-utilities.min.css +2 -2
- package/dist/css/modus-bootstrap-utilities.min.css.map +1 -1
- package/dist/css/modus-bootstrap.css +2355 -1176
- package/dist/css/modus-bootstrap.css.map +1 -1
- package/dist/css/modus-bootstrap.min.css +1 -1
- package/dist/css/modus-bootstrap.min.css.map +1 -1
- package/package.json +40 -38
- package/scss/_accordion.scss +12 -5
- package/scss/_alert.scss +11 -3
- package/scss/_avatar.scss +12 -0
- package/scss/_badge.scss +0 -0
- package/scss/_banner.scss +1 -1
- package/scss/_breadcrumb.scss +8 -1
- package/scss/_card.scss +5 -0
- package/scss/_carousel.scss +0 -0
- package/scss/_chip.scss +14 -9
- package/scss/_colors.scss +0 -0
- package/scss/_config.scss +1 -0
- package/scss/_dialog.scss +45 -13
- package/scss/_drawer.scss +56 -42
- package/scss/_functions.scss +0 -0
- package/scss/_list-group.scss +0 -0
- package/scss/_menu.scss +96 -15
- package/scss/_nav-overflow.scss +0 -0
- package/scss/_nav.scss +6 -0
- package/scss/_navbar.scss +2 -7
- package/scss/_pagination.scss +1 -1
- package/scss/_placeholder.scss +0 -0
- package/scss/_popover.scss +31 -0
- package/scss/_progress.scss +15 -2
- package/scss/_root-modus.scss +5 -2
- package/scss/_root.scss +6 -7
- package/scss/_spinner.scss +6 -0
- package/scss/_stepper.scss +7 -1
- package/scss/_theme.scss +0 -0
- package/scss/_toasts.scss +0 -0
- package/scss/_tooltip.scss +37 -0
- package/scss/_transitions.scss +14 -8
- package/scss/_utilities.scss +18 -9
- package/scss/bootstrap.scss +0 -1
- package/scss/buttons/_button-group.scss +0 -0
- package/scss/buttons/_button.scss +8 -4
- package/scss/buttons/_close.scss +12 -4
- package/scss/buttons/index.scss +0 -0
- package/scss/content/_blockquote.scss +0 -0
- package/scss/content/_images.scss +0 -0
- package/scss/content/_lists.scss +1 -1
- package/scss/content/_prose.scss +16 -7
- package/scss/content/_reboot.scss +16 -2
- package/scss/content/_tables.scss +1 -4
- package/scss/content/index.scss +0 -0
- package/scss/forms/_check.scss +24 -13
- package/scss/forms/{_chip-input.scss → _combobox-control.scss} +28 -16
- package/scss/forms/_combobox.scss +35 -6
- package/scss/{_datepicker.scss → forms/_datepicker.scss} +157 -59
- package/scss/forms/_floating-labels.scss +22 -0
- package/scss/forms/_form-adorn.scss +15 -1
- package/scss/forms/_form-control.scss +1 -1
- package/scss/forms/_form-field.scss +2 -1
- package/scss/forms/_form-range.scss +45 -7
- package/scss/forms/_form-text.scss +0 -2
- package/scss/forms/_input-group.scss +0 -0
- package/scss/forms/_labels.scss +3 -0
- package/scss/forms/_otp-input.scss +68 -13
- package/scss/forms/_radio.scss +6 -0
- package/scss/forms/_strength.scss +16 -1
- package/scss/forms/_switch.scss +11 -2
- package/scss/forms/_validation.scss +31 -7
- package/scss/forms/index.scss +2 -1
- package/scss/helpers/_file-drop-zone.scss +0 -0
- package/scss/helpers/_focus-ring.scss +0 -0
- package/scss/helpers/_hover-lift.scss +2 -1
- package/scss/helpers/_icon-link.scss +0 -0
- package/scss/helpers/_position.scss +0 -0
- package/scss/helpers/_stacks.scss +0 -0
- package/scss/helpers/_stretched-link.scss +0 -0
- package/scss/helpers/_text-truncation.scss +0 -0
- package/scss/helpers/_theme-colors.scss +0 -0
- package/scss/helpers/_visually-hidden.scss +0 -0
- package/scss/helpers/_vr.scss +7 -0
- package/scss/helpers/index.scss +0 -0
- package/scss/layout/_breakpoints.scss +0 -0
- package/scss/layout/_containers.scss +0 -0
- package/scss/layout/_grid.scss +0 -2
- package/scss/layout/index.scss +0 -0
- package/scss/mixins/_backdrop.scss +0 -0
- package/scss/mixins/_border-radius.scss +0 -0
- package/scss/mixins/_box-shadow.scss +0 -0
- package/scss/mixins/_color-mode.scss +0 -0
- package/scss/mixins/_color-scheme.scss +0 -0
- package/scss/mixins/_deprecate.scss +0 -0
- package/scss/mixins/_dialog-shared.scss +0 -0
- package/scss/mixins/_focus-ring.scss +0 -0
- package/scss/mixins/_forced-colors.scss +14 -0
- package/scss/mixins/_form-validation.scss +0 -0
- package/scss/mixins/_gradients.scss +0 -0
- package/scss/mixins/_grid.scss +24 -18
- package/scss/mixins/_image.scss +0 -0
- package/scss/mixins/_lists.scss +0 -0
- package/scss/mixins/_mask-icon.scss +0 -0
- package/scss/mixins/_reset-text.scss +0 -0
- package/scss/mixins/_resize.scss +0 -0
- package/scss/mixins/_text-truncate.scss +0 -0
- package/scss/mixins/_tokens.scss +0 -0
- package/scss/mixins/_transition.scss +0 -0
- package/scss/mixins/_utilities.scss +0 -0
- package/scss/mixins/_visually-hidden.scss +1 -1
- package/scss/mixins/index.scss +1 -0
- package/scss/modus-bootstrap-grid.scss +0 -0
- package/scss/modus-bootstrap-reboot.scss +0 -0
- package/scss/modus-bootstrap-utilities.scss +0 -0
- package/scss/modus-bootstrap.scss +0 -1
- package/scss/utilities/_api.scss +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@use "../mixins/border-radius" as *;
|
|
3
3
|
@use "../mixins/box-shadow" as *;
|
|
4
4
|
@use "../mixins/focus-ring" as *;
|
|
5
|
+
@use "../mixins/forced-colors" as *;
|
|
5
6
|
@use "../mixins/transition" as *;
|
|
6
7
|
@use "../mixins/gradients" as *;
|
|
7
8
|
@use "../mixins/tokens" as *;
|
|
@@ -18,15 +19,17 @@ $range-tokens: defaults(
|
|
|
18
19
|
--range-track-rail-height: .25rem,
|
|
19
20
|
--range-track-cursor: pointer,
|
|
20
21
|
--range-track-bg: color-mix(in oklch, var(--fg-body) 10%, transparent),
|
|
21
|
-
--range-track-border-radius:
|
|
22
|
+
--range-track-border-radius: var(--radius-pill),
|
|
23
|
+
--range-track-box-shadow: none,
|
|
22
24
|
--range-track-fill-bg: var(--theme-bg, light-dark(var(--black), var(--white))),
|
|
25
|
+
--range-track-fill-direction: to right,
|
|
23
26
|
--range-track-disabled-bg: color-mix(in oklch, var(--fg-body) 30%, var(--bg-body)),
|
|
24
27
|
--range-thumb-width: 1.25rem,
|
|
25
28
|
--range-thumb-height: var(--range-thumb-width),
|
|
26
29
|
--range-thumb-bg: var(--bg-body),
|
|
27
30
|
--range-thumb-border-width: 3px,
|
|
28
31
|
--range-thumb-border-color: var(--range-track-fill-bg),
|
|
29
|
-
--range-thumb-border-radius:
|
|
32
|
+
--range-thumb-border-radius: var(--radius-pill),
|
|
30
33
|
--range-thumb-box-shadow: none,
|
|
31
34
|
--range-thumb-active-bg: color-mix(in oklch, var(--range-track-fill-bg) 15%, var(--bg-body)),
|
|
32
35
|
--range-thumb-focus-bg: var(--range-track-fill-bg),
|
|
@@ -75,7 +78,7 @@ $range-tokens: defaults(
|
|
|
75
78
|
// The fill is as tall as the thumb. The unfilled rail is a thin band centered behind it.
|
|
76
79
|
background:
|
|
77
80
|
linear-gradient(
|
|
78
|
-
|
|
81
|
+
var(--range-track-fill-direction),
|
|
79
82
|
var(--range-track-fill-bg) var(--range-fill-end),
|
|
80
83
|
transparent var(--range-fill-end)
|
|
81
84
|
), linear-gradient(var(--range-track-bg), var(--range-track-bg)) center / 100% var(--range-track-rail-height) no-repeat;
|
|
@@ -92,6 +95,11 @@ $range-tokens: defaults(
|
|
|
92
95
|
position: relative;
|
|
93
96
|
display: block;
|
|
94
97
|
width: 100%;
|
|
98
|
+
outline: 1px solid transparent;
|
|
99
|
+
|
|
100
|
+
&:dir(rtl) {
|
|
101
|
+
--range-track-fill-direction: to left;
|
|
102
|
+
}
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
.form-range-input {
|
|
@@ -102,6 +110,28 @@ $range-tokens: defaults(
|
|
|
102
110
|
appearance: none;
|
|
103
111
|
background-color: transparent;
|
|
104
112
|
|
|
113
|
+
// Forced colors mode sets the track and thumb backgrounds to `Canvas` and drops the
|
|
114
|
+
// fill gradient, so the slider disappears. Paint the parts with system colors instead.
|
|
115
|
+
@include forced-colors() {
|
|
116
|
+
--range-track-bg: Canvas;
|
|
117
|
+
--range-track-fill-bg: Highlight;
|
|
118
|
+
--range-track-disabled-bg: GrayText;
|
|
119
|
+
--range-thumb-bg: Canvas;
|
|
120
|
+
--range-thumb-border-color: var(--range-track-fill-bg);
|
|
121
|
+
--range-thumb-active-bg: Highlight;
|
|
122
|
+
--range-thumb-focus-bg: Highlight;
|
|
123
|
+
forced-color-adjust: none;
|
|
124
|
+
|
|
125
|
+
// Outline instead of border, so the track height and thumb offset stay the same.
|
|
126
|
+
&::-webkit-slider-runnable-track {
|
|
127
|
+
outline: 1px solid CanvasText;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&::-moz-range-track {
|
|
131
|
+
outline: 1px solid CanvasText;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
105
135
|
&:focus-visible {
|
|
106
136
|
outline: 0;
|
|
107
137
|
|
|
@@ -152,26 +182,34 @@ $range-tokens: defaults(
|
|
|
152
182
|
// pill and arrow. We only add the static positioning the Tooltip plugin would normally do.
|
|
153
183
|
.form-range-bubble {
|
|
154
184
|
position: absolute;
|
|
185
|
+
inset-inline-start: calc((var(--range-thumb-width) * .5) + var(--range-fill, 0) * (100% - var(--range-thumb-width)));
|
|
155
186
|
bottom: 100%;
|
|
156
|
-
left: calc((var(--range-thumb-width) * .5) + var(--range-fill, 0) * (100% - var(--range-thumb-width)));
|
|
157
187
|
margin-bottom: var(--tooltip-arrow-height);
|
|
158
188
|
pointer-events: none;
|
|
159
189
|
transform: translateX(-50%);
|
|
160
190
|
|
|
191
|
+
&:dir(rtl) {
|
|
192
|
+
transform: translateX(50%);
|
|
193
|
+
}
|
|
194
|
+
|
|
161
195
|
.tooltip-arrow {
|
|
162
196
|
position: absolute;
|
|
197
|
+
inset-inline-start: 50%;
|
|
163
198
|
bottom: calc(-1 * var(--tooltip-arrow-height));
|
|
164
|
-
left: 50%;
|
|
165
199
|
transform: translateX(-50%);
|
|
200
|
+
|
|
201
|
+
&:dir(rtl) {
|
|
202
|
+
transform: translateX(50%);
|
|
203
|
+
}
|
|
166
204
|
}
|
|
167
205
|
}
|
|
168
206
|
|
|
169
207
|
// Tick marks generated from the linked <datalist>. Plugin builds `grid-template-columns`
|
|
170
208
|
// from the gaps between values so each tick lands on a grid line (handles uneven values).
|
|
171
|
-
// Track is inset by
|
|
209
|
+
// Track is inset by half the thumb width to match its center at each end.
|
|
172
210
|
.form-range-ticks {
|
|
173
211
|
display: grid;
|
|
174
|
-
padding-inline: calc(var(--range-thumb-width) * .
|
|
212
|
+
padding-inline: calc(var(--range-thumb-width) * .5);
|
|
175
213
|
}
|
|
176
214
|
|
|
177
215
|
.form-range-tick {
|
|
@@ -7,7 +7,6 @@ $form-text-tokens: () !default;
|
|
|
7
7
|
// stylelint-disable-next-line scss/dollar-variable-default
|
|
8
8
|
$form-text-tokens: defaults(
|
|
9
9
|
(
|
|
10
|
-
--form-text-margin-top: .25rem,
|
|
11
10
|
--form-text-font-size: var(--font-size-sm),
|
|
12
11
|
--form-text-font-style: null,
|
|
13
12
|
--form-text-font-weight: null,
|
|
@@ -21,7 +20,6 @@ $form-text-tokens: defaults(
|
|
|
21
20
|
.form-text {
|
|
22
21
|
@include tokens($form-text-tokens);
|
|
23
22
|
|
|
24
|
-
// margin-top: var(--form-text-margin-top);
|
|
25
23
|
font-size: var(--form-text-font-size);
|
|
26
24
|
font-style: var(--form-text-font-style);
|
|
27
25
|
font-weight: var(--form-text-font-weight);
|
|
File without changes
|
package/scss/forms/_labels.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "../functions" as *;
|
|
2
|
+
@use "../mixins/tokens" as *;
|
|
2
3
|
|
|
3
4
|
$form-label-tokens: () !default;
|
|
4
5
|
|
|
@@ -19,6 +20,8 @@ $form-label-tokens: defaults(
|
|
|
19
20
|
@layer forms {
|
|
20
21
|
.form-label,
|
|
21
22
|
.col-form-label {
|
|
23
|
+
@include tokens($form-label-tokens);
|
|
24
|
+
|
|
22
25
|
font-size: var(--label-font-size, inherit);
|
|
23
26
|
font-style: var(--label-font-style, inherit);
|
|
24
27
|
font-weight: var(--label-font-weight, 500);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@use "../mixins/border-radius" as *;
|
|
3
3
|
@use "../mixins/box-shadow" as *;
|
|
4
4
|
@use "../mixins/focus-ring" as *;
|
|
5
|
+
@use "../mixins/forced-colors" as *;
|
|
5
6
|
@use "../mixins/tokens" as *;
|
|
6
7
|
@use "../mixins/transition" as *;
|
|
7
8
|
|
|
@@ -40,7 +41,15 @@ $otp-sizes: defaults(
|
|
|
40
41
|
@include tokens($otp-tokens);
|
|
41
42
|
|
|
42
43
|
position: relative;
|
|
44
|
+
box-sizing: border-box;
|
|
43
45
|
display: flex;
|
|
46
|
+
inline-size: fit-content;
|
|
47
|
+
max-inline-size: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Leave space inside the input hit area for a password manager badge.
|
|
51
|
+
.otp-rendered.otp-badge-space {
|
|
52
|
+
padding-inline-end: 2.5rem;
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
// A single real input backs the whole control. Once the JS renders the
|
|
@@ -52,19 +61,39 @@ $otp-sizes: defaults(
|
|
|
52
61
|
width: 100%;
|
|
53
62
|
height: 100%;
|
|
54
63
|
padding: 0;
|
|
64
|
+
font-size: max(1rem, var(--otp-font-size));
|
|
55
65
|
color: transparent;
|
|
56
66
|
// The input sits on top and receives taps itself, so a touch focuses it
|
|
57
67
|
// natively (raising the on-screen keyboard via a genuine user gesture).
|
|
58
68
|
// The JS maps the tap's position to a slot and sets the caret.
|
|
59
69
|
pointer-events: auto;
|
|
60
|
-
cursor:
|
|
70
|
+
cursor: text;
|
|
61
71
|
caret-color: transparent;
|
|
72
|
+
-webkit-text-fill-color: transparent;
|
|
62
73
|
background-color: transparent;
|
|
63
74
|
border: 0;
|
|
64
75
|
outline: 0;
|
|
65
76
|
box-shadow: none;
|
|
66
77
|
|
|
67
|
-
|
|
78
|
+
&:autofill {
|
|
79
|
+
background-clip: text;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@supports (-webkit-touch-callout: none) {
|
|
83
|
+
// iOS paints selection independently of ::selection.
|
|
84
|
+
letter-spacing: -.5em;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Keep the overlay transparent when the OS overrides text colors.
|
|
88
|
+
@include forced-colors() {
|
|
89
|
+
forced-color-adjust: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&::placeholder {
|
|
93
|
+
color: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Never reveal the underlying characters, even on selection.
|
|
68
97
|
&::selection {
|
|
69
98
|
color: transparent;
|
|
70
99
|
background-color: transparent;
|
|
@@ -74,6 +103,7 @@ $otp-sizes: defaults(
|
|
|
74
103
|
.otp-slots {
|
|
75
104
|
display: inline-flex;
|
|
76
105
|
gap: var(--otp-gap);
|
|
106
|
+
min-inline-size: 0;
|
|
77
107
|
pointer-events: none; // purely visual; the overlaid input handles interaction
|
|
78
108
|
}
|
|
79
109
|
|
|
@@ -81,10 +111,12 @@ $otp-sizes: defaults(
|
|
|
81
111
|
display: flex;
|
|
82
112
|
align-items: center;
|
|
83
113
|
justify-content: center;
|
|
84
|
-
|
|
85
|
-
min-
|
|
114
|
+
inline-size: var(--otp-size);
|
|
115
|
+
min-inline-size: 0;
|
|
116
|
+
min-block-size: var(--otp-size);
|
|
86
117
|
font-size: var(--otp-font-size);
|
|
87
|
-
font-weight:
|
|
118
|
+
font-weight: var(--font-weight-medium);
|
|
119
|
+
font-variant-numeric: tabular-nums;
|
|
88
120
|
line-height: 1;
|
|
89
121
|
color: var(--otp-slot-fg);
|
|
90
122
|
user-select: none; // decorative cells; the real input handles selection
|
|
@@ -93,21 +125,40 @@ $otp-sizes: defaults(
|
|
|
93
125
|
@include border-radius(var(--otp-slot-border-radius));
|
|
94
126
|
@include box-shadow(var(--box-shadow-inset));
|
|
95
127
|
@include transition(border-color .15s ease-in-out, box-shadow .15s ease-in-out);
|
|
128
|
+
|
|
129
|
+
&:not(.otp-slot-filled) {
|
|
130
|
+
color: var(--fg-4);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.otp-slot-selected {
|
|
135
|
+
color: HighlightText;
|
|
136
|
+
background-color: Highlight;
|
|
137
|
+
border-color: Highlight;
|
|
96
138
|
}
|
|
97
139
|
|
|
98
140
|
// The slot at the caret gets the focus ring; empty active slots show a
|
|
99
141
|
// blinking caret so the entry point is obvious.
|
|
100
142
|
.otp-slot-active {
|
|
101
143
|
--focus-ring-offset: -1px;
|
|
144
|
+
position: relative;
|
|
102
145
|
z-index: 1;
|
|
103
146
|
@include focus-ring(true);
|
|
104
147
|
|
|
148
|
+
@include forced-colors() {
|
|
149
|
+
outline: 2px solid Highlight;
|
|
150
|
+
outline-offset: -2px;
|
|
151
|
+
}
|
|
152
|
+
|
|
105
153
|
&:not(.otp-slot-filled)::after {
|
|
154
|
+
position: absolute;
|
|
106
155
|
width: 1px;
|
|
107
156
|
height: 50%;
|
|
108
157
|
content: "";
|
|
109
158
|
background-color: var(--otp-slot-fg);
|
|
110
|
-
|
|
159
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
160
|
+
animation: otp-caret-blink 1s step-end infinite;
|
|
161
|
+
}
|
|
111
162
|
}
|
|
112
163
|
}
|
|
113
164
|
|
|
@@ -120,20 +171,24 @@ $otp-sizes: defaults(
|
|
|
120
171
|
.otp-connected .otp-slots {
|
|
121
172
|
gap: 0;
|
|
122
173
|
}
|
|
174
|
+
.otp-connected .otp-slot + .otp-slot {
|
|
175
|
+
margin-inline-start: calc(var(--otp-slot-border-width) * -1);
|
|
176
|
+
}
|
|
177
|
+
|
|
123
178
|
.otp-connected .otp-slot {
|
|
124
179
|
border-radius: 0; // stylelint-disable-line property-disallowed-list
|
|
125
180
|
|
|
126
|
-
&:
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
&:first-child {
|
|
130
|
-
@include border-start-radius(var(--otp-slot-border-radius));
|
|
131
|
-
}
|
|
132
|
-
&:last-child {
|
|
181
|
+
&:last-child,
|
|
182
|
+
&:has(+ .otp-separator) {
|
|
133
183
|
@include border-end-radius(var(--otp-slot-border-radius));
|
|
134
184
|
}
|
|
135
185
|
}
|
|
136
186
|
|
|
187
|
+
.otp-connected .otp-slot:first-child,
|
|
188
|
+
.otp-connected .otp-separator + .otp-slot {
|
|
189
|
+
@include border-start-radius(var(--otp-slot-border-radius));
|
|
190
|
+
}
|
|
191
|
+
|
|
137
192
|
.otp-separator {
|
|
138
193
|
display: flex;
|
|
139
194
|
align-items: center;
|
package/scss/forms/_radio.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "../functions" as *;
|
|
2
2
|
@use "../mixins/focus-ring" as *;
|
|
3
|
+
@use "../mixins/forced-colors" as *;
|
|
3
4
|
@use "../mixins/tokens" as *;
|
|
4
5
|
@use "../mixins/transition" as *;
|
|
5
6
|
|
|
@@ -60,6 +61,11 @@ $radio-tokens: defaults(
|
|
|
60
61
|
opacity var(--control-transition-duration) var(--control-transition-timing),
|
|
61
62
|
transform var(--control-transition-duration) var(--control-transition-timing)
|
|
62
63
|
);
|
|
64
|
+
|
|
65
|
+
// Forced colors mode removes the background color. Show the dot with an outline.
|
|
66
|
+
@include forced-colors() {
|
|
67
|
+
outline: 2px solid transparent;
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
|
|
65
71
|
&:checked {
|
|
@@ -31,6 +31,15 @@ $strength-tokens: defaults(
|
|
|
31
31
|
$strength-levels: weak, fair, good, strong !default;
|
|
32
32
|
// scss-docs-end strength-levels
|
|
33
33
|
|
|
34
|
+
// The text sits next to `.strength`, not inside it, so it can't read the meter's
|
|
35
|
+
// `--strength-color`. The `-fg-emphasis` tokens keep enough contrast as text.
|
|
36
|
+
$strength-text-colors: (
|
|
37
|
+
weak: var(--danger-fg-emphasis),
|
|
38
|
+
fair: var(--warning-fg-emphasis),
|
|
39
|
+
good: var(--info-fg-emphasis),
|
|
40
|
+
strong: var(--success-fg-emphasis)
|
|
41
|
+
) !default;
|
|
42
|
+
|
|
34
43
|
$strength-transition: background-color .2s ease-in-out, width .3s ease-in-out !default;
|
|
35
44
|
|
|
36
45
|
@layer forms {
|
|
@@ -68,9 +77,15 @@ $strength-transition: background-color .2s ease-in-out, width .3s ease-in-out !d
|
|
|
68
77
|
display: block;
|
|
69
78
|
margin-top: var(--strength-margin-top);
|
|
70
79
|
font-size: var(--font-size-xs);
|
|
71
|
-
color: var(--
|
|
80
|
+
color: var(--fg-3);
|
|
72
81
|
@include transition(color .2s ease-in-out);
|
|
73
82
|
|
|
83
|
+
@each $level, $color in $strength-text-colors {
|
|
84
|
+
&[data-bs-strength="#{$level}"] {
|
|
85
|
+
color: $color;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
74
89
|
// Hide when empty
|
|
75
90
|
&:empty {
|
|
76
91
|
display: none;
|
package/scss/forms/_switch.scss
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use "../functions" as *;
|
|
2
2
|
@use "../mixins/focus-ring" as *;
|
|
3
|
+
@use "../mixins/forced-colors" as *;
|
|
3
4
|
@use "../mixins/tokens" as *;
|
|
4
5
|
@use "../mixins/transition" as *;
|
|
5
6
|
|
|
@@ -54,7 +55,7 @@ $switch-tokens: defaults(
|
|
|
54
55
|
|
|
55
56
|
&::before {
|
|
56
57
|
position: absolute;
|
|
57
|
-
inset-block:
|
|
58
|
+
inset-block-start: 50%;
|
|
58
59
|
inset-inline-start: var(--switch-padding);
|
|
59
60
|
width: var(--switch-indicator-width);
|
|
60
61
|
height: var(--switch-indicator-height);
|
|
@@ -62,8 +63,15 @@ $switch-tokens: defaults(
|
|
|
62
63
|
background-color: var(--theme-contrast, var(--switch-indicator-bg));
|
|
63
64
|
// stylelint-disable-next-line property-disallowed-list
|
|
64
65
|
border-radius: 10rem;
|
|
66
|
+
outline: 1px solid transparent;
|
|
65
67
|
box-shadow: 0 1px 2px rgb(0 0 0 / .1);
|
|
68
|
+
translate: 0 -50%;
|
|
66
69
|
@include transition(inset-inline-start var(--switch-transition-duration) var(--switch-transition-timing));
|
|
70
|
+
|
|
71
|
+
// Forced colors mode removes the background color. Show the indicator with an outline.
|
|
72
|
+
@include forced-colors() {
|
|
73
|
+
outline: 1px solid transparent;
|
|
74
|
+
}
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
input {
|
|
@@ -91,11 +99,13 @@ $switch-tokens: defaults(
|
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
&:has(input:checked) {
|
|
102
|
+
--switch-indicator-bg: var(--switch-checked-indicator-bg);
|
|
94
103
|
background-color: var(--theme-bg, var(--switch-checked-bg));
|
|
95
104
|
border-color: var(--theme-bg, var(--switch-checked-border-color));
|
|
96
105
|
|
|
97
106
|
&::before {
|
|
98
107
|
inset-inline-start: calc(100% - var(--switch-indicator-width) - var(--switch-padding));
|
|
108
|
+
background-color: var(--theme-contrast, var(--switch-checked-indicator-bg));
|
|
99
109
|
}
|
|
100
110
|
}
|
|
101
111
|
|
|
@@ -117,7 +127,6 @@ $switch-tokens: defaults(
|
|
|
117
127
|
}
|
|
118
128
|
.switch-lg {
|
|
119
129
|
--switch-height: 1.5rem;
|
|
120
|
-
--switch-margin-block: .375rem;
|
|
121
130
|
|
|
122
131
|
+ label {
|
|
123
132
|
font-size: var(--font-size-lg);
|
|
@@ -30,19 +30,22 @@ $validation-states: defaults(
|
|
|
30
30
|
width: 100%;
|
|
31
31
|
font-size: var(--font-size-sm);
|
|
32
32
|
color: var(--#{$theme}-fg);
|
|
33
|
+
overflow-wrap: anywhere;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
// More specific to override base tooltip styles
|
|
36
37
|
.tooltip.#{$state}-tooltip {
|
|
37
38
|
position: absolute;
|
|
38
|
-
|
|
39
|
+
inset-block-start: 100%;
|
|
40
|
+
inset-inline-start: 0;
|
|
39
41
|
z-index: 5;
|
|
40
42
|
display: none;
|
|
41
43
|
max-width: 100%;
|
|
42
44
|
padding: var(--tooltip-padding-y) var(--tooltip-padding-x);
|
|
43
45
|
margin-top: .1rem;
|
|
44
46
|
color: var(--#{$theme}-contrast);
|
|
45
|
-
text-align:
|
|
47
|
+
text-align: start;
|
|
48
|
+
overflow-wrap: anywhere;
|
|
46
49
|
background-color: var(--#{$theme}-bg);
|
|
47
50
|
opacity: 1;
|
|
48
51
|
@include border-radius(var(--tooltip-border-radius));
|
|
@@ -62,7 +65,8 @@ $validation-states: defaults(
|
|
|
62
65
|
@include form-validation-state-selector($state) {
|
|
63
66
|
--control-border-color: var(--#{$theme}-border);
|
|
64
67
|
|
|
65
|
-
&:focus-visible
|
|
68
|
+
&:focus-visible,
|
|
69
|
+
&.form-adorn:focus-within {
|
|
66
70
|
@include focus-ring(true, $color: var(--#{$theme}-focus-ring));
|
|
67
71
|
--control-border-color: var(--#{$theme}-border);
|
|
68
72
|
}
|
|
@@ -201,9 +205,9 @@ $validation-states: defaults(
|
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
207
|
|
|
204
|
-
//
|
|
208
|
+
// Combobox — wrapper has the visible border; the .form-ghost inside
|
|
205
209
|
// receives the native pseudo-class.
|
|
206
|
-
.
|
|
210
|
+
.combobox-control:has(.form-ghost.is-#{$state}) {
|
|
207
211
|
border-color: var(--#{$theme}-border);
|
|
208
212
|
|
|
209
213
|
&:focus-within {
|
|
@@ -216,7 +220,7 @@ $validation-states: defaults(
|
|
|
216
220
|
}
|
|
217
221
|
|
|
218
222
|
@if $state == "invalid" {
|
|
219
|
-
[data-bs-validate] .
|
|
223
|
+
[data-bs-validate] .combobox-control:has(.form-ghost:user-invalid) {
|
|
220
224
|
border-color: var(--#{$theme}-border);
|
|
221
225
|
|
|
222
226
|
&:focus-within {
|
|
@@ -228,7 +232,7 @@ $validation-states: defaults(
|
|
|
228
232
|
~ .invalid-tooltip { display: block; }
|
|
229
233
|
}
|
|
230
234
|
} @else if $state == "valid" {
|
|
231
|
-
[data-bs-validate~="valid"] .
|
|
235
|
+
[data-bs-validate~="valid"] .combobox-control:has(.form-ghost:user-valid) {
|
|
232
236
|
border-color: var(--#{$theme}-border);
|
|
233
237
|
|
|
234
238
|
&:focus-within {
|
|
@@ -285,6 +289,8 @@ $validation-states: defaults(
|
|
|
285
289
|
// the .form-range wrapper, so we use :has() to toggle it.
|
|
286
290
|
.form-range-input {
|
|
287
291
|
@include form-validation-state-selector($state) {
|
|
292
|
+
--range-track-fill-bg: var(--#{$theme}-bg);
|
|
293
|
+
|
|
288
294
|
&::-webkit-slider-thumb { background: var(--#{$theme}-bg); }
|
|
289
295
|
&::-moz-range-thumb { background: var(--#{$theme}-bg); }
|
|
290
296
|
|
|
@@ -323,6 +329,24 @@ $validation-states: defaults(
|
|
|
323
329
|
}
|
|
324
330
|
}
|
|
325
331
|
|
|
332
|
+
// Floating label feedback follows the wrapper that contains the control.
|
|
333
|
+
.form-floating:has(> :where(.form-control).is-#{$state}) {
|
|
334
|
+
~ .#{$state}-feedback,
|
|
335
|
+
~ .#{$state}-tooltip { display: block; }
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
@if $state == "invalid" {
|
|
339
|
+
[data-bs-validate] .form-floating:has(> :where(.form-control):user-invalid) {
|
|
340
|
+
~ .invalid-feedback,
|
|
341
|
+
~ .invalid-tooltip { display: block; }
|
|
342
|
+
}
|
|
343
|
+
} @else if $state == "valid" {
|
|
344
|
+
[data-bs-validate~="valid"] .form-floating:has(> :where(.form-control):user-valid) {
|
|
345
|
+
~ .valid-feedback,
|
|
346
|
+
~ .valid-tooltip { display: block; }
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
326
350
|
.input-group {
|
|
327
351
|
> .form-control:not(:focus),
|
|
328
352
|
> .form-floating:not(:focus-within) {
|
package/scss/forms/index.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/scss/helpers/_vr.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "../mixins/forced-colors" as *;
|
|
2
|
+
|
|
1
3
|
@layer helpers {
|
|
2
4
|
.vr {
|
|
3
5
|
display: inline-block;
|
|
@@ -5,5 +7,10 @@
|
|
|
5
7
|
width: var(--vr-border-width, var(--border-width));
|
|
6
8
|
min-height: 1em;
|
|
7
9
|
background-color: var(--border-color);
|
|
10
|
+
|
|
11
|
+
// Forced colors mode removes the background color. Show the rule with an outline.
|
|
12
|
+
@include forced-colors() {
|
|
13
|
+
outline: 1px solid transparent;
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
16
|
}
|
package/scss/helpers/index.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/scss/layout/_grid.scss
CHANGED
package/scss/layout/index.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@use "../config" as *;
|
|
2
|
+
|
|
3
|
+
// Wrap styles for forced colors mode, such as Windows high contrast themes.
|
|
4
|
+
// The browser then replaces author colors with system colors. Set
|
|
5
|
+
// `$enable-forced-colors: false` to remove these styles from the build.
|
|
6
|
+
// scss-docs-start mixin-forced-colors
|
|
7
|
+
@mixin forced-colors {
|
|
8
|
+
@if $enable-forced-colors {
|
|
9
|
+
@media (forced-colors: active) {
|
|
10
|
+
@content;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
// scss-docs-end mixin-forced-colors
|
|
File without changes
|
|
File without changes
|