-
Notifications
You must be signed in to change notification settings - Fork 7
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
refactor: Bundle USWDS + custom styles as part of the parcel library build #1275
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
dzole0311
changed the title
[#1191] Add new gulp task, test bundling of custom USWDS styles for VEDA UI
[#1191] Bundle USWDS + custom styles as part of the parcel library build
Dec 2, 2024
dzole0311
changed the title
[#1191] Bundle USWDS + custom styles as part of the parcel library build
[Refactor] Bundle USWDS + custom styles as part of the parcel library build
Dec 9, 2024
dzole0311
changed the title
[Refactor] Bundle USWDS + custom styles as part of the parcel library build
refactor: Bundle USWDS + custom styles as part of the parcel library build
Dec 9, 2024
dzole0311
force-pushed
the
bundle-custom-uswds-styles
branch
from
December 9, 2024 11:17
72a94f2
to
2f7c96c
Compare
AliceR
approved these changes
Dec 10, 2024
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.
Everything works as you describe it @dzole0311 ! Thank you! 🙌
Thanks for reviewing and testing @AliceR! |
I am just reading this now, really like and prefer this approach! thanks @dzole0311. |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Ticket: #1191
Related Next.js PR: developmentseed/next-veda-ui#20
Description of Changes
namespace exists
errors when they are imported into one entry SCSS file)styles.scss
)yarn.lock
/ resolve merge conflictsMain problem this PR addresses
When our USWDS-styled components were used in Next.js, they appeared unstyled because USWDS assets weren't properly bundled. This PR:
The third point is interesting because Next.js detects and loads any CSS dependencies that Parcel bundled with our components, which I hope makes the developer experience much smoother. This means we could do this:
And the component will be styled with the VEDA UI styles, instead of having to:
Notes & Questions About Changes
Few things to note (cc @hanbyul-here @sandrahoang686 @AliceR)
This approach only includes USWDS styles that we're actively using in our components. These styles are managed through our main
styles.scss
file. This means we're keeping things lightweight by not including styles for USWDS components we don't use (like the stepper component). If a Next.js project needs additional USWDS components later, we can easily add them tostyles.scss
or they could install the USWDS library and get access to it. This keeps our bundle size small and efficient (we only ship what we actually need for VEDA)Style organization:
app/scripts/styles/styles.scss
Validation / Testing
VEDA UI
Next.js
1137-implement-new-ds-page-header
, now merged tomain
)