-
Notifications
You must be signed in to change notification settings - Fork 798
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
WhatsApp block: Increase specificity for background styling #19356
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me @stacimc and tests nicely, I tried it with a couple of different themes applied to confirm it doesn't regress anything.
In the process I found a couple of subtle other styling issues with the WhatsApp block. In the editor with Seedlet or Spearhead themes, the line height gets overridden and the text is slightly off vertically within the editor (but not on the front end). It also adds a 1px bottom border to the button:
If I add the following to the main a.whatsapp-block__button
selector, I can get it back to looking normal in the editor:
line-height: 36px; // 20px font size + 16 px padding
border: none;
Not sure if you want to include it in this PR, if not I'm happy to open up a separate PR for it 🙂
Thanks @andrewserong, well spotted. Added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding in the extra CSS @stacimc! Looks like the CI jobs are complaining that the PR needs a rebase, but it's testing well for me now, across Twenty Twenty, Twenty Twenty One, Spearhead, Seedlet, Barnsbury and Mayland themes.
I notice that the vertical position of the text feels slightly different on each of these themes, which is most likely normal... if we wanted to, we could possibly tweak the line-height down slightly to 32px to even out the difference between some of the themes, but I think I might have been staring at this button for too long now, it's probably fine how it is 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 🚢
Great news! One last step: head over to your WordPress.com diff, D59526-code, and commit it. Thank you! |
r224577-wpcom |
Fixes #18688
Changes proposed in this Pull Request:
background
style that overrides the block style when focused. This PR adds a selector with higher specificity to make sure the background styling is not overridden.Notes
Adding the
:focus
selector was not enough to increase the specificity; I also had to select on the parentdiv.wp-block-jetpack-whatsapp-button
. I added this in a separate selector rather than applying to all of the WhatsApp button styles to prevent the styling from breaking if the user deletes the parent block in the code editor.Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Before
After