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

Chore: style gutenberg button same as c-button #729

Merged
merged 24 commits into from
May 29, 2020

Conversation

derekshirk
Copy link
Contributor

@derekshirk derekshirk commented May 21, 2020

Overview

See #710

Creates a button mixin and applies our c-button styles to buttons output via Gutenberg button blocks. Selectors account for filled and outlined buttons as well as maintaining our desired colors and border radii.

I failed to arrive a solution for styling :focus states due to the lack of buttons and the following HTML output:

<div> // The (button) container
  <a> // the (button) link
</div>

Screenshots

I've added an outlined markup example to the vendor → WordPress → Gutenberg → core/button example:

Screen Shot 2020-05-22 at 10 31 15 AM

Testing output in a local version of our site:

Screen Shot 2020-05-22 at 11 18 57 AM

Example of the available options within the button block editor:

Screen Shot 2020-05-21 at 5 04 22 PM

Testing

  1. View deploy preview
  2. Test :hover
  3. Test :focus
  4. Bonus testing:
  • Set up a local version of cloudfour-dot-com@v-next
  • Enable Gutenberg editor / uncheck setting in profile to disable visual editor
  • Test output of buttons via block editor

Notes

@derekshirk derekshirk self-assigned this May 21, 2020
@derekshirk derekshirk marked this pull request as ready for review May 26, 2020 17:05
Copy link
Member

@spaceninja spaceninja left a comment

Choose a reason for hiding this comment

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

Overall this seems reasonable to me. I'll defer to @tylersticka, though.

src/vendor/wordpress/_wordpress.scss Outdated Show resolved Hide resolved
Copy link
Member

@tylersticka tylersticka left a comment

Choose a reason for hiding this comment

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

I think your mixins look great.

I would suggest applying them to wp-block-button__link rather than wp-block-button to solve the focus issues you mentioned earlier.

@derekshirk derekshirk requested a review from tylersticka May 27, 2020 18:21
src/vendor/wordpress/_wordpress.scss Outdated Show resolved Hide resolved
src/vendor/wordpress/_wordpress.scss Outdated Show resolved Hide resolved
src/vendor/wordpress/_wordpress.scss Outdated Show resolved Hide resolved
@derekshirk derekshirk requested a review from tylersticka May 27, 2020 21:18
@derekshirk derekshirk requested a review from tylersticka May 27, 2020 23:45
@derekshirk derekshirk requested a review from tylersticka May 29, 2020 18:23
@derekshirk derekshirk merged commit 519e882 into v-next May 29, 2020
@derekshirk derekshirk deleted the chore/gutenberg-core-button branch May 29, 2020 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants