-
-
-
-
+
-
+
+
+
+
+
@@ -1747,14 +1760,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1782,7 +1838,7 @@
-
+
diff --git a/src/styles/_forms.sass b/src/styles/_forms.sass
index 5334ca0..967463b 100644
--- a/src/styles/_forms.sass
+++ b/src/styles/_forms.sass
@@ -1,3 +1,4 @@
+// TODO: refactor and organize styles
.form
+list-unstyled
+inputs-generic
@@ -12,7 +13,6 @@
.input-group-addon
border-color: var(--color-danger)
-
.form-text, .helptext
color: var(--color-text-secondary)
font-size: var(--fs-sm)
@@ -26,6 +26,17 @@
&:focus
border-color: var(--color-accent)
+ // TODO: check if using form-control with checkbox and radio is a real use case
+ &[type="checkbox"],
+ &[type="radio"]
+ height: var(--spacer)
+ min-height: 0
+ width: auto
+
+ &[type="checkbox"]
+ &:hover
+ cursor: pointer
+
&[type="file"]
padding: 0
@@ -62,25 +73,29 @@ input,
background-color: var(--input-color-bg)
color: var(--color-text)
- height: calc(var(--spacer) * 2.5)
+ min-height: calc(var(--spacer) * 2.5)
+padding(3, x)
+padding(2, y)
+media-sm
- height: var(--spacer-5)
+ min-height: var(--spacer-5)
&:disabled
--input-color-bg-hover: var(--input-color-bg)
+ background-color: var(--input-color-bg)
cursor: not-allowed
+ &::placeholder
+ color: var(--color-text-tertiary)
+
&:focus,
&:hover
background-color: var(--input-color-bg-hover)
color: var(--color-text)
&::placeholder
- color: var(--color-text-tertiary)
+ color: var(--color-text-secondary)
// Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
opacity: 1
@@ -107,14 +122,16 @@ label sup,
text-decoration: underline
.form-group
- align-items: center
- display: flex
- justify-content: end
position: relative
.form-group-addon
position: absolute
right: var(--spacer-2)
+ top: var(--spacer-2)
+
+ &:has([type="checkbox"]),
+ &:has([type="radio"])
+ justify-content: start
.toggle-bar
border: var(--border-width) solid var(--border-color)
@@ -177,3 +194,150 @@ label sup,
left: .2rem
height: 1.2rem
width: 1.2rem
+select
+ &.form-control
+ &:hover
+ cursor: pointer
+
+// Checkboxes and radios Bootstrap overrides
+// TODO: remove overrides when cleaning up Bootstrap deprecated partials
+.form-check,
+.form-check-input
+ position: static
+
+.form-check
+ line-height: var(--lh-sm)
+ +padding(0, left)
+
+.form-check-input
+ +margin(0, left)
+ +margin(1, right)
+ +margin(0, top)
+
+.form-check-label
+ +fw-normal
+
+ &:hover
+ cursor: pointer
+
+[type="checkbox"],
+[type="radio"]
+ height: var(--spacer)
+ min-height: 0
+ width: auto
+
+[type="checkbox"]
+ &:hover
+ cursor: pointer
+
+.form-check-custom
+ cursor: pointer
+ display: block
+ +fw-normal
+ +margin(3, bottom)
+ padding-left: calc(var(--spacer) * 2)
+ position: relative
+
+ input
+ height: 0
+ opacity: 0
+ width: 0
+
+ .form-check-custom-mark
+ background-color: var(--input-color-bg)
+ border: var(--border-width) solid var(--border-color)
+ height: var(--spacer-4)
+ left: 0
+ position: absolute
+ top: 0
+ transition: background-color var(--transition-speed)
+ width: var(--spacer-4)
+
+ &:after
+ content: ""
+ display: none
+ position: absolute
+
+ &:hover input ~ .form-check-custom-mark
+ background-color: var(--input-color-bg-hover)
+
+ input:checked ~ .form-check-custom-mark
+ background-color: var(--color-accent)
+
+ &:after
+ display: block
+
+ .form-check-custom-mark:after
+ border: solid white
+ border-width: 0 .2rem .2rem 0
+ display: none
+ height: 1.0rem
+ left: .8rem
+ top: .4rem
+ transform: rotate(45deg)
+ width: .6rem
+
+.form-check-custom-radio
+ .form-check-custom-mark
+ border-radius: 50%
+
+ &:after
+ background: white
+ border: 0
+ border-radius: 50%
+ height: var(--spacer-2)
+ left: .6rem
+ top: .6rem
+ width: var(--spacer-2)
+
+.slider-custom
+ background: var(--color-text-tertiary)
+ border: var(--border-width) solid var(--border-color)
+ border-radius: 1.2rem
+ height: var(--spacer-4)
+ min-height: 0
+ outline: none
+ +padding(1, x)
+ transition: opacity var(--transition-speed-slow)
+ -webkit-appearance: none
+ -webkit-transition: var(--transition-speed-slow)
+ width: 100%
+
+ &:active,
+ &:focus
+ background-color: var(--color-text-tertiary)
+
+ &:hover
+ background-color: var(--color-text-secondary)
+
+ &::-moz-range-thumb
+ background: white
+ border-radius: 50%
+ cursor: pointer
+ height: var(--spacer)
+ width: var(--spacer)
+
+ &::-webkit-slider-thumb
+ appearance: none
+ background: white
+ border-radius: 50%
+ cursor: pointer
+ height: var(--spacer)
+ -webkit-appearance: none
+ width: var(--spacer)
+
+.slider-custom-steps
+ display: flex
+ justify-content: space-between
+ padding-left: 1.6rem
+ padding-right: 1.2rem
+
+.slider-custom-steps-item
+ background-color: var(--color-text-tertiary)
+ height: var(--spacer-1)
+ transform: translateX(-.1rem)
+ width: .2rem
+
+.slider-custom-steps-item-dots
+ border-radius: 50%
+ width: var(--spacer-1)
diff --git a/src/styles/_variables.sass b/src/styles/_variables.sass
index 0b31872..243a99e 100644
--- a/src/styles/_variables.sass
+++ b/src/styles/_variables.sass
@@ -287,9 +287,11 @@ html[data-theme="dark"]
/* Config. */
$font-path: '../assets/fonts' !default
+// TODO: change and simplify Sass variables to CSS custom properties
$input-box-shadow: none
$input-border-color: rgba(black, .1)
$input-border-width: .2rem
+$input-transition: background-color var(--transition-speed-slow) var(--transition-timing-fast), border-color var(--transition-speed-slow) var(--transition-timing-fast), box-shadow var(--transition-speed-slow) var(--transition-timing-fast)
$label-margin-bottom: .2rem