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

Curator: update link and button styles #6028

Merged
merged 12 commits into from
Jun 1, 2022
Merged

Conversation

mikachan
Copy link
Member

Changes proposed in this Pull Request:

This PR updates the link and button styles to match the mocks in #5996.

Default:
image

Hover:
image

Click/focus:
image

Active:
image

Related issue(s):

Closes #5996

@mikachan mikachan added the [Theme] Vivre Automatically generated label for Vivre. label May 23, 2022
@mikachan mikachan self-assigned this May 23, 2022
@mikachan mikachan marked this pull request as ready for review May 24, 2022 09:48
Copy link
Contributor

@jffng jffng left a comment

Choose a reason for hiding this comment

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

Thank you for picking this up @mikachan!

I noticed a few things:

  1. When the button is linked and is clicked, both the hover and active visual states are present:

Screen Shot 2022-05-25 at 10 14 27 AM

  1. When I click on a linked outline button, the border is still black:

Screen Shot 2022-05-25 at 10 21 30 AM

  1. Gutenberg provides default CSS for the "visited" state that makes the text of buttons white:

Screen Shot 2022-05-25 at 10 16 20 AM

This results in the text of the button not showing at all, since the background is also white. Is this a bug in Gutenberg, or should we address that somehow here?

@mikachan
Copy link
Member Author

Thanks @jffng! 1 & 2 should now be fixed.

Is this a bug in Gutenberg, or should we address that somehow here?

I've seen this at least once before when working on themes, so I'm thinking it's something that should be addressed in Gutenberg, probably as part of addressing hover/focus/active state styles (here are some related issues: WordPress/gutenberg#28063, WordPress/gutenberg#27075).

I've added a fix in the theme for now.

@pbking
Copy link
Contributor

pbking commented May 27, 2022

I notice that a 'filled button' doesn't have the same padding as an outline button. Should it?

image

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center","orientation":"horizontal"}} -->
<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"white","width":100,"style":{"color":{"text":"#1267ed"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link has-white-background-color has-text-color has-background wp-element-button" style="color:#1267ed">Text</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":50,"style":{"color":{"background":"#ffbb00","text":"#0c0c0c"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-50"><a class="wp-block-button__link has-text-color has-background wp-element-button" style="color:#0c0c0c;background-color:#ffbb00">Solid</a></div>
<!-- /wp:button -->

<!-- wp:button {"textColor":"black","width":50,"style":{"color":{"gradient":"linear-gradient(160deg,rgb(0,166,141) 0%,rgb(119,255,0) 98%)"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-50"><a class="wp-block-button__link has-black-color has-text-color has-background wp-element-button" style="background:linear-gradient(160deg,rgb(0,166,141) 0%,rgb(119,255,0) 98%)">Gradient</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

@mikachan
Copy link
Member Author

I notice that a 'filled button' doesn't have the same padding as an outline button. Should it?

Thanks @pbking and @beafialho. The 'fill' button now has the same padding as the 'outline' button. Here's what it looks like in the different states:

Default:
image

Hover:
image

Click/focus:
image

Active:
image

With a custom background:
image

@pbking
Copy link
Contributor

pbking commented May 31, 2022

This now addresses the problem with a custom background color, however I'm not sure that the padding is appropriate when there isn't one. Would it be helpful to use that padding based on the button having a .has-background class or something?

@mikachan
Copy link
Member Author

mikachan commented Jun 1, 2022

Would it be helpful to use that padding based on the button having a .has-background class or something?

Yep good idea, I've applied the padding to just the buttons with a background now. Does this look better?

@pbking
Copy link
Contributor

pbking commented Jun 1, 2022

👍 Looks good to me!
🚢

@pbking pbking merged commit 0a50d25 into trunk Jun 1, 2022
@madhusudhand madhusudhand deleted the update/curator-link-button-styles branch June 2, 2022 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Theme] Vivre Automatically generated label for Vivre.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Curator: Button States
3 participants