Skip to content

Commit

Permalink
Merge pull request #2618 from nextcloud/fix/noid/progress-bar-small
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Apr 8, 2022
2 parents ca47225 + 9bf1fe5 commit 46810c0
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions src/components/ProgressBar/ProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This is a simple progress bar component.
<template>
<progress class="progress-bar vue"
:class="{ 'progress-bar--error': error }"
:style="progressBarStyle"
:style="{'--progress-bar-height': height }"
:value="value"
max="100" />
</template>
Expand Down Expand Up @@ -87,21 +87,11 @@ export default {
},
},
computed: {
progressBarStyle() {
let height = 0
let borderRadius = 0
height() {
if (this.size === 'small') {
height = '4px'
borderRadius = '2px'
} else if (this.size === 'medium') {
height = '6px'
borderRadius = '3px'
}
return {
height,
'border-radius': borderRadius,
return '4px'
}
return '6px'
},
},
}
Expand All @@ -116,16 +106,18 @@ export default {
background: var(--color-background-dark);
border: 0;
padding: 0;
border-radius: var(--border-radius);
height: var(--progress-bar-height);
border-radius: calc(var(--progress-bar-height) / 2);
&::-webkit-progress-bar {
height: calc(var(--border-radius) * 2);
height: var(--progress-bar-height);
}
&::-webkit-progress-value {
background: linear-gradient(40deg, var(--color-primary-element) 0%, var(--color-primary-element-light) 100%);
border-radius: var(--border-radius);
border-radius: calc(var(--progress-bar-height) / 2);
}
&::-moz-progress-bar {
background: linear-gradient(40deg, var(--color-primary-element) 0%, var(--color-primary-element-light) 100%);
border-radius: calc(var(--progress-bar-height) / 2);
}
&--error {
// Override previous values
Expand Down

0 comments on commit 46810c0

Please sign in to comment.