Parcourir la source

Style select element

Zed il y a 6 ans
Parent
commit
d4b86fd0f8
2 fichiers modifiés avec 13 ajouts et 2 suppressions
  1. 12 1
      src/sass/inputs.scss
  2. 1 1
      src/views/renderutils.nim

+ 12 - 1
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;

+ 1 - 1
src/views/renderutils.nim

@@ -71,7 +71,7 @@ proc genInput*(pref, label, state, placeholder: string; class=""; autofocus=fals
     verbatim &"<input name={pref} type=\"text\" placeholder=\"{p}\" value=\"{s}\" {a}/>"
 
 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: