From 56b34f79460fc0b289ea7878d6855e117983ad20 Mon Sep 17 00:00:00 2001 From: oliveira131 <47257731+oliveira131@users.noreply.github.com> Date: Fri, 23 Aug 2019 01:28:55 -0300 Subject: [PATCH] var for top label position --- floating-labels.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/floating-labels.css b/floating-labels.css index 085e219..537d8e1 100644 --- a/floating-labels.css +++ b/floating-labels.css @@ -2,6 +2,7 @@ --input-padding-x: .75rem; --input-padding-y: .7rem; --placeholder-color: #6c757d; + --top-position: 4px; } .form-label-group { position: relative; @@ -64,7 +65,7 @@ .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 { font-size: 1em; - top:4px; + top: var(--top-position); transform: translateY(-50%) scale(.7); visibility: visible; }