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

Add a button style for being used on primary like in the header #2871

Merged
merged 1 commit into from
Jul 22, 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 @@ -238,13 +238,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 @@ -535,6 +535,11 @@ export default {
&.button-vue--vue-tertiary-no-background {
opacity: 1;
}
&.button-vue--vue-tertiary-on-primary {
border-radius: var(--border-radius);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
border-radius: var(--border-radius);
border-radius: var(--border-radius-large);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do this via a separate prop square? I'm using this for the input too. Sometimes it's needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but we need this kind of buttons elsewhere too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the square (if we introduce it) should work on all buttons, so I would like to have that done in a seperate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reported at #2873

opacity: 1;
background-color: transparent;
}
&.button-vue--vue-success {
background-color: var(--color-success-hover);
}
Expand Down Expand Up @@ -595,6 +600,18 @@ export default {
}
}

// Tertiary on primary color (like the header)
&--vue-tertiary-on-primary {
Copy link
Contributor

@marcoambrosini marcoambrosini Jul 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just call it "inverted colours" or something like that? I can imagine we could use something similar in talk's call view

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No that's not how it works. In Talk we would always need white or something alike, not depening on the primary color nor the background.

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