Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix border radius for small progress bar #2618

Merged
merged 1 commit into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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