Skip to content

Remove Primer CSS dependency and refactor EntityLabel#1346

Open
Copilot wants to merge 4 commits intodevfrom
copilot/theming-global-css-hardening
Open

Remove Primer CSS dependency and refactor EntityLabel#1346
Copilot wants to merge 4 commits intodevfrom
copilot/theming-global-css-hardening

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

Eliminates mixed design system dependency by removing @primer/css (only consumer: EntityLabel).

Before:

@import '@primer/css/labels/index.scss';

.entityLabel {
  @include labels-base;
  @include labels-large;
  margin: 4px 4px 4px 0px;
}

After:

.entityLabel {
  display: inline-block;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  border: 1px solid transparent;
  border-radius: 2em;
  margin: 4px 4px 4px 0px;
  white-space: nowrap;
  vertical-align: middle;
}

Changes:

  • Replaced Primer mixins with explicit CSS matching visual output
  • Removed @primer/css from package.json (no other consumers)
  • Updated JSDoc to reference Fluent UI patterns

Impact:

  • Design system unified to Fluent UI v9 exclusively
  • Reduced bundle size (Primer framework removed)
  • Zero API changes (component props/behavior unchanged)

How to test

  1. Check out locally with gh
  2. Verify EntityLabel renders identically (colored background, icon, contrast text)
  3. Test with various label colors and icon combinations
  4. Confirm no other Primer CSS imports exist: grep -r "@primer/css" client/
  5. Verify bundle build completes without Primer CSS errors

Related issues

Use e.g. Closes #1000 to link issue 1000 to the PR. Remove section if no related issues.

Related discussions

Remove section if no related discussions.

Related PRs

Part of three-PR design system consolidation initiative:

  • PR A: CSS hardening
  • PR B: client/ui/ abstraction layer
  • This PR (C): Primer CSS removal

Related smoke tests

Remove section if no related smoke tests.

Original prompt

Create three pull requests against the dev branch for repository Puzzlepart/did, each handled by a separate subagent:

PR A: Theming + global CSS hardening

  • Update global stylesheet to remove Fluent UI v9 provider override and global link underline removal.
  • Specifically, in server/public/css/app.css:
    • Remove the .fui-FluentProvider { background-color: transparent !important; } rule.
    • Remove the global a, a:hover, a:visited, a:active { text-decoration: none !important; } rule.
  • Ensure application styling remains acceptable and Fluent UI Link styling behaves like Fluent storybook defaults.
  • Add/adjust any minimal replacements only if necessary (avoid !important and avoid overriding Fluent component classes).

PR B: Component decoupling + entropy reduction scaffolding

  • Introduce a client/ui/ layer as the canonical thin wrapper layer around Fluent UI v9 components.
  • Add initial foundational exports (minimal viable set) such as Button, Link, Text, Field/Input wrapper, Dialog, Menu, Tabs, Tooltip, Tag/Badge.
  • Establish conventions: wrappers must forward refs, pass through props, avoid extra DOM.
  • Add documentation (e.g., in AGENTS.md or client/README.md) describing the layering model and usage rules.
  • Add linting or lightweight enforcement if feasible without major churn (e.g., guidance or an ESLint rule stub).
  • Migrate one small representative feature/component to use the new client/ui/ wrappers as an example (keep the change minimal).

PR C: Remove mixed design system dependency surface (Primer)

  • Identify current usage of @primer/css in the client and begin phased removal.
  • At minimum, refactor client/components/EntityLabel to stop importing Primer SCSS (@primer/css/labels/index.scss) and instead implement equivalent styling using Fluent UI v9 patterns (e.g., @fluentui/react-tags-preview Tag, or Fluent tokens + makeStyles/mergeClasses).
  • Keep behavior: colored background, optional icon, contrast-aware foreground.
  • Update any docs and remove Primer imports that are no longer needed.
  • If @primer/css becomes unused after changes, remove it from package.json; otherwise leave it but reduce usage.

General requirements:

  • All PRs should include clear descriptions, rationale, and testing notes.
  • Keep changes scoped; avoid large unrelated refactors.
  • Ensure TypeScript build passes and app still runs.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 4, 2026 15:03
- Remove .fui-FluentProvider background-color override
- Links will now use Fluent UI defaults with underlines

Verified with npm run package:client and npm run lint
Co-authored-by: damsleth <7300548+damsleth@users.noreply.github.com>
Copilot AI changed the title [WIP] Update global CSS to remove Fluent UI provider override Remove Primer CSS dependency and refactor EntityLabel Feb 4, 2026
Copilot AI requested a review from damsleth February 4, 2026 15:31
@damsleth damsleth marked this pull request as ready for review February 4, 2026 20:18
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