diff --git a/float-labels.css b/float-labels.css index e4ea58f..0d7b5f3 100644 --- a/float-labels.css +++ b/float-labels.css @@ -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 */ @@ -24,13 +24,12 @@ 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;} @@ -38,7 +37,8 @@ https://github.com/adamculpepper/pure-css-float-labels /* 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;}