From d4b86fd0f8345a705abc8bb4121c34083eb4b3cb Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 23 Oct 2019 12:05:08 +0200 Subject: [PATCH] Style select element --- src/sass/inputs.scss | 13 ++++++++++++- src/views/renderutils.nim | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sass/inputs.scss b/src/sass/inputs.scss index 0cf372d..a06343f 100644 --- a/src/sass/inputs.scss +++ b/src/sass/inputs.scss @@ -13,7 +13,8 @@ button { } input[type="text"], -input[type="date"] { +input[type="date"], +select { @include input-colors; background-color: var(--bg_elements); padding: 1px 4px; @@ -143,6 +144,16 @@ input::-webkit-datetime-edit-year-field:focus { padding-right: 135px; } + select { + position: absolute; + top: 0; + right: 0; + display: block; + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; + } + input[type="text"] { position: absolute; right: 0; diff --git a/src/views/renderutils.nim b/src/views/renderutils.nim index 7612acb..dc2194a 100644 --- a/src/views/renderutils.nim +++ b/src/views/renderutils.nim @@ -71,7 +71,7 @@ proc genInput*(pref, label, state, placeholder: string; class=""; autofocus=fals verbatim &"" proc genSelect*(pref, label, state: string; options: seq[string]): VNode = - buildHtml(tdiv(class="pref-group")): + buildHtml(tdiv(class="pref-group pref-input")): label(`for`=pref): text label select(name=pref): for opt in options: