Skip to content

Demo: Pattern B without dsr.css — Tabs broken (why we need it) - #8

Closed
flacoman91 wants to merge 3 commits into
mainfrom
demo/dsr-css-pattern-b-broken
Closed

Demo: Pattern B without dsr.css — Tabs broken (why we need it)#8
flacoman91 wants to merge 3 commits into
mainfrom
demo/dsr-css-pattern-b-broken

Conversation

@flacoman91

@flacoman91 flacoman91 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why dsr.css exists demo for rad-dsr-css-cleanup (DSR #630).

Same Pattern B setup as #6 (fonts + full DS CSS), but intentionally omits @cfpb/design-system-react/dsr.css.

Tabs live in DSR (tab.scss), not @cfpb/cfpb-design-system. Without dsr.css (and without fat index.css), Buttons look fine; Tabs miss DSR-only chrome.

import '@fontsource-variable/source-sans-3/index.css'
import './base.scss' // full DS
// Missing: import '@cfpb/design-system-react/dsr.css'

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

Sibling demos

PR / branch Role
#7 demo/dsr-css-pattern-a Pattern A — index.css (Tabs OK)
This (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

Expected on this branch

Component Result
Button / Heading Correct (DS CSS)
Tab / TabList Missing / incomplete tab chrome

Preview

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

Test plan

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.
Load full Design System CSS only — Tabs miss DSR-only .tablist chrome,
which is why Pattern B apps need 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-8/

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 b broken Demo: Pattern B without dsr.css — Tabs broken (why we need it) 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