Skip to content

Commit c5448cf

Browse files
Fix #12: Do not require for= attribute
1 parent f039186 commit c5448cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scss/_mixins.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
@mixin float-label-container {
2+
display: block;
23
position: relative;
34
}
45

56
@mixin float-label {
6-
label {
7+
label, > span {
78
position: absolute;
89
left: 0;
910
top: 0;
@@ -26,7 +27,7 @@
2627
}
2728

2829
@mixin float-label-scaled {
29-
&:placeholder-shown:not(:focus) + label {
30+
&:placeholder-shown:not(:focus) + * {
3031
font-size: 150%;
3132
opacity: .5;
3233
@content;

scss/float-label.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
margin-bottom: 2px;
1919
border: 0;
2020
border-radius: 0;
21-
background: transparent;
2221
border-bottom: 2px solid rgba(0,0,0,.1);
2322

2423
@include float-label-scaled {
@@ -33,7 +32,7 @@
3332

3433
select {
3534
padding-right: 1em;
36-
background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0 bottom .15em;
35+
background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .5em bottom .25em;
3736
background-size: 8px 10px;
3837
}
3938
}

0 commit comments

Comments
 (0)