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

[stable5] Add a button style for being used on primary like in the header #2940

Merged
merged 1 commit into from
Aug 4, 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
21 changes: 19 additions & 2 deletions src/components/Button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ export default {

/**
* Specifies the button type
* Accepted values: primary, secondary, tertiary, error, warning, success. If left empty,
* Accepted values: primary, secondary, tertiary, tertiary-no-background, tertiary-on-primary, error, warning, success. If left empty,
* the default button style will be applied.
*/
type: {
type: String,
validator(value) {
return ['primary', 'secondary', 'tertiary', 'tertiary-no-background', 'error', 'warning', 'success'].indexOf(value) !== -1
return ['primary', 'secondary', 'tertiary', 'tertiary-no-background', 'tertiary-on-primary', 'error', 'warning', 'success'].indexOf(value) !== -1
},
default: 'secondary',
},
Expand Down Expand Up @@ -508,6 +508,11 @@ export default {
&.button-vue--vue-tertiary-no-background {
opacity: 1;
}
&.button-vue--vue-tertiary-on-primary {
border-radius: var(--border-radius);
opacity: 1;
background-color: transparent;
}
&.button-vue--vue-success {
background-color: var(--color-success-hover);
}
Expand Down Expand Up @@ -568,6 +573,18 @@ export default {
}
}

// Tertiary on primary color (like the header)
&--vue-tertiary-on-primary {
color: var(--color-primary-text);
background-color: transparent;
opacity: .7;

&:hover:not(:disabled) {
background-color: transparent;
opacity: 1;
}
}

// Success
&--vue-success {
background-color: var(--color-success);
Expand Down