Skip to content

Commit

Permalink
Adding in better disabled and read-only support
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Culpepper committed Mar 11, 2020
1 parent d324975 commit 9fbf512
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions float-labels.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
pure-css-float-labels v1.4
pure-css-float-labels v1.5
by Adam Culpepper | @adamculpepper
https://github.com/adamculpepper/pure-css-float-labels
*/
Expand All @@ -24,21 +24,21 @@ https://github.com/adamculpepper/pure-css-float-labels
user-select:none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
}
.has-float-label .form-control {padding-top:15px; padding-bottom:0;}
.has-float-label .form-control:placeholder-shown:not(:focus) + label {
opacity:0.50;
top:50%;
transform:translateY(-50%);
font-size:1rem;
color:inherit;
}
.has-float-label .form-control:placeholder-shown:not(:focus) + label {opacity:0.50; top:50%; transform:translateY(-50%); font-size:1rem; color:inherit;}

/* :disabled and :readonly styles */
.has-float-label .form-control:read-only,
.has-float-label .form-control:disabled,
.has-float-label .form-control:disabled + label {opacity:0.5;}

/* Textarea elements*/
.has-float-label textarea.form-control:placeholder-shown:not(:focus) + label {top:1.5rem;}

/* Select elements*/
.has-float-label select.form-control {padding-left:0.50rem;}
.has-float-label select.form-control:placeholder-shown:not(:focus) + label {top:1.5rem;}
.has-float-label select.form-control option[value=""][disabled] {display:none;}
.has-float-label select.form-control option[value=""]:read-only,
.has-float-label select.form-control option[value=""]:disabled {display:none;}

/* Hide placeholders since we're taking care of those with label elements */
.has-float-label ::-webkit-input-placeholder {color:transparent!important;}
Expand Down

0 comments on commit 9fbf512

Please sign in to comment.