From c3ca4ab02f09ccadc6aad3b4793b6dd2b86a21b2 Mon Sep 17 00:00:00 2001 From: oliveira131 <47257731+oliveira131@users.noreply.github.com> Date: Mon, 2 Sep 2019 04:52:41 -0300 Subject: [PATCH] simple support for select element --- floating-labels.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/floating-labels.css b/floating-labels.css index 4bf036c..2c130b1 100644 --- a/floating-labels.css +++ b/floating-labels.css @@ -15,7 +15,8 @@ .form-label-group input, .form-label-group textarea, -.form-label-group label { +.form-label-group label, +.form-label-group select { padding: var(--input-padding-y) var(--input-padding-x); } @@ -72,7 +73,11 @@ padding-bottom: calc(var(--input-padding-y) / 3); } -.form-label-group input:not(:placeholder-shown) ~ label, .form-label-group input:focus ~ label, .form-label-group textarea:not(:placeholder-shown) ~ label, .form-label-group textarea:focus ~ label { +.form-label-group select { + padding-bottom: 0; +} + +.form-label-group input:not(:placeholder-shown) ~ label, .form-label-group input:focus ~ label, .form-label-group textarea:not(:placeholder-shown) ~ label, .form-label-group textarea:focus ~ label, .form-label-group select ~ label { font-size: 1em; top: var(--top-position); transform: translateY(-50%) scale(.7);