Skip to content

ENG-3479: Rename Ant cssVar prefix to fidesui and migrate consumers#8066

Merged
gilluminate merged 11 commits into
mainfrom
gill/eng-3479/rename-cssvar-prefix
Apr 29, 2026
Merged

ENG-3479: Rename Ant cssVar prefix to fidesui and migrate consumers#8066
gilluminate merged 11 commits into
mainfrom
gill/eng-3479/rename-cssvar-prefix

Conversation

@gilluminate
Copy link
Copy Markdown
Contributor

@gilluminate gilluminate commented Apr 29, 2026

Ticket ENG-3479

Stacked on: #8065 (Phase II — --fidesui-* consumer migration + Sass var deletion), which is itself stacked on #8056 (Phase I). Merge those first; this PR depends on the cssVar wrapper class machinery they add.

Description Of Changes

Phase III, the final phase of ENG-3479. After Phase II moved every consumer onto Ant's --ant-* cssVar names and deleted the Sass :root loop, this PR completes the migration by renaming the Ant cssVar prefix from the default ant to fidesui, then moving every var(--ant-*) reference (~140 files, ~540 refs including non-color vars like --ant-line-height-sm, --ant-font-family, --ant-border-radius, etc.) over to var(--fidesui-*).

After this PR, every Ant-derived CSS variable lives under the FidesUI brand namespace:

  • Color tokens: --fidesui-color-primary, --fidesui-color-error, --fidesui-brand-terracotta, --fidesui-brand-bg-minos, --fidesui-neutral-{50..900}, etc.
  • Non-color tokens: --fidesui-line-height-sm, --fidesui-font-family, --fidesui-border-radius, --fidesui-padding-*, --fidesui-table-*, etc.

The cssVar block selector also flips from .fidesui to whatever Ant emits with the new prefix; the wrapper class on FidesUIProvider and the dark scope in HomeContainer are kept (still fidesui and fidesui-dark — those are antd's cssVar.key values, independent of the var prefix).

Code Changes

  • clients/fidesui/src/ant-theme/default-theme.ts — flip cssVar: { key: "fidesui" } to cssVar: { prefix: "fidesui", key: "fidesui" }. Tweak the styling-priority docstring to mention that palette colors flow through the token system.
  • clients/fidesui/src/FidesUIProvider.tsx — comment update to reflect the new var prefix.
  • ~135 .tsx / .ts / .scss / .module.scss / .module.css files across clients/admin-ui, clients/fidesui, and clients/privacy-center — bulk replace --ant---fidesui-. CSS class selectors (.ant-table, class="ant-form-item", etc.) stay untouched because they don't share the --ant- prefix.

Steps to Confirm

  1. Open the Vercel preview build linked from this PR's CI checks. In DevTools, confirm:
    • The <style> cssVar block selector is now .fidesui and contents start with --fidesui-blue:#1677FF;…--fidesui-color-primary:#2b2e35;….
    • getComputedStyle(<any element under .fidesui>).getPropertyValue('--fidesui-line-height-sm') returns 1.6666….
    • getComputedStyle(<any element>).getPropertyValue('--ant-color-primary') returns an empty string — no more --ant-* vars.
  2. Visual smoke check on heavy-consumer pages (Nav, Activity Timeline, Datamap, Carbon icons, Home dashboard cards, Custom Tag/Tooltip/Typography). Light mode should look identical to main.
  3. Toggle dark mode on the home page (under alphaDarkMode); the .fidesui-dark block now contains --fidesui-* vars too, and dark values still flip correctly via darkAlgorithm.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • No followup issues
    • Followup issues created
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Apr 29, 2026 10:12pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Apr 29, 2026 10:12pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.31% (2800/44306) 5.56% (1404/25233) 4.41% (579/13106)
fides-js Coverage: 78%
79.39% (2011/2533) 65.99% (1240/1879) 73.09% (345/472)
privacy-center Coverage: 88%
85.97% (331/385) 81.36% (179/220) 78.87% (56/71)

gilluminate added a commit that referenced this pull request Apr 29, 2026
@gilluminate gilluminate force-pushed the gill/eng-3479/rename-cssvar-prefix branch from 2350d00 to b4ba691 Compare April 29, 2026 17:50
Turn on Ant's cssVar so theme tokens are emitted as CSS variables that flip
with the active theme, and register the FidesUI brand palette + neutral
scale as custom tokens. This lays the foundation for dark-mode-aware
styling without renaming or migrating any existing --fidesui-* consumers
yet (the legacy Sass :root loop stays in place; consumer migration is
Phase II of ENG-3479).

darkAlgorithm doesn't know about custom keys, so brand tokens that need
different dark values (minos/corinth pair) are flipped explicitly in
darkBrandTokens.
…ss var generation

Phase II of ENG-3479. Renames every var(--fidesui-*) reference across the
codebase to its --ant-* equivalent (built-ins like --ant-color-error /
--ant-color-bg-container, brand custom tokens like --ant-brand-terracotta /
--ant-brand-bg-minos, neutral scale --ant-neutral-{50..900}). Deletes the
Sass :root @each loop and palette.module.scss now that Ant's cssVar block
is the only emitter of these vars.

After this PR: nothing references --fidesui-*, theme-aware vars are sourced
purely from Ant's token system, and the palette.ts file is the single
source of truth feeding ant-theme/default-theme.ts.

Also fixes a long-broken hover style in privacy-requests/configure.tsx
that referenced --fidesui-complimentary-500 (a var that never existed).
@gilluminate gilluminate force-pushed the gill/eng-3479/migrate-fidesui-vars branch from 3573eb2 to c616281 Compare April 29, 2026 17:57
gilluminate added a commit that referenced this pull request Apr 29, 2026
@gilluminate gilluminate force-pushed the gill/eng-3479/rename-cssvar-prefix branch from b4ba691 to ddae5ae Compare April 29, 2026 17:57
@gilluminate
Copy link
Copy Markdown
Contributor Author

/code-review

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Code Review: PR #8066 — Rename Ant cssVar prefix to fidesui and migrate consumers

Scope: Frontend only (139 files, ~540 CSS variable references renamed from --ant-* to --fidesui-*)


Summary

The bulk rename of var(--ant-*) references to var(--fidesui-*) is clean and consistent — no missed replacements were found across the codebase. The changelog entry matches the PR scope.

The one area that warrants explicit verification is the set of CSS custom property declarations used to override Ant Design's component-scoped tokens. These are not just var() references — they are property assignments that Ant reads back internally (e.g., --{prefix}-menu-item-margin-block, --{prefix}-font-size, --{prefix}-input-hover-bg). The rename from --ant-* to --fidesui-* for these declarations is correct in principle when cssVar: { prefix: "fidesui" } is configured, since Ant should emit and read them under the same prefix. However, if any antd 5.x component still hard-codes the --ant- prefix for certain derived token reads internally, those overrides will silently become no-ops with no console error.

Key behaviors to visually confirm in the Vercel preview:

  1. Nav menu item margins render at 0 (no gap between sidebar items in expanded state)
  2. Flyout menu item margins in the collapsed sidebar popout are correct
  3. Form help/extra text (.ant-form-item-explain, .ant-form-item-extra) renders at font-size-sm, not the default body size
  4. Dark sidebar menu item hover background shows neutral-800, not the Ant default dark hover color
  5. Read-only inputs visually match disabled inputs (gray background, non-interactive border)

The PR description's DevTools verification step (getPropertyValue('--ant-color-primary') returning empty) confirms token emission works, but doesn't cover these component-internal token read-back scenarios.


Inline Comments

  • NavMenu.module.scss:143-146 — Menu margin token declarations; verify sidebar item spacing in preview
  • NavMenu.module.scss:214-215 — Same concern for flyout block
  • global.scss:48 — Form item font-size token override; verify help/extra text size
  • global.scss:73 — Dark menu hover background token; verify dark sidebar hover state
  • global.scss:108-121 — Read-only input token overrides (largest cluster); verify read-only input styling
  • SeverityGauge/constants.ts:20-22 — Pre-existing: lowcolor-error, highcolor-success; confirm domain semantics are intentional

🔬 Codegraph: unavailable


💡 Write /code-review in a comment to re-run this review.

Comment thread clients/admin-ui/src/features/common/nav/NavMenu.module.scss
Comment thread clients/admin-ui/src/features/common/nav/NavMenu.module.scss
Comment thread clients/fidesui/src/ant-theme/global.scss
Comment thread clients/fidesui/src/ant-theme/global.scss
Comment thread clients/fidesui/src/ant-theme/global.scss
@gilluminate gilluminate marked this pull request as ready for review April 29, 2026 18:24
@gilluminate gilluminate requested a review from a team as a code owner April 29, 2026 18:24
@gilluminate gilluminate requested review from kruulik and removed request for a team April 29, 2026 18:24
@gilluminate gilluminate force-pushed the gill/eng-3479/migrate-fidesui-vars branch from c616281 to bd3d946 Compare April 29, 2026 19:59
…s outside Ant components

Ant scopes its cssVar block to a generated class that it only auto-applies
to descendants of Ant components. With the Sass :root loop deleted, that
left SCSS modules styling plain divs (NavMenu, ActivityTimeline, etc.) with
unresolved var() references.

Set theme.cssVar.key to a stable "fidesui" so Ant emits a `.fidesui` selector,
then attach the class to <body> on mount (instead of wrapping children in a
<div>) so the whole document inherits the vars without inserting a new flex
item that would distort the consuming app's layout.
The light theme's cssVar block is scoped to `.fidesui` and applied via the
wrapper div in FidesUIProvider. Without a distinct key, the dark theme's
inner ConfigProvider would emit a second `.fidesui { ... }` block in head,
overlapping the light one and applying globally instead of staying scoped to
the dark-mode subtree.

Override the dark theme's cssVar.key so antd emits a separate `.fidesui-dark`
block, then have HomeContainer apply that class to its inner wrapper when
resolvedMode === "dark". CSS custom properties cascade inward, so vars not
overridden by the dark block still inherit from the outer `.fidesui` light
block.
@gilluminate gilluminate force-pushed the gill/eng-3479/migrate-fidesui-vars branch from bd3d946 to a17a0de Compare April 29, 2026 20:01
gilluminate added a commit that referenced this pull request Apr 29, 2026
@gilluminate gilluminate force-pushed the gill/eng-3479/rename-cssvar-prefix branch from ddae5ae to 5fed17a Compare April 29, 2026 20:02
Phase III. Changes the cssVar prefix on the Ant ThemeConfig from the default
"ant" to "fidesui", then renames every var(--ant-*) and --ant-* override
across the codebase to var(--fidesui-*) / --fidesui-*.

After this PR, every Ant-derived CSS variable lives under the FidesUI brand
namespace — both color tokens (--fidesui-color-primary, --fidesui-brand-*,
--fidesui-neutral-*) and non-color tokens (--fidesui-line-height-sm,
--fidesui-font-family, --fidesui-border-radius, etc.).
@gilluminate gilluminate force-pushed the gill/eng-3479/rename-cssvar-prefix branch from 5fed17a to 9160f8e Compare April 29, 2026 20:54
Copy link
Copy Markdown
Contributor

@kruulik kruulik left a comment

Choose a reason for hiding this comment

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

Base automatically changed from gill/eng-3479/migrate-fidesui-vars to main April 29, 2026 22:01
@gilluminate gilluminate added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 5e03d27 Apr 29, 2026
55 of 59 checks passed
@gilluminate gilluminate deleted the gill/eng-3479/rename-cssvar-prefix branch April 29, 2026 22:27
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