bulma/sass/elements/progress.sass

80 lines
2.7 KiB
Sass
Raw Normal View History

2020-08-15 23:40:51 +00:00
$progress-height: var(--size-normal, #{$size-normal}) !default
$progress-bar-background-color: var(--border-light, #{$border-light}) !default
$progress-value-background-color: var(--text, #{$text}) !default
$progress-border-radius: var(--radius-rounded, #{$radius-rounded}) !default
2017-07-28 20:05:15 +00:00
2018-10-28 14:45:28 +00:00
$progress-indeterminate-duration: 1.5s !default
$progress-colors: $colors !default
2016-03-26 16:46:15 +00:00
.progress
2020-08-15 23:40:51 +00:00
--progress-border-radius: #{$progress-border-radius}
--progress-bar-background-color: #{$progress-bar-background-color}
--progress-height: #{$progress-height}
--progress-value-background-color: #{$progress-value-background-color}
--progress-indeterminate-duration: #{$progress-indeterminate-duration}
2018-09-04 13:24:50 +00:00
@extend %block
2016-03-26 16:46:15 +00:00
-moz-appearance: none
-webkit-appearance: none
border: none
2020-08-15 23:40:51 +00:00
border-radius: var(--progress-border-radius)
2016-03-26 16:46:15 +00:00
display: block
2020-08-15 23:40:51 +00:00
height: var(--progress-height)
2016-03-26 16:46:15 +00:00
overflow: hidden
padding: 0
width: 100%
&::-webkit-progress-bar
2020-08-15 23:40:51 +00:00
background-color: var(--progress-bar-background-color)
&::-webkit-progress-value
2020-08-15 23:40:51 +00:00
background-color: var(--progress-value-background-color)
2016-03-26 16:46:15 +00:00
&::-moz-progress-bar
2020-08-15 23:40:51 +00:00
background-color: var(--progress-value-background-color)
2017-10-19 06:43:57 +00:00
&::-ms-fill
2020-08-15 23:40:51 +00:00
background-color: var(--progress-value-background-color)
border: none
// Colors
@each $name, $pair in $progress-colors
$color: nth($pair, 1)
&.is-#{$name}
&::-webkit-progress-value
2020-08-15 23:40:51 +00:00
--progress-value-background-color: var(--#{$name}, #{$color})
&::-moz-progress-bar
2020-08-15 23:40:51 +00:00
--progress-value-background-color: var(--#{$name}, #{$color})
&::-ms-fill
2020-08-15 23:40:51 +00:00
--progress-value-background-color: var(--#{$name}, #{$color})
&:indeterminate
2020-08-15 23:40:51 +00:00
background-image: linear-gradient(to right, var(--#{$name}, #{$color}) 30%, var(--progress-bar-background-color) 30%)
2018-10-28 14:45:28 +00:00
&:indeterminate
2020-08-15 23:40:51 +00:00
animation-duration: var(--progress-indeterminate-duration)
2018-10-28 14:45:28 +00:00
animation-iteration-count: infinite
animation-name: moveIndeterminate
animation-timing-function: linear
2020-08-15 23:40:51 +00:00
background-color: var(--progress-bar-background-color)
background-image: linear-gradient(to right, var(--text, #{$text}) 30%, var(--progress-bar-background-color) 30%)
2018-10-28 14:45:28 +00:00
background-position: top left
background-repeat: no-repeat
background-size: 150% 150%
&::-webkit-progress-bar
background-color: transparent
&::-moz-progress-bar
background-color: transparent
&::-ms-fill
animation-name: none
2018-10-08 01:32:48 +00:00
2016-04-10 15:00:32 +00:00
// Sizes
&.is-small
2020-08-15 23:40:51 +00:00
--progress-height: var(--size-small, #{$size-small})
2016-04-10 15:00:32 +00:00
&.is-medium
2020-08-15 23:40:51 +00:00
--progress-height: var(--size-medium, #{$size-medium})
2016-04-10 15:00:32 +00:00
&.is-large
2020-08-15 23:40:51 +00:00
--progress-height: var(--size-large, #{$size-large})
2018-10-08 01:32:48 +00:00
2018-10-28 14:45:28 +00:00
@keyframes moveIndeterminate
from
2018-10-08 01:32:48 +00:00
background-position: 200% 0
2018-10-28 14:45:28 +00:00
to
2018-10-08 01:32:48 +00:00
background-position: -200% 0