Skip to content

Commit 51c00db

Browse files
committed
refactor: input counter styles
1 parent 50b65c9 commit 51c00db

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

source/_patterns/01-elements/_form-elements.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,22 @@
115115
%form-element-counter {
116116
&:has(+ .description) {
117117
float: right;
118+
119+
@supports (inset-area: block-end span-inline-start) {
120+
&:not(:has(+ .description)) {
121+
position: absolute;
122+
// stylelint-disable-next-line property-no-unknown
123+
inset-area: block-end span-inline-start;
124+
}
125+
}
118126
}
119127

120-
&:not(:has(+ .description)) {
121-
position: absolute;
122-
// stylelint-disable-next-line property-no-unknown
123-
inset-area: block-end span-inline-start;
128+
@supports (inset-area: block-end span-inline-start) {
129+
&:not(:has(+ .description)) {
130+
position: absolute;
131+
// stylelint-disable-next-line property-no-unknown
132+
inset-area: block-end span-inline-start;
133+
}
124134
}
125135

126136
// Description styles

source/_patterns/01-elements/input/input.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@
146146
@extend %form-element-validation;
147147
@extend %form-element-validation-programmatic;
148148
/* stylelint-enable order/order */
149+
}
149150

150-
&:is(
151-
[type="email"],
152-
[type="password"],
153-
[type="search"],
154-
[type="tel"],
155-
[type="text"],
156-
[type="url"]
157-
)
158-
+ label
159-
+ output {
160-
@extend %form-element-counter;
161-
}
151+
&:is(
152+
[type="email"],
153+
[type="password"],
154+
[type="search"],
155+
[type="tel"],
156+
[type="text"],
157+
[type="url"]
158+
)
159+
+ label
160+
+ output {
161+
@extend %form-element-counter;
162162
}
163163

164164
&[type="search"] {

source/_patterns/01-elements/textarea/textarea.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363

6464
& + output {
6565
@extend %form-element-counter;
66-
67-
float: right;
6866
}
6967

7068
// ### Style variations

0 commit comments

Comments
 (0)