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

Move CSS from style.css to theme.json or block stylesheets #8634

Open
wants to merge 22 commits into
base: trunk
Choose a base branch
from

Conversation

donnapep
Copy link
Contributor

@donnapep donnapep commented Jan 26, 2025

Changes proposed in this Pull Request:

This PR seeks to clean up style.css, putting the CSS in theme.json where possible (and when there aren't too many styles), or block stylesheets otherwise.

It also puts the block styles in alpha order in theme.json for ease of maintenance.

Testing Instructions

Click around in the frontend and in the editor and ensure the UI looks the same as before. Specific things to check:

  • Navigation menu on desktop and mobile
  • 404 page
  • Search results page
  • Comments (comments still don't look great in some scenarios, but they should look the same as before)
  • Course List block on the course overview page with multiple pages

@donnapep donnapep self-assigned this Jan 26, 2025
Copy link
Contributor

Preview changes

I've detected changes to the following themes in this PR: Course.
You can preview these changes by following the links below:

I will update this comment with the latest preview links as you push more changes to this PR.

Note

The preview sites are created using WordPress Playground. You can add content, edit settings, and test the themes as you would on a real site, but please note that changes are not saved between sessions.

@donnapep donnapep marked this pull request as ready for review January 26, 2025 21:50
@donnapep donnapep changed the title Update/cleanup styles Move CSS from style.css to theme.json or block stylesheets Jan 26, 2025
@donnapep donnapep requested a review from a team January 29, 2025 13:29
Copy link
Member

@m1r0 m1r0 left a comment

Choose a reason for hiding this comment

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

Kudos for taking on such a big cleanup!

Overall it looks great! I've noticed just a few minor bugs:

  • The "Contact Teacher" button is missing some padding. The "Reset Lesson" and "Complete Lesson" buttons have the same issue.

image
image

  • The buttons are a bit bigger compared to before. I'm not sure if this is intended.
image

(before -> after)

@donnapep
Copy link
Contributor Author

donnapep commented Feb 3, 2025

Thanks @m1r0! I took a quick peek but wasn't able to reproduce the Contact Teacher button issue immediately. I know they are Outline style buttons. Would you mind checking the DevTools to see what's happening there? It's clearly not getting the same padding as the Fill style. 🙏🏻

@donnapep
Copy link
Contributor Author

donnapep commented Feb 8, 2025

The buttons are a bit bigger compared to before. I'm not sure if this is intended.

@m1r0 The padding shouldn't be any different. The only related change I made was to move the custom button padding from theme.json. It was only used in one place so didn't need to be a variable.

I spent some more time trying to reproduce these issues but wasn't able to. Perhaps there are some Global Styles / site editor template customizations that need to be reset?

There are a bunch of other style-related issues that I'd like to address once I'm finished with this one.

@donnapep
Copy link
Contributor Author

donnapep commented Feb 9, 2025

For the padding issue, it almost looks like your button is still trying to reference the CSS padding variable for some reason (maybe because the CSS was cached?), but can't find it because it was removed.

To be safe, I've reverted the padding changes in 615cb6c. This should resolve the issue with the button height as well. 🙌🏻

Thanks for the review!

@m1r0
Copy link
Member

m1r0 commented Feb 11, 2025

Thanks for the updates, Donna!

It's better but the button styles are still a bit off:

image (before)
image (after)
image

(before -> after)


If this helps, you can reproduce it in WP Playground. Here are the Playground links that include the Sensei plugin for trunk and your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants