Pre-1.0 architecture decisions: input needed from adopting teams #31
Closed
abbybowman
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
HDS Core is a Sass/CSS theme layer on USWDS 3.x. The approach so far for the pre-1.0 buildout has been to keep standard USWDS markup, override styles with HDS values, and ship no custom JavaScript. This has worked well for individual components — buttons, tables, accordions, forms, links, and lists all restyle cleanly with the same
.usa-*markup.As we push into composed components (Prose, Navigation, Cards) and palette-aware content blocks, we're hitting limitations in the "override everything" approach:
@uswds/compilelocks us to Gulp 4, which has 11 known dependency vulnerabilities. There's no Gulp 5 compatible version and@uswds/compilehas limited active maintenance..usa-proseapplies its own heading, list, table, and margin styles via internal USWDS mixins. HDS needs different values for all of these. Overriding them requires ~150 lines of CSS that duplicate our existing styles at higher specificity and must stay in sync whenever the base styles change.Before we lock in the v1.0 architecture, we want your input on five decisions that would be disruptive to change after teams start building against a 1.0 release.
1. Selective USWDS loading, drop
@uswds/compileand Gulp?Current state:
styles.scssloads the entire USWDS library (@forward "uswds"= all ~70 component packages), then_hds-components.scssoverrides individual components. Build uses Gulp 4 via@uswds/compile.Proposed: Replace monolithic USWDS loading with selective
@use= only load the ~18 component packages HDS actually themes. Components where HDS overrides are more complex than the component itself (Prose is the current example) get replaced with HDS implementations. Replace Gulp 4 with directsassCLI and npm scripts.What this changes for adopters: Nothing in the output CSS; same classes, same HTML markup. Build pipeline is internal to HDS Core. Adopter integration (Sass import or pre-compiled CSS link) stays identical.
Benefits:
Risks:
@uswds/compilesupport.Discussion q's:
2. Global bare-element styling on or off by default?
Current state: Bare HTML elements (
<h1>,<a>,<table>,<ul>) receive no HDS styling unless they're inside a USWDS component wrapper (.usa-prose,.usa-table) or the adopter enables$theme-global-content-styles: truein their Sass configuration. This is a USWDS flag that defaults tofalse.The tradeoff:
false(current default)true.usa-prosewrapper to look correctDiscussion q's:
.usa-prose?<h1>and<a>elements to be HDS-styled by default, or do you prefer opting in per-section?3. Class naming for HDS-authored components:
.usa-*or.hds-*?Current state: HDS uses
.usa-*class names when the component maps 1:1 to USWDS (same markup, different styles). Components with no USWDS equivalent use.hds-*.The question: If Decision 1 is approved and HDS starts writing its own implementations of components like Prose (instead of overriding the USWDS version), should those keep the
.usa-*class name or use a new.hds-*name?.usa-prose(keep).hds-prose(rename)Discussion q's:
4. JavaScript strategy for HDS Core
Current state: HDS Core ships zero custom JavaScript. Interactive components (accordion, banner, modal, tooltip, in-page navigation, date picker) work via
uswds.js— a single ~100KB bundle that initializes all USWDS JS components on the page.The problem: Several Phase 2 HDS components require JavaScript that USWDS doesn't provide:
<select>)These are core components for nasa.gov and mission sites — not edge cases.
Options:
uswds.js+ addhds.jsbundle<hds-dropdown>)data-*init (same pattern as USWDS)Discussion q's:
uswds.jsas a single bundle, or using a framework adapter likereact-uswds?5. USWDS migration compatibility: how faithful do we need to be?
Current state: A core design goal has been that existing USWDS sites can adopt HDS Core with minimal markup changes — add the HDS CSS and
.usa-button,.usa-accordion,.usa-tableelements restyle automatically. This has worked well for the components shipped so far. Most are pure CSS overrides with no HTML changes required.The tension: As we move into more complex components, we're finding cases where HDS needs different markup than USWDS for the same component class. Examples so far:
role="list"for accessibility when using HDS's custom numeral styling (USWDS doesn't require this)Some future components may have similar requirements that we can't predict yet.
The question: Where on this spectrum should HDS Core target?
.usa-*markup from a vanilla USWDS site works without HTML changes. HDS visual differences are CSS-only.Discussion q's:
How to weigh in
We're scheduling a meeting next week (March 30-Apr 3) to discuss. If you can't attend, please comment here with your team's constraints, preferences, and questions.
Beta Was this translation helpful? Give feedback.
All reactions