Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
207 stars 43 forks source link

fix: override some common Custom CSS issues #1922

Closed laurelfulford closed 4 weeks ago

laurelfulford commented 1 month ago

All Submissions:

Changes proposed in this Pull Request:

This ended up being a pretty minor PR, but along with https://github.com/Automattic/newspack-plugin/pull/3496 it fixes some issues I noticed when testing RAS-ACC against the Custom CSS from 20 of our publisher sites.

I skipped a couple of the more opinionated issues (like styles that use !important) so this doesn't cover all the issues I ran into, only the ones that seemed less intentional/less super specific.

How to test the changes in this Pull Request:

  1. Copy the following CSS into the Additional CSS field in the Customizer -- it captures snippets of CSS that caused issues that these PRs fix.
h1, h2, h3, h4, h5, h6 {
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

body {
    background-color: #FCF9F3;
}

.wp-block-button__link:not(.has-background),
.button, 
button, 
input[type="button"],
input[type="reset"], 
input[type="submit"], 
.wp-block-search__button-outside .wp-block-search__button {
    font-style: italic;
}

p,
li {
    font-size: 16px;
    line-height: 24px;
}
  1. On the front-end, test a purchase flow as a not-logged in user. You'll notice some issues like:
    • Odd headings
    • Italicized buttons
    • A beige background on the modal checkout
    • Too-large footer disclaimer text. CleanShot 2024-10-23 at 17 02 04

CleanShot 2024-10-23 at 17 01 31

  1. Apply this PR and https://github.com/Automattic/newspack-plugin/pull/3496 and run npm run build in both.
  2. Confirm that the odd issues noted above have been fixed.

Other information:

laurelfulford commented 1 month ago

Thanks @adekbadek! Turns out I had to make the font size classes more specific to cascade right -- should be fixed in 2e2aed3 and I caught and fixed an issue with the WooPayments test credit card number picking up the button italics (which isn't anything a reader would see, but it was bugging me 😆 ).

Just let me know if anything looks off!

laurelfulford commented 4 weeks ago

Thanks @adekbadek 🥳