Skip to content

Add Starlight documentation app and centralize USWDS initialization#5

Merged
mbwatson merged 14 commits intostagecc:mainfrom
mbwatson:docs
Feb 23, 2026
Merged

Add Starlight documentation app and centralize USWDS initialization#5
mbwatson merged 14 commits intostagecc:mainfrom
mbwatson:docs

Conversation

@mbwatson
Copy link
Copy Markdown
Member

@mbwatson mbwatson commented Feb 19, 2026

Description:

This PR adds a documentation site at apps/docs using Astro Starlight and refactors how USWDS is initialized so both apps share the same design tokens. Stubbed documentation pages are introduced to get navigation generated and to get a sense of user flow, but their content isn't migrated yet.

What changed:

  • apps/docs: New Starlight-based docs app with full sidebar structure, USWDS-themed accent colors and typography mapped to Starlight CSS custom properties (with light/dark mode support). Stubbed doc pages (from existing gitbook) are also included.
  • packages/uswds-theme: Added _uswds-init.scss, which configures and forwards uswds-core with all BDC settings in one place. Both apps now import this instead of duplicating the @use "uswds-core" with (...) boilerplate. Removed the unusedtokens.json.
  • apps/site: Simplified global.scss to use the new shared init. Moved logo/sprite assets into src/assets/.
  • favicons for both app (docs and site) were updated to match those on the currently deployed sites.

Validating:

This is essentially setting up the Docs site boilerplate, so content doesn't need to be accurate at this point. What matters is that npm run dev -w @bdc/site and npm run dev -w @bdc/docs both work, as well as their builds, and USWDS styles are coming through to both apps.

Validating styles are working is easily seen by changing values in packages/uswds-theme/src/_colors.scss (e.g., change all "blue"s to "red"s), and those changes should be reflected in both running apps.

mbwatson and others added 11 commits February 18, 2026 09:26
…ght docs

- Create packages/ui with shared generic components extracted from apps/site:
  Button, Card, Icon, Link, BlockLink, TagLink, Breadcrumbs,
  YouTubeEmbed, Testimonial

- Update all apps/site imports to consume components from @bdc/ui
  instead of local @components/ aliases

- Configure apps/docs (Starlight) to use shared USWDS design tokens:
  - Add @bdc/uswds-theme, @uswds/uswds, and sass-embedded dependencies
  - Add custom.scss that compiles uswds-core with shared theme settings
    and maps USWDS tokens to Starlight CSS custom properties
  - Add vite scss loadPaths for USWDS package resolution

Both apps now share design tokens from @bdc/uswds-theme and can share
UI primitives from @bdc/ui.

Co-authored-by: Amp <amp@ampcode.com>
What was removed: index.scss (unused entry point) and _components.scss (forwarded USWDS component packages already included by @use "uswds").

What changed: _uswds-init.scss now @forwards the settings variables, so consumers only need one import (@use "uswds-init" as theme) to get both the core-* functions and the $theme-* variables.
lint

fix docs favicon
@mbwatson mbwatson requested a review from suejinkim20 February 19, 2026 16:51
Copy link
Copy Markdown
Collaborator

@suejinkim20 suejinkim20 left a comment

Choose a reason for hiding this comment

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

Pulled and tested locally:

  • Confirmed @bdc/site and @bdc/docs run successfully
  • Verified USWDS styles are applied in both apps and that changes to shared theme tokens propagate correctly
  • Checked docs sidebar/navigation and light/dark mode behavior

Everything looks good, especially that docs site dark mode! 👏🏼

@mbwatson mbwatson merged commit b8fddc1 into stagecc:main Feb 23, 2026
2 checks passed
@mbwatson mbwatson deleted the docs branch March 3, 2026 19:54
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