Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 7 weeks ago

#51223 closed defect (bug) (fixed)

Twenty Thirteen: Button block not inheriting editor colors

Reported by: melchoyce Owned by: davidbaumwald
Priority: normal Milestone: 5.8
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

The button block is not working correctly in Twenty Thirteen. I've noticed two issues:

  • Filled buttons always inherit the shadow style, so the button always has a drop shadow. This happens both in the editor and on the front-end. This also happens on circular buttons. Because there is a specific button style for a filled button with a box shadow, this feels unepxected.
  • Outlined buttons don't inherit any colors from the editor.

Attaching screenshots to show what I mean.

Attachments (2)

Screen Shot 2020-09-02 at 2.09.28 PM.png​ (69.7 KB ) - added by melchoyce 6 years ago.
Buttons in the editor
Screen Shot 2020-09-02 at 2.13.50 PM.png​ (43.3 KB ) - added by melchoyce 6 years ago.
Buttons on the front-end

Download all attachments as: .zip

Change History (15)

This ticket was mentioned in โ€‹PR #993 on โ€‹WordPress/wordpress-develop by โ€‹kjellr.


6 years ago
#1

  • Keywords has-patch added

Trac ticket: https://core.trac.wordpress.org/ticket/51223

---

This PR corrects the default color of outlined buttons in the editor. Originally, these were dark gray in the editor, and orange in the front end. Now they're orange in both places.

It also adds a new optional "No Shadow" block style which allows users to hide the 3px shadow on buttons if they'd like to. This seemed like a way to sort out the issue as noted in the ticket, while not changing the appearance of buttons on existing sites running this theme.

## Screenshots

Before:
https://i0.wp.com/user-images.githubusercontent.com/1202812/107683623-c78cdf80-6c6f-11eb-91dc-ade62f0d5cf1.png

After:
https://i0.wp.com/user-images.githubusercontent.com/1202812/107683632-c956a300-6c6f-11eb-8059-cee64d796a4d.png
https://i0.wp.com/user-images.githubusercontent.com/1202812/107683640-cbb8fd00-6c6f-11eb-8d58-abea985e64db.png

#2 @melchoyce
6 years ago

The PR works for me ๐Ÿ‘

โ€‹ryelle commented on โ€‹PR #993:


6 years ago
#3

This does fix the color issue on default outline buttons, but I noticed a few other issues while testing:

  • In firefox, I'm seeing dark borders on the buttons (seeing this on trunk too)
  • On the outline button, background colors don't show up on the frontend
  • When using a custom color for an outline button, the button disappears on hover/focus

Editor:
<img width="609" alt="Screen Shot 2021-02-15 at 11 39 52 AM" src="โ€‹https://user-images.githubusercontent.com/541093/107972943-94ee2a00-6f82-11eb-8ae9-47cf8b1c1d03.png">

Frontend:
<img width="585" alt="Screen Shot 2021-02-15 at 11 39 42 AM" src="โ€‹https://user-images.githubusercontent.com/541093/107972942-94559380-6f82-11eb-852a-541d6eabd4a1.png">

I'm not sure if you want to go down the rabbit hole of getting custom colors working - I think it would be enough of an improvement to fix the borders & make the outline button color consistent.

โ€‹kjellr commented on โ€‹PR #993:


6 years ago
#4

Yeah, that's definitely going to be a rabbit hole. I suggest we tackle those issues separately.

โ€‹scruffian commented on โ€‹PR #993:


6 years ago
#5

LGTM, just one comment about i18n...

โ€‹ryelle commented on โ€‹PR #993:


6 years ago
#6

@kjellr Did you also fix the border issue in Firefox? (in the screenshots above, the buttons all have dark borders)

โ€‹kjellr commented on โ€‹PR #993:


6 years ago
#7

@ryelle I can't reproduce those borders anymore โ€”ย I wonder if they were fixed elsewhere?

I did add a couple extra commits that I think fix these two issues though:

  • On the outline button, background colors don't show up on the frontend
  • When using a custom color for an outline button, the button disappears on hover/focus

โ€‹ryelle commented on โ€‹PR #993:


6 years ago
#8

I think maybe it was fixed when โ€‹https://github.com/WordPress/gutenberg/issues/29149 was fixed, I'm also not seeing the issue anymore. Everything looks good ๐Ÿ‘

#9 @ryelle
5 years ago

  • Keywords commit added
  • Milestone Awaiting Review โ†’ 5.8

The PR still looks good, let's get this fix in for 5.8.

#10 @davidbaumwald
5 years ago

  • Owner set to davidbaumwald
  • Status new โ†’ accepted

#11 @ryelle
5 years ago

  • Resolution โ†’ fixed
  • Status accepted โ†’ closed

In 51110:

Twenty Thirteen: Add "No Shadow" style to button block.

This creates a new block style without a shadow, and fixes colors on outline buttons.

Props melchoyce, kjellr, scruffian.
Fixes #51223.

โ€‹kjellr commented on โ€‹PR #993:


4 years ago
#12

I'm not sure if this one is still valid. I'm unable to maintain it, would someone else mind adopting the PR?

โ€‹@mukesh27 commented on โ€‹PR #993:


7 weeks ago
#13

Thanks for the PR, @kjellr!

This appears to have been addressed in r51110, which already landed. Closing this PR as resolved.

If I've missed something this PR covers that the committed fix doesn't, please reopen or comment on the ticket. Happy to take another look.

Note: See TracTickets for help on using tickets.