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

[#78] Making the css build file smaller #82

Merged
merged 1 commit into from
May 23, 2024

Conversation

nathan-schmidt-viget
Copy link
Contributor

@nathan-schmidt-viget nathan-schmidt-viget commented May 21, 2024

Summary

Brian noticed the CSS file could be trimmed down and I noticed the text/buttons were not changing color when a dark background color was set as the background.

  • I turned on the option to set a bg color for the top parent block.
  • Cleaned up the button.js file.
  • Removed the individual class for BG color and we are selecting it now as &[class*='has-dark']. This will save us a lot of file size once we start adding more colors to the theme.
  • Added cssnano per the TW docs for modification on the production build.

All of this saves us 15 kB and will help keep the file small on a project when we add more colors and custom styles.

Issues

Testing Instructions

  1. Run ddev npm run build to see the new file size.

Screenshots

Before

Screenshot 2024-05-21 at 3 45 15 PM

After

Screenshot 2024-05-21 at 3 45 02 PM

Copy link
Contributor

@bd-viget bd-viget left a comment

Choose a reason for hiding this comment

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

Nice job!! One minor file location change, but this looks so much better!

@nathan-schmidt-viget nathan-schmidt-viget merged commit afbaf79 into main May 23, 2024
@nathan-schmidt-viget nathan-schmidt-viget deleted the ns/78-button-dark-style branch May 23, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants