-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Decouple USWDS packages from the library bundle (#1337)
**Related Ticket / Closes:** #1317 **Related Next.js PR:** developmentseed/next-veda-ui#30 ### Description of Changes Restructured the library build for local development and library build: 1. Development environment: - When developing in the veda-ui repo, we will have full USWDS package access - Moved USWDS related packages under `devDependencies` and added USWDS as a `peerDependency` 2. Library build: - Modified the build to only bundle custom component styles - Removed USWDS package styles from the final library bundle ### Notes & Questions About Changes Going forward, the VEDA UI library now expects consuming apps to: - Install USWDS as a dependency - Configure their own USWDS theme via a `_uswds-theme.scss` config file Furthermore, we could also expose the themed variables that @AliceR and @sandrahoang686 created in a similar config file like the one for USWDS (e.g. `_veda-theme.scss`) and allow instances to customize them in a similar manner like the uswds theme. Since that's out of scope for this PR, I'll create a follow-up issue to track it. ### Validation / Testing 1. Deployment preview: - Component styles are correctly applied - USWDS theming works as expected - Style specificity is maintained (custom styles override USWDS defaults) 2. Test in local development: - Run `yarn dev` and check that the development environment still has full USWDS access - Build library (yarn build) and inspect the main.css under /lib directory -> it should contain only custom CSS styles w/o USWDS styles included 3. In Next.js - See related PR with deployment preview - Change the colors using USWDS tokens in the instances `_uswds-theme.scss` config file -> check that the change is applied, for example, to the header
- Loading branch information
Showing
5 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Custom VEDA UI styles should be added here, so that they can be | ||
// picked up by Parcel and included in the final CSS bundle for the veda-ui library. | ||
@use "../components/common/page-header/page-header.scss"; | ||
@use "../components/common/page-header/logo-container/logo-container.scss"; | ||
@use "../components/common/banner/banner.scss"; | ||
@use "../components/common/datepicker/datepicker.scss"; |
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
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