Skip to content

Commit

Permalink
Adding in support for longer label text
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Culpepper committed Mar 12, 2020
1 parent a173ba8 commit 2d00190
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions float-labels.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
pure-css-float-labels v1.5
pure-css-float-labels v1.6
by Adam Culpepper | @adamculpepper
https://github.com/adamculpepper/pure-css-float-labels
*/
Expand All @@ -8,12 +8,16 @@ https://github.com/adamculpepper/pure-css-float-labels
.has-float-label label {
opacity:0.70;
position:absolute;
left:0.85rem;
top:0.20rem;
width:100%;
font-size:0.75rem;
transition:all 0.30s;
color:blue;
margin-bottom:0;
padding-left:0.85rem;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
cursor:text;
pointer-events:none;
-webkit-touch-callout:none; /* iOS Safari */
Expand All @@ -28,22 +32,17 @@ https://github.com/adamculpepper/pure-css-float-labels

/* :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;}
.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[selected]:read-only,
.has-float-label select.form-control option[selected][disabled] {display:none;}
.has-float-label select.form-control option[disabled] {opacity:0.5!important; color:red;}


[disabled]:hover {cursor:not-allowed;}

.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 2d00190

Please sign in to comment.