mirror of
https://github.com/jgthms/bulma.git
synced 2025-01-09 15:44:25 +00:00
Add fallback values for input and control CSS variables
This commit is contained in:
parent
d79c6dbc3c
commit
42815a783d
@ -7,7 +7,7 @@ $textarea-min-height: 8em !default
|
|||||||
--input-focus-box-shadow-size: #{$input-focus-box-shadow-size}
|
--input-focus-box-shadow-size: #{$input-focus-box-shadow-size}
|
||||||
|
|
||||||
@extend %input
|
@extend %input
|
||||||
box-shadow: var(--input-shadow)
|
box-shadow: var(--input-shadow, #{$input-shadow})
|
||||||
max-width: 100%
|
max-width: 100%
|
||||||
width: 100%
|
width: 100%
|
||||||
&[readonly]
|
&[readonly]
|
||||||
@ -16,12 +16,12 @@ $textarea-min-height: 8em !default
|
|||||||
@each $name, $pair in $colors
|
@each $name, $pair in $colors
|
||||||
$color: nth($pair, 1)
|
$color: nth($pair, 1)
|
||||||
&.is-#{$name}
|
&.is-#{$name}
|
||||||
border-color: $color
|
border-color: var(--#{$name}, #{$color})
|
||||||
&:focus,
|
&:focus,
|
||||||
&.is-focused,
|
&.is-focused,
|
||||||
&:active,
|
&:active,
|
||||||
&.is-active
|
&.is-active
|
||||||
box-shadow: var(--input-focus-box-shadow-size) bulmaRgba($color, 0.25)
|
box-shadow: var(--input-focus-box-shadow-size, #{$input-focus-box-shadow-size}) bulmaRgba($color, 0.25)
|
||||||
// Sizes
|
// Sizes
|
||||||
&.is-small
|
&.is-small
|
||||||
+control-small
|
+control-small
|
||||||
|
@ -28,29 +28,29 @@ $input-radius: var(--radius, #{$radius}) !default
|
|||||||
|
|
||||||
=input
|
=input
|
||||||
@extend %control
|
@extend %control
|
||||||
background-color: var(--input-background-color)
|
background-color: var(--input-background-color, #{$input-background-color})
|
||||||
border-color: var(--input-border-color)
|
border-color: var(--input-border-color, #{$input-border-color})
|
||||||
border-radius: var(--input-radius)
|
border-radius: var(--input-radius, #{$input-radius})
|
||||||
color: var(--input-color)
|
color: var(--input-color, #{$input-color})
|
||||||
+placeholder
|
+placeholder
|
||||||
color: var(--input-placeholder-color)
|
color: var(--input-placeholder-color, #{$input-placeholder-color})
|
||||||
&:hover,
|
&:hover,
|
||||||
&.is-hovered
|
&.is-hovered
|
||||||
border-color: var(--input-hover-border-color)
|
border-color: var(--input-hover-border-color, #{$input-hover-border-color})
|
||||||
&:focus,
|
&:focus,
|
||||||
&.is-focused,
|
&.is-focused,
|
||||||
&:active,
|
&:active,
|
||||||
&.is-active
|
&.is-active
|
||||||
border-color: var(--input-focus-border-color)
|
border-color: var(--input-focus-border-color, #{$input-focus-border-color})
|
||||||
box-shadow: var(--input-focus-box-shadow-size) var(--input-focus-box-shadow-color)
|
box-shadow: var(--input-focus-box-shadow-size, #{$input-focus-box-shadow-size}) var(--input-focus-box-shadow-color, #{$input-focus-box-shadow-color})
|
||||||
&[disabled],
|
&[disabled],
|
||||||
fieldset[disabled] &
|
fieldset[disabled] &
|
||||||
background-color: var(--input-disabled-background-color)
|
background-color: var(--input-disabled-background-color, #{$input-disabled-background-color})
|
||||||
border-color: var(--input-disabled-border-color)
|
border-color: var(--input-disabled-border-color, #{$input-disabled-border-color})
|
||||||
box-shadow: none
|
box-shadow: none
|
||||||
color: var(--input-disabled-color)
|
color: var(--input-disabled-color, #{$input-disabled-color})
|
||||||
+placeholder
|
+placeholder
|
||||||
color: var(--input-disabled-placeholder-color)
|
color: var(--input-disabled-placeholder-color, #{$input-disabled-placeholder-color})
|
||||||
|
|
||||||
%input
|
%input
|
||||||
+input
|
+input
|
||||||
|
@ -34,7 +34,7 @@ $control-font-size: var(--size-normal, #{$size-normal}) !default
|
|||||||
@each $name, $pair in $colors
|
@each $name, $pair in $colors
|
||||||
$color: nth($pair, 1)
|
$color: nth($pair, 1)
|
||||||
&.is-#{$name}
|
&.is-#{$name}
|
||||||
color: $color
|
color: var(--#{$name}, #{$color})
|
||||||
|
|
||||||
// Containers
|
// Containers
|
||||||
|
|
||||||
@ -168,11 +168,9 @@ $control-font-size: var(--size-normal, #{$size-normal}) !default
|
|||||||
+ltr-property("margin", 0.75rem)
|
+ltr-property("margin", 0.75rem)
|
||||||
|
|
||||||
.control
|
.control
|
||||||
--control-font-size: #{$control-font-size}
|
|
||||||
|
|
||||||
box-sizing: border-box
|
box-sizing: border-box
|
||||||
clear: both
|
clear: both
|
||||||
font-size: var(--control-font-size)
|
font-size: var(--control-font-size, #{$control-font-size})
|
||||||
position: relative
|
position: relative
|
||||||
text-align: inherit
|
text-align: inherit
|
||||||
// Modifiers
|
// Modifiers
|
||||||
@ -182,7 +180,7 @@ $control-font-size: var(--size-normal, #{$size-normal}) !default
|
|||||||
.select
|
.select
|
||||||
&:focus
|
&:focus
|
||||||
& ~ .icon
|
& ~ .icon
|
||||||
color: var(--input-icon-active-color)
|
color: var(--input-icon-active-color, #{$input-icon-active-color})
|
||||||
&.is-small ~ .icon
|
&.is-small ~ .icon
|
||||||
font-size: var(--size-small, #{$size-small})
|
font-size: var(--size-small, #{$size-small})
|
||||||
&.is-medium ~ .icon
|
&.is-medium ~ .icon
|
||||||
@ -190,23 +188,23 @@ $control-font-size: var(--size-normal, #{$size-normal}) !default
|
|||||||
&.is-large ~ .icon
|
&.is-large ~ .icon
|
||||||
font-size: var(--size-large, #{$size-large})
|
font-size: var(--size-large, #{$size-large})
|
||||||
.icon
|
.icon
|
||||||
color: var(--input-icon-color)
|
color: var(--input-icon-color, #{$input-icon-color})
|
||||||
height: var(--input-height)
|
height: var(--input-height, #{$input-height})
|
||||||
pointer-events: none
|
pointer-events: none
|
||||||
position: absolute
|
position: absolute
|
||||||
top: 0
|
top: 0
|
||||||
width: var(--input-height)
|
width: var(--input-height, #{$input-height})
|
||||||
z-index: 4
|
z-index: 4
|
||||||
&.has-icons-left
|
&.has-icons-left
|
||||||
.input,
|
.input,
|
||||||
.select select
|
.select select
|
||||||
padding-left: var(--input-height)
|
padding-left: var(--input-height, #{$input-height})
|
||||||
.icon.is-left
|
.icon.is-left
|
||||||
left: 0
|
left: 0
|
||||||
&.has-icons-right
|
&.has-icons-right
|
||||||
.input,
|
.input,
|
||||||
.select select
|
.select select
|
||||||
padding-right: var(--input-height)
|
padding-right: var(--input-height, #{$input-height})
|
||||||
.icon.is-right
|
.icon.is-right
|
||||||
right: 0
|
right: 0
|
||||||
&.is-loading
|
&.is-loading
|
||||||
|
@ -120,6 +120,7 @@
|
|||||||
--size-medium: #{$size-medium}
|
--size-medium: #{$size-medium}
|
||||||
--size-large: #{$size-large}
|
--size-large: #{$size-large}
|
||||||
// Controls
|
// Controls
|
||||||
|
--control-font-size: #{$control-font-size}
|
||||||
--control-radius: #{$control-radius}
|
--control-radius: #{$control-radius}
|
||||||
--control-radius-small: #{$control-radius-small}
|
--control-radius-small: #{$control-radius-small}
|
||||||
--control-border-width: #{$control-border-width}
|
--control-border-width: #{$control-border-width}
|
||||||
|
Loading…
Reference in New Issue
Block a user