Skip to content

Demo: Pattern A — DSR index.css only (Tabs work) - #7

Closed
flacoman91 wants to merge 2 commits into
mainfrom
demo/dsr-css-pattern-a
Closed

Demo: Pattern A — DSR index.css only (Tabs work)#7
flacoman91 wants to merge 2 commits into
mainfrom
demo/dsr-css-pattern-a

Conversation

@flacoman91

@flacoman91 flacoman91 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consumer demo for Pattern A against design-system-react rad-dsr-css-cleanup (DSR #630).

Greenfield-style app: one stylesheet. Tabs, buttons, and slug heading should look correct without loading full Design System CSS.

import '@cfpb/design-system-react/index.css'

DSR pin: fd60109a7 on rad-dsr-css-cleanup.

Sibling demos

PR / branch Role
This (demo/dsr-css-pattern-a) Pattern A — index.css only — Tabs OK
#8 demo/dsr-css-pattern-b-broken Pattern B without dsr.css — Tabs broken
#6 demo/dsr-css-pattern-b Pattern B + dsr.css — Tabs fixed

What to look for

  • Inactive tabs: DSR link style (blue, dotted underline)
  • Active tab: gray chip on the baseline
  • Buttons / slug heading styled
  • Source Sans (fonts ship inside index.css)

Preview

https://cfpb.github.io/dsr-test/pr-previews/pr-7/

Test plan

  • Open preview; confirm Tabs match Storybook / Pattern B fixed
  • Confirm buttons and slug heading look correct
  • Confirm we did not also load full DS CSS or dsr.css

Load index.css only and add a Tabs example so reviewers can compare
Pattern A vs Pattern B demos for the thin dsr.css export.
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cfpb.github.io/dsr-test/pr-previews/pr-7/

Built to branch gh-pages at 2026-07-28 16:25 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@flacoman91 flacoman91 changed the title Demo/dsr css pattern a Demo: Pattern A — DSR index.css only (Tabs work) Jul 28, 2026
flacoman91 added a commit to cfpb/design-system-react that referenced this pull request Jul 29, 2026
…terns (#630)

## Summary
- Add a thin companion stylesheet export
`@cfpb/design-system-react/dsr.css` for **Pattern B** apps that already
load full Design System CSS and must not also load fat `index.css`
(duplicate DS rules + fonts).
- Expand the Pattern A `ds-components.ts` barrel so `index.css` covers
more React-backed DS modules (list, button-group, expandables,
search-input, hero, text-introduction, …).
- Document Pattern A vs Pattern B clearly in the README (what to import,
what not to combine).
- Keep inactive Tabs on `isLink` / `a-btn--link` so dotted-underline
link chrome stays correct while tab styles live in `tab.scss` /
`dsr.css`.

## Why
Existing CFPB apps already ship full `@cfpb/cfpb-design-system` CSS.
They cannot safely import DSR `index.css` without duplicating buttons,
forms, fonts, etc. Tabs (and other React-only overrides) live in DSR,
not in the Design System package — so Pattern B had no clean CSS entry
until `dsr.css`.

## What changed
| Area | Change |
| --- | --- |
| `package.json` exports | Add `./dsr.css` → `dist/dsr.css` |
| Build | Second Vite build (`vite.dsr-css.config.ts`) + cleanup stub
script |
| `dsr-styles.ts` | DSR-authored styles only (Tabs + React overrides);
no fonts / no DS molecules |
| `ds-components.ts` | Broader Pattern A coverage for `index.css` |
| README | Pattern A / Pattern B / do-not-combine guidance |
| Tabs | Restore `Button isLink` on inactive tabs for correct link
styling |

## Consumer demos (`dsr-test`)
| Demo | Shows |
| --- | --- |
| [dsr-test#7](cfpb/dsr-test#7) Pattern A |
`index.css` only — Tabs OK |
| [dsr-test#8](cfpb/dsr-test#8) Pattern B broken
| Full DS CSS, **no** `dsr.css` — Tabs incomplete |
| [dsr-test#6](cfpb/dsr-test#6) Pattern B fixed
| Full DS CSS + `dsr.css` — Tabs fixed |

Previews:
- https://cfpb.github.io/dsr-test/pr-previews/pr-7/
- https://cfpb.github.io/dsr-test/pr-previews/pr-8/
- https://cfpb.github.io/dsr-test/pr-previews/pr-6/

## Usage

**Pattern A (new React apps):**
```ts
import '@cfpb/design-system-react/index.css'
```

**Pattern B (existing DS apps):**
```ts
import '@cfpb/design-system-react/dsr.css'
// Do not also import '@cfpb/design-system-react/index.css'
```

## Test plan
- [ ] `yarn build` produces both `dist/index.css` and `dist/dsr.css` (no
leftover `dsr-styles-entry.js`)
- [ ] Storybook Tabs: inactive = dotted link; active = gray chip
- [ ] Pattern A demo (#7): Tabs / buttons / slug look correct from
`index.css` alone
- [ ] Pattern B broken demo (#8): Buttons OK; Tabs missing DSR chrome
- [ ] Pattern B fixed demo (#6): Tabs match Pattern A; no `index.css`
import
- [ ] Confirm README “do not combine” table matches the intended
consumer guidance
@flacoman91 flacoman91 closed this Jul 30, 2026
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.

1 participant