From 9e3857ce26244ecef3d71c58095fcc93b27219fc Mon Sep 17 00:00:00 2001 From: John Leider Date: Wed, 18 Jan 2017 21:03:45 -0500 Subject: [PATCH] added contextual states to progress-linear --- src/components/progress/ProgressLinear.vue | 29 ++++++++++++++++----- src/stylus/components/_progress-linear.styl | 23 ++++++++++++---- src/stylus/tools/_mixins.styl | 3 ++- src/stylus/tools/_progress-linear.styl | 10 +++++++ 4 files changed, 52 insertions(+), 13 deletions(-) create mode 100755 src/stylus/tools/_progress-linear.styl diff --git a/src/components/progress/ProgressLinear.vue b/src/components/progress/ProgressLinear.vue index b8a81b959c8..d3bb2533aee 100755 --- a/src/components/progress/ProgressLinear.vue +++ b/src/components/progress/ProgressLinear.vue @@ -20,26 +20,36 @@ name: 'progress', props: { + active: { + type: Boolean, + default: true + }, + buffer: Boolean, bufferValue: Number, + error: Boolean, + height: { - type: Number, + type: [Number, String], default: 7 }, indeterminate: Boolean, - active: { - type: Boolean, - default: true - }, + info: Boolean, + + secondary: Boolean, + + success: Boolean, query: Boolean, + warning: Boolean, + value: { - type: Number, + type: [Number, String], default: 0 } }, @@ -47,7 +57,12 @@ computed: { classes () { return { - 'progress-linear--query': this.query + 'progress-linear--query': this.query, + 'progress-linear--secondary': this.secondary, + 'progress-linear--success': this.success, + 'progress-linear--info': this.info, + 'progress-linear--warning': this.warning, + 'progress-linear--error': this.error } }, diff --git a/src/stylus/components/_progress-linear.styl b/src/stylus/components/_progress-linear.styl index 135da6226d1..b2c8d0de32f 100755 --- a/src/stylus/components/_progress-linear.styl +++ b/src/stylus/components/_progress-linear.styl @@ -4,9 +4,9 @@ overflow: hidden width: 100% position: relative + progress-linear($theme.primary) &__bar - background: lighten($theme.accent, 40%) width: 100% height: inherit position: relative @@ -14,13 +14,11 @@ z-index: 2 &__determinate - background: $theme.primary height: inherit transition: .3s ease-in - &__indeterminate + &__indeterminate &:before, &:after - background: $theme.primary content: '' height: inherit position: absolute @@ -50,7 +48,22 @@ &:after animation: query-short animation-duration: 2s - animation-iteration-count: infinite + animation-iteration-count: infinite + + &--secondary + progress-linear($theme.secondary) + + &--success + progress-linear($theme.success) + + &--info + progress-linear($theme.info) + + &--warning + progress-linear($theme.warning) + + &--error + progress-linear($theme.error) @keyframes indeterminate 0% diff --git a/src/stylus/tools/_mixins.styl b/src/stylus/tools/_mixins.styl index 6b643636b55..8a483b2549e 100755 --- a/src/stylus/tools/_mixins.styl +++ b/src/stylus/tools/_mixins.styl @@ -1,3 +1,4 @@ @import './_alerts' @import './_colors' -@import './_lists' \ No newline at end of file +@import './_lists' +@import './_progress-linear' \ No newline at end of file diff --git a/src/stylus/tools/_progress-linear.styl b/src/stylus/tools/_progress-linear.styl new file mode 100755 index 00000000000..c61d5661003 --- /dev/null +++ b/src/stylus/tools/_progress-linear.styl @@ -0,0 +1,10 @@ +progress-linear(progress) + .progress-linear__bar + background: lighten(progress, 50%) + + .progress-linear__bar__determinate + background: progress + + .progress-linear__bar__indeterminate + &:before, &:after + background: progress \ No newline at end of file