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

example with USWDS #54

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

example with USWDS #54

wants to merge 3 commits into from

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 14, 2021

Overview

Per ProjectEvergreen/greenwood#523 wanted to get an example of USWDS working with Greenwood. The intent isn't to merge this PR, but rather provide an example and demonstration for how to add it to a Greenwood project.
Screen Shot 2021-12-11 at 7 40 54 PM

Steps

For the most part, I just followed the Getting started for developers for the SASS setup, and then got the code from the Accordion docs for the demo

  1. Install uswds package
    npm install uswds
  2. Created a uswds-settings.scss as required, with default settings
  3. Renamed theme.css -> theme.scss and added the needed code from uswds
    // Include a USWDS settings file (required)
    @import "./uswds-settings.scss";
    
    // Point to the USWDS source code (required)
    @import "../../node_modules/uswds/dist/scss/stylesheets/uswds.scss";
  4. Changed index.html to point to theme.scss
  5. Added Accordion demo code
  6. Loaded USWDS JavaScript code before closing </body> tag

Left some feedback for the team here - uswds/uswds#4433

Notes

  1. Had to create a custom SASS plugin for Greenwood, should try and publish that as a standalone plugin
  2. Technically using either of these variants (or at least .scss) isn't supported in Greenwood (yet) for the build command, so will make a note to add support for this
    <link rel="stylesheet" href="./styles/theme.scss"/>
    
    <!-- also support this as well? -->
    <script type="module" src="/components/footer.ts"/>

@thescientist13 thescientist13 self-assigned this Dec 14, 2021
@thescientist13 thescientist13 changed the title example/uswds example with USWDS Dec 14, 2021
@thescientist13
Copy link
Member Author

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.

1 participant