Skip to content

Commit 9c320df

Browse files
authored
Floating labels improvements (#30966)
* docs(example): floating-labels' better Edge fallback * docs(example): refactor floating-labels' CSS
1 parent 02ff387 commit 9c320df

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

site/content/docs/5.0/examples/floating-labels/floating-labels.css

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ body {
2323
margin-bottom: 1rem;
2424
}
2525

26-
.form-label-group > input,
27-
.form-label-group > label {
26+
.form-label-group input,
27+
.form-label-group label {
2828
height: 3.125rem;
2929
padding: .75rem;
3030
}
3131

32-
.form-label-group > label {
32+
.form-label-group label {
3333
position: absolute;
3434
top: 0;
3535
left: 0;
@@ -47,11 +47,11 @@ body {
4747
color: transparent;
4848
}
4949

50-
.form-label-group input::-ms-input-placeholder {
50+
.form-label-group input::-moz-placeholder {
5151
color: transparent;
5252
}
5353

54-
.form-label-group input::-moz-placeholder {
54+
.form-label-group input::-ms-input-placeholder {
5555
color: transparent;
5656
}
5757

@@ -86,9 +86,15 @@ body {
8686
/* Fallback for Edge
8787
-------------------------------------------------- */
8888
@supports (-ms-ime-align: auto) {
89-
.form-label-group > label {
90-
display: none;
89+
.form-label-group {
90+
display: flex;
91+
flex-direction: column-reverse;
9192
}
93+
94+
.form-label-group label {
95+
position: static;
96+
}
97+
9298
.form-label-group input::-ms-input-placeholder {
9399
color: #777;
94100
}

0 commit comments

Comments
 (0)