Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Make filled OcButton use gradient background
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Mar 21, 2022
1 parent 7d94f74 commit e94ca38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-primary-button-gradient
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Make filled primary OcButton use gradient background

We've updated the OcButton to use the gradient background color when used in its `filled` appearance.

https://github.com/owncloud/owncloud-design-system/issues/1952
https://github.com/owncloud/owncloud-design-system/pull/2036
20 changes: 6 additions & 14 deletions src/components/atoms/OcButton/OcButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,26 +130,15 @@ export default {
},
computed: {
$_ocButton_buttonClass() {
const classes = [
return [
"oc-button",
"oc-rounded",
`oc-button-${getSizeClass(this.size)}`,
`oc-button-justify-content-${this.justifyContent}`,
`oc-button-gap-${getSizeClass(this.gapSize)}`,
`oc-button-${this.variation}`,
`oc-button-${this.variation}-${this.appearance}`,
]
classes.push(`oc-button-${this.variation}`)
switch (this.appearance) {
case "raw":
classes.push(`oc-button-${this.variation}-raw`)
break
case "outline":
classes.push(`oc-button-${this.variation}-outline`)
break
}
return classes
},
additionalAttributes() {
Expand Down Expand Up @@ -358,6 +347,9 @@ export default {
var(--oc-color-swatch-primary-hover),
var(--oc-color-swatch-primary-muted)
);
&-filled {
@extend .oc-background-primary-gradient;
}
}
&-success {
Expand Down
2 changes: 1 addition & 1 deletion src/styles/theme/background.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
border-color:
linear-gradient(90deg,
var(--oc-color-swatch-primary-muted) 0%,
var(--oc-color-swatch-primary-gradient) 100%);
var(--oc-color-swatch-primary-gradient) 100%) !important;
}
/* stylelint-enable */

Expand Down

0 comments on commit e94ca38

Please sign in to comment.