Skip to content

Commit

Permalink
Added indeterminate progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerquix18 authored and jgthms committed Oct 28, 2018
1 parent 4d2e608 commit 61899e3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/documentation/elements/progress.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
<progress class="progress is-large" value="60" max="100">60%</progress>
{% endcapture %}

{% capture progress_indeterminate %}
<progress class="progress is-small is-primary" max="100">15%</progress>
<progress class="progress is-danger" max="100">30%</progress>
<progress class="progress is-medium is-dark" max="100">45%</progress>
<progress class="progress is-large is-info" max="100">60%</progress>
{% endcapture %}

{% include elements/snippet.html content=progress %}

{% include elements/anchor.html name="Colors" %}
Expand All @@ -44,4 +51,8 @@

{% include elements/snippet.html content=progress_sizes %}

{% include elements/anchor.html name="Indeterminate" %}

{% include elements/snippet.html content=progress_indeterminate %}

{% include elements/variables.html type='element' %}
21 changes: 21 additions & 0 deletions sass/elements/progress.sass
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,31 @@ $progress-value-background-color: $text !default
background-color: $color
&::-ms-fill
background-color: $color

&:indeterminate
&::-webkit-progress-bar
background-color: transparent
&::-moz-progress-bar
background-color: transparent

animation: progress-indeterminate 1.5s linear infinite
background: $progress-bar-background-color linear-gradient(to right, $text 30%, $progress-bar-background-color 30%) top left / 150% 150% no-repeat

@each $name, $pair in $colors
$color: nth($pair, 1)
&.is-#{$name}
background: $progress-bar-background-color linear-gradient(to right, $color 30%, $progress-bar-background-color 30%) top left / 150% 150% no-repeat

// Sizes
&.is-small
height: $size-small
&.is-medium
height: $size-medium
&.is-large
height: $size-large

@keyframes progress-indeterminate
0%
background-position: 200% 0
100%
background-position: -200% 0

0 comments on commit 61899e3

Please sign in to comment.