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

Couple JS/CSS fixes #24

Merged
merged 2 commits into from
Jul 11, 2023
Merged

Couple JS/CSS fixes #24

merged 2 commits into from
Jul 11, 2023

Conversation

Gaelan
Copy link
Contributor

@Gaelan Gaelan commented Jul 11, 2023

assets: couple JS/CSS fixes

Problem

The menu button on mobile doesn't work (#23), and the "here's how you know" on the banner doesn't either.

Solution

Two separate fixes for the two issues - lumped into one PR because they're both tiny:

  • Configure purgeCSS to detect classes used in JS, not just HTML.
  • Manually set window.uswdsPresent = true, because the piece that's suppose to do that isn't accessible as an ES module.

Test Plan

Manually tested - it works!

Gaelan added 2 commits July 10, 2023 15:28
Necessary to make the JS progressive enhancement machinery work when
loading uswds piecewise as ES modules.
Otherwise, PurgeCSS deletes classes created by JS code.
@decause-gov
Copy link
Contributor

LGTM +1 🚢

@Gaelan Gaelan merged commit b3d67df into main Jul 11, 2023
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.

2 participants