Skip to content

web: adopt @goauthentik/theme tokens in the app styles - #22523

Merged
GirlBossRush merged 18 commits into
mainfrom
ui-design-language
Sep 25, 2026
Merged

GirlBossRush merged 18 commits into
mainfrom
ui-design-language

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented May 21, 2026 •

Copy link
Copy Markdown
Contributor
 ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮
 ┆ This PR is a merge branch! ┆
 ╰┄┄┄┄┄┄┄┄┄┬┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯

            ╱╲ ╱╲ 
          ╱ ̄(°㇀°⚟) ̄╱╲
         ╱┌──じ㇀し───┐╲╱
          │          │
          │      ǝpoɔ│ ╱
          └─────┄───┄

This PR composes several changes across multiple packages to improve theming, font management, and visual consistency in the web application.

  • packages/theme: generate the PatternFly 4 --pf-global--* variables from authentik's tokens, and fix the mappings that didn't match PatternFly 4 (info, warning, danger, success, disabled, Color--300, primary-color--dark-100).
  • packages/theme: lint:bridge compares the generated variables against PatternFly 4's defaults and fails on mismatches; it runs as part of check.
  • web: load the generated theme stylesheet, which is committed so container builds don't need to build packages/theme
  • web: ak-drawer moves onto the generated tokens, fixing its RTL transforms and its dark shadows in nested dark sections.
  • web: visual comparisons that screenshot the working tree against the base branch (pnpm run test:visual).
  • packages/fonts: declare RedHatText's full 300–700 weight range.
  • website: the docs load their fonts from @goauthentik/fonts instead of the copies in website/static/fonts, plus sidebar and menu typography adjustments.
  • web: fix the user switcher overflow.

Co-Authored-By: Ken Sternberg [email protected]

@GirlBossRush
GirlBossRush requested review from a team as code owners May 21, 2026 04:33
@codecov

codecov Bot commented May 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.12%. Comparing base (5716119) to head (006bf1f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #22523   +/-   ##
=======================================
  Coverage   92.12%   92.12%           
=======================================
  Files        1177     1177           
  Lines       76842    76842           
  Branches     4121     4121           
=======================================
+ Hits        70789    70791    +2     
+ Misses       6000     5998    -2     
  Partials       53       53           
Flag Coverage Δ
conformance 33.31% <ø> (ø)
e2e 38.09% <ø> (+<0.01%) ⬆️
integration 30.06% <ø> (+<0.01%) ⬆️
rust 44.79% <ø> (ø)
unit 93.62% <ø> (+<0.01%) ⬆️
unit-migrate 93.63% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@GirlBossRush GirlBossRush changed the title web: introduce @goauthentik/theme design language package web: Design Language Package, Documentation May 21, 2026
@GirlBossRush
GirlBossRush removed the request for review from a team May 21, 2026 04:47
@GirlBossRush GirlBossRush added the area:frontend Features or issues related to the browser, TypeScript, Node.js, etc label May 21, 2026
@netlify

netlify Bot commented May 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 802867a
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a7fa1da1833e100082d91d7
😎 Deploy Preview https://deploy-preview-22523--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented May 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 802867a
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a7fa1dac7611f0007aa2a52
😎 Deploy Preview https://deploy-preview-22523--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dewi-tik dewi-tik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some minor suggestions otherwise LGTM for docs

Comment thread packages/theme/LICENSE.txt Resolved
Comment thread packages/theme/lib/tokens/color.js Resolved
Comment thread packages/theme/lib/tokens/color.js Resolved
Comment thread packages/theme/scripts/build.mjs Resolved
Comment thread packages/theme/scripts/format-dist.mjs Resolved
@GirlBossRush GirlBossRush changed the title web: Design Language Package, Documentation web: adopt @goauthentik/theme tokens in the app styles Jun 24, 2026
Copilot AI review requested due to automatic review settings July 29, 2026 00:22
@GirlBossRush
GirlBossRush changed the base branch from main to slice/theme-package July 29, 2026 00:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the web/ UI styling system to consume semantic design tokens from @goauthentik/theme, bridging those tokens onto existing PatternFly 4 variables to keep legacy CSS working while transitioning to the new token surface.

Changes:

  • Import @goauthentik/theme/index.css into the global theme variables entrypoint and add a PF4/legacy bridge stylesheet.
  • Apply the token bridge to Shadow DOM PatternFly base styles so adopted stylesheets track the global token→PF mapping.
  • Migrate ak-drawer off the removed --ak-v2-global--* globals to semantic tokens / component-local vars.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
web/src/styles/shadow/patternfly-base.css Imports the token bridge into the Shadow DOM PatternFly base sheet.
web/src/styles/global/theme/variables.css Imports the theme package CSS and the token bridge; removes the old --ak-v2-global--* block.
web/src/styles/global/theme/token-bridge.css New bridge mapping semantic --ak-* tokens onto PF4 variables (and legacy --ak-accent).
web/src/elements/ak-drawer/ak-drawer.styles.ts Switches drawer transforms/gap to semantic/private tokens.
web/src/elements/ak-drawer/ak-drawer.root.css Replaces drawer’s dependencies on removed V2 globals with semantic tokens and local shadow vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/theme/lint-bridge.mjs Fixed
@netlify

netlify Bot commented Sep 23, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 26c8116
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6ab3e623762bda0008489f7e
😎 Deploy Preview https://deploy-preview-22523--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@GirlBossRush
GirlBossRush force-pushed the ui-design-language branch 5 times, most recently from 1df37f8 to 15c753a Compare September 24, 2026 23:35
As an experiment, I have added three visual comparisons:

- dashboard
- event notification rules table
- new prompt form

… which provides a wide variety of controls that I can see and compare. As we move toward a more robust testing scheme *and* toward a more dispersed repository of artifacts (theme, elements, etc), I wanted a way to ensure that our upgrades to Patternfly and components didn’t break anything. I spent the day learning much more about Playwright and the snapshot tests.

I don’t think @BeryJu’s concern for snapshot size isn’t wholly warranted. I’ve manually restricted the viewport to 1280x800, so each snapshot pair (“light” and “dark”) is about 220Kb. The current project repo is 795Mb in size; it would take 40 tests to increase the size of the repository by 1%. If we have half that many snapshot pairs by next year, I’ll be delighted.

One challenge these tests present is that they should be run on a completely fresh database with no modifications; the dashboard and notifications page should reflect only the default status of an authentik instance when it comes up. The purpose of the snapshots isn’t to record the utility of the front-end; it’s to record and preserve the appearance of select elements in the page.
Generates the PatternFly 4 variables from the theme source instead of
maintaining them by hand: moves the token modules from src/tokens/ to
src/authentik/, and adds src/patternfly/ which emits the PF variables
from those tokens.

Known gaps: 17 colors remain unmapped and undefined; PatternFly dark
mode is not emitted yet; the linter cannot compare PatternFly and
authentik colors because the theme is authored in oklch.
Replace the committed page snapshots with a local visual comparison
workflow. `pnpm run test:visual` screenshots every Storybook story in
light and dark, and compares it against the merge-base with
origin/main. Baselines are recorded on demand from a temporary
worktree and cached in the git-ignored `.visual/` store, keyed by
commit and platform, so no images are committed.

A `pages` suite covers admin screens without generated data (login,
a modal form, a wizard) on a running instance.

Also break an import cycle between the notifications mixin and the
drawer components, which broke the Page Navbar story.
Build packages/theme before the web build, Storybook, and watch, and
import its generated CSS after the legacy variables in the theme layer
so the generated PatternFly variables take precedence.
PatternFly names text colors by the color of the text itself:
--pf-global--Color--dark-100 is dark text (#151515) for light surfaces,
and --pf-global--Color--light-100 is light text for dark surfaces. The
bridge mapped them the other way around, so components that set
--pf-global--Color--100 from dark-100 (Page, Alert, Table, and others)
rendered white text in light mode.
Add ink.pin-light.muted (#6a6e73) and map --pf-global--Color--dark-200
to it. PatternFly uses dark-200 for helper and placeholder text on
light surfaces; it was mapped to full-strength ink.
Building web in the container only installs the web workspace, so it
can't build packages/theme, which belongs to the root workspace and has
its own dependencies. Commit the theme's generated CSS instead, the same
way the API client is committed, and drop the theme build from the web
build graph.

`pnpm run build:theme` regenerates it; `pnpm run lint:theme` fails when
the committed copy is out of date.
Node runs TypeScript directly now, so replace build.mjs, build-demo.mjs,
lint-bridge.mjs, reference.css.js, and stylelint.config.mjs with .ts
equivalents. JSDoc typedefs become interfaces.

lint-bridge's array and CSS branches returned a bare string instead of a
[kind, value] pair, and its ref branch passed an extra argument that
shifted every parameter; both are fixed. Its output is unchanged for the
current tokens.

The generated header also names the current source directory; it still
pointed at the old src/tokens/.
Replaces the drawer's --ak-v2-global--* references with the
--ak-global--* tokens from the generated theme, and gives the drawer its
own directional shadows and RTL inverse multiplier. The multiplier was
previously read from --ak-v2-global--inverse--multiplier, which nothing
defined.

Co-Authored-By: Ken Sternberg <[email protected]>
The variable face covers 300-700, but the @font-face rules declared
400 500, so light text rendered at 400 and bold was capped at 500.
pnpm can place workspace links in a package's own node_modules (for
example `@goauthentik/fonts` under packages/docusaurus-config), and a
read-only bind mount of the package source over that directory hides
them from the docs build. Copy docusaurus-config and fonts into the
image before the root install instead, so those links survive.
Replaces docusaurus-config's hand-written @font-face rules and the
modified RedHat copies in website/static/fonts with the faces from
@goauthentik/fonts, so the docs and the web UI share one set of fonts.
Drops file headers, restated JSDoc, commented-out reference values, and
exploratory notes added on this branch, keeping only comments that
explain something surprising.
@GirlBossRush
GirlBossRush merged commit d1c5d64 into main Sep 25, 2026
146 checks passed
@GirlBossRush
GirlBossRush deleted the ui-design-language branch September 25, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants