Skip to content

packages/theme: add the @goauthentik/theme design-system package - #23341

Merged
GirlBossRush merged 6 commits into
mainfrom
slice/theme-package
Aug 14, 2026
Merged

GirlBossRush merged 6 commits into
mainfrom
slice/theme-package

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Adds @goauthentik/theme, the Styleframe-based TypeScript design-system package: typed token modules compiled with tsgo, hex to oklch() color output with ref() build-time name checks, and a build that emits a self-contained index.css plus per-category files and DTCG JSON.

Foundation for the design-language work. No visual change on its own until the app consumes the tokens (that lands separately in #22523).

The fonts that were originally part of this branch are split out into #24461.

How it resolves

The package is a member of the repo-root pnpm workspace, and web depends on it with link:../packages/theme — following packages/geo rather than symlinking it under web/packages/.

Its TypeScript entry points resolve to src/ under the types, node and bundler conditions, with default and publishConfig.exports pointing at the built dist/. web's ESBuild build now opts into the bundler condition, so bundling the tokens needs no prior build of the package. No package in web's dependency tree declares that condition, so resolution is otherwise unchanged.

The generated CSS has no source form and does still require a build. Nothing in web imports it yet, so that wiring belongs with #22523, which adds the @import and can build the CSS in the bundler via the package's own build() helper.

Tokens and fonts are decoupled

The font-family tokens name the RedHat faces but this package ships no font bytes. The @font-face rules live in @goauthentik/fonts (#24461), so a consumer that does not load them falls through to the platform stacks.

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

@netlify

netlify Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 22d5336
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a7c8ea36f236100081e41d3
😎 Deploy Preview https://deploy-preview-23341--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.

@netlify

netlify Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit a44063f
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a7bfc94551eee0008688a3a
😎 Deploy Preview https://deploy-preview-23341--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.

@codecov

codecov Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.50%. Comparing base (fd1cddb) to head (22d5336).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23341      +/-   ##
==========================================
+ Coverage   90.86%   91.50%   +0.64%     
==========================================
  Files        1150     1150              
  Lines       72619    72619              
  Branches     3875     3875              
==========================================
+ Hits        65982    66449     +467     
+ Misses       6602     6135     -467     
  Partials       35       35              
Flag Coverage Δ
conformance 34.69% <ø> (+<0.01%) ⬆️
e2e 39.36% <ø> (?)
integration 31.25% <ø> (+<0.01%) ⬆️
rust 38.89% <ø> (ø)
unit 90.75% <ø> (-2.39%) ⬇️
unit-migrate 93.16% <ø> (+0.97%) ⬆️

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.

@rissson

rissson commented Jun 24, 2026

Copy link
Copy Markdown
Member

This should also be added to CODEOWNERS and maybe to .github/workflows/packages-npm-publish.yml

@GirlBossRush
GirlBossRush force-pushed the slice/theme-package branch from 7417cda to 105b0b1 Compare July 28, 2026 23:09
Copilot AI lite review requested due to automatic review settings July 28, 2026 23:09
@GirlBossRush
GirlBossRush requested a review from a team as a code owner July 28, 2026 23:09
@GirlBossRush GirlBossRush changed the title packages/theme: add @goauthentik/theme design-system package packages/theme, packages/fonts: add the design-system package, extract the RedHat faces Jul 28, 2026

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

Adds new workspace packages to support authentik’s emerging design system: a Styleframe-powered token package (@goauthentik/theme) and an assets-only fonts package (@goauthentik/fonts), plus the minimal web build wiring needed to consume workspace TypeScript sources and correctly emit/embed cross-workspace assets.

Changes:

  • Introduces packages/theme with token modules, Styleframe configuration, and build scripts to emit CSS + DTCG JSON.
  • Introduces packages/fonts to own RedHat variable font assets and a canonical faces.css, and switches web global CSS to import it.
  • Updates the web esbuild configuration to set outbase to the monorepo root and opt into the bundler conditional export resolution, plus workspace/link dependency wiring.

Reviewed changes

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

Show a summary per file
File Description
web/src/styles/interface.global.css Switches global font-face import to @goauthentik/fonts.
web/src/styles/flows.global.css Switches flow UI font-face import to @goauthentik/fonts.
web/scripts/build-web.mjs Sets outbase to monorepo root and adds bundler condition for conditional exports.
web/pnpm-workspace.yaml Excludes packages/theme from web workspace importers to avoid Dependabot lockfile artifacts.
web/pnpm-lock.yaml Adds linked @goauthentik/fonts and @goauthentik/theme to web importer.
web/package.json Adds link dependencies on @goauthentik/fonts and @goauthentik/theme; removes #fonts import mapping.
pnpm-workspace.yaml Registers packages/fonts and packages/theme in the root workspace.
pnpm-lock.yaml Adds dependency graph entries for the new packages and their toolchain deps.
packages/theme/tsconfig.json TypeScript configuration for the theme package build.
packages/theme/styleframe.config.ts Styleframe CLI config entrypoint exporting the configured singleton instance.
packages/theme/src/tokens/z-index.ts Adds z-index token scale.
packages/theme/src/tokens/utopia-typography.ts Adds responsive typography scale generation (utopia-core).
packages/theme/src/tokens/utopia-spacing.ts Adds responsive spacing scale generation (utopia-core).
packages/theme/src/tokens/typography.ts Adds font family/size/weight/line-height tokens.
packages/theme/src/tokens/spacing.ts Adds fixed spacing token scale.
packages/theme/src/tokens/shape.ts Adds radius and border-width tokens.
packages/theme/src/tokens/shadow.ts Adds shadow tokens + dark theme overrides.
packages/theme/src/tokens/motion.ts Adds duration/easing tokens + reduced-motion variants.
packages/theme/src/tokens/index.ts Re-exports all public token modules.
packages/theme/src/tokens/fonts.ts Adds concrete font stack tokens referencing @goauthentik/fonts-provided faces.
packages/theme/src/tokens/color.ts Adds semantic color tokens + dark theme overrides with OKLCH transform.
packages/theme/src/tokens/color-libs.ts Adds OKLCH conversion/transform helpers for color token emission.
packages/theme/src/shared.ts Defines the singleton Styleframe instance and shared helpers.
packages/theme/src/node.ts Node-only build helper to transpile tokens to CSS and optionally write files.
packages/theme/src/index.ts Browser-safe public entrypoint exporting primitives + tokens.
packages/theme/package.json Declares @goauthentik/theme exports (including conditional exports) and build/lint scripts.
packages/theme/LICENSE.txt Adds MIT license for the theme package.
packages/theme/eslint.css.mjs Adds CSS linting configuration for generated CSS output.
packages/theme/eslint.config.mjs Adds JS/TS lint configuration for the theme package sources.
packages/theme/build.mjs Generates dist/index.css plus per-category CSS slices from Styleframe output.
packages/theme/.prettierignore Prettier ignore rules for the theme package (dist/out/etc.).
packages/theme/.gitignore Gitignore for theme-local artifacts.
packages/fonts/RedHatMonoVF.woff2 Adds font asset (woff2).
packages/fonts/RedHatMonoVF-Italic.woff2 Adds font asset (woff2).
packages/fonts/package.json Declares @goauthentik/fonts as an assets-only package exporting faces.css.
packages/fonts/OFL.txt Adds SIL OFL text for the bundled RedHat fonts.
packages/fonts/faces.css Adds canonical @font-face rules for RedHat variable fonts.
packages/fonts/.prettierignore Prettier ignore rules for the fonts package.
locale/en/dictionaries/software-terms.txt Adds spellcheck allow-words for new terminology used in the PR.
CODEOWNERS Assigns CODEOWNERS for packages/fonts to the frontend team.
Files not reviewed (2)
  • pnpm-lock.yaml: Generated file
  • web/pnpm-lock.yaml: Generated file

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

Comment thread packages/theme/styleframe.config.ts Resolved
Comment thread packages/theme/src/index.ts Outdated
Comment on lines +8 to +9
* Browser-safe: no Node-only dependencies. Build helpers that touch the
* filesystem live in `./lib/node.js` (exposed via the `./build` subpath).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed — the comment now points at ./node.ts via the ./build subpath.

Comment thread packages/theme/src/shared.ts Resolved
Copilot AI review requested due to automatic review settings July 29, 2026 00:21
@GirlBossRush
GirlBossRush force-pushed the slice/theme-package branch from 105b0b1 to 364d335 Compare July 29, 2026 00:21

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

Copilot reviewed 34 out of 44 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • pnpm-lock.yaml: Generated file
  • web/pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (6)

packages/theme/src/tokens/utopia-typography.ts:28

  • The error message here refers to “utopia spacing”, but this module is generating the typography scale via calculateTypeScale.
    packages/theme/src/index.ts:9
  • This comment references ./lib/node.js, but the Node-only helper entry is src/node.ts and is exposed via the ./build (and ./node) export paths.
 * filesystem live in `./lib/node.js` (exposed via the `./build` subpath).

packages/theme/styleframe.config.ts:8

  • The comment mentions importing ./lib/tokens/index.js, but this file imports ./src/tokens/index.js. Updating the comment avoids confusion for future maintainers.
    packages/theme/src/shared.ts:22
  • Project docs/conventions indicate the product name should be written as lowercase authentik. This comment uses “Authentik-specific”.
 * Authentik-specific styleframe configuration.

packages/theme/src/tokens/utopia-spacing.ts:24

  • calculateSpaceScale(...).sizes is accessed before checking for an undefined return value. If calculateSpaceScale ever returns undefined, this will throw a TypeError before the intended error message is raised.
    packages/fonts/package.json:5
  • This package includes Red Hat font binaries under the SIL Open Font License (see OFL.txt), but the license field is set to MIT. The package metadata should reflect the license of the distributed artifacts.
    "license": "MIT",

Comment thread packages/theme/package.json Resolved
@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-22d53361469af09e445fb321d24861e438b1f1c8
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-22d53361469af09e445fb321d24861e438b1f1c8

Afterwards, run the upgrade commands from the latest release notes.

Copilot AI review requested due to automatic review settings July 29, 2026 15:59
@GirlBossRush
GirlBossRush force-pushed the slice/theme-package branch from 364d335 to aac7050 Compare July 29, 2026 15:59
@GirlBossRush GirlBossRush changed the title packages/theme, packages/fonts: add the design-system package, extract the RedHat faces packages/theme: add the @goauthentik/theme design-system package Jul 29, 2026

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

Copilot reviewed 29 out of 31 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • pnpm-lock.yaml: Generated file
  • web/pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (4)

packages/theme/package.json:32

  • package.json defines an exports map but does not export the package root ("."). With conditional exports present, import "@goauthentik/theme" will fail because only subpaths like @goauthentik/theme/browser are exported.
    "exports": {
        "./package.json": "./package.json",
        "./types": "./src/index.ts",
        "./node": {
            "types": "./src/node.ts",

packages/theme/styleframe.config.ts:10

  • The comment says importing ./lib/tokens/index.js triggers registration side-effects, but the file actually imports ./src/tokens/index.js. This can confuse future maintainers and reviewers when chasing where tokens are registered.
 * Importing `./lib/tokens/index.js` triggers the side-effects that register
 * every token against the shared instance; we re-export `instance` as the
 * default export so the CLI's `dtcg export` and `build` commands operate on

packages/theme/src/shared.ts:23

  • Product name should be lowercase “authentik” in prose/comments (project convention). This comment uses “Authentik-specific”.
/**
 * Authentik-specific styleframe configuration.
 *

packages/theme/src/tokens/utopia-typography.ts:29

  • This error message is in the typography token module but says “utopia spacing”, which is misleading when debugging failures.
if (utopiaSizes === undefined) {
    throw new Error("Failed to parse utopiaScale configuration for utopia spacing.");
}

@netlify

netlify Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit a44063f
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a7bfc945702eb0008b998a0
😎 Deploy Preview https://deploy-preview-23341--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.

Copilot AI review requested due to automatic review settings July 30, 2026 15:44

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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@kensternberg-authentik

Copy link
Copy Markdown
Contributor

Since I can't attach an image to a commit, here's the current look of the Demo page.

localhost_8001_index html (1)

Comment thread packages/theme/demo/demo.js Fixed
Comment thread packages/theme/build-demo.mjs Fixed
Comment thread packages/theme/build-demo.mjs Fixed
Copilot AI review requested due to automatic review settings August 5, 2026 23:41

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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

Copilot AI review requested due to automatic review settings August 6, 2026 13:52

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

Copilot reviewed 43 out of 60 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • pnpm-lock.yaml: Generated file
  • web/pnpm-lock.yaml: Generated file
Suppressed comments (5)

packages/theme/src/shared.ts:13

  • This doc comment says the name function rewrites color.primary to ak-color-primary, but the actual implementation prefixes ak-global-- and uses -- separators (e.g. ak-global--color--primary). This mismatch makes it harder to reason about the emitted variable names when consuming the package.
    packages/theme/src/tokens/z-index.ts:6
  • The comment references an emitted variable name of --ak-z-index-md, but this package emits --ak-global--z-index--md (see authentikStyleframeOptions.variables.name in src/shared.ts).
    packages/theme/src/tokens/typography.ts:7
  • The doc comment references --ak-font-family-* variables, but the actual emitted variables (and the aliases below) use the --ak-global--font-family--* names. Updating the comment avoids pointing consumers at variable names that don’t exist.
    web/docs/arch/2026-06-18-How-CSS-Is-Made-And-Next-Steps.md:38
  • This import-order doc is now out of date: the PatternFly icon sheets no longer include @font-face declarations (they’ve moved to @goauthentik/fonts/icons.css and are imported by the entrypoints). The list item describing patternfly-*-icons.css should reflect that it now vendors only icon classes.
    packages/theme/demo/demo.css:5
  • The CSS custom property defined here is --demo-page-max-width, but the rest of the stylesheet uses var(--demo-page-max) (e.g. lines 73, 105, 163, 634). That means those max-width declarations resolve to an unset variable and won’t apply as intended.
:root {
    --demo-page-max-width: 78rem;
    --demo-col-min: 14rem;
    --demo-hairline: color-mix(in oklab, var(--ak-global--color--border) 60%, transparent);

Comment thread packages/theme/build.mjs Resolved

@kensternberg-authentik kensternberg-authentik 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.

Good for now. Something to build off of.

Copilot AI review requested due to automatic review settings August 6, 2026 20:21

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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@GirlBossRush
GirlBossRush removed the request for review from a team August 12, 2026 04:13
@GirlBossRush
GirlBossRush removed the request for review from a team August 12, 2026 04:46
@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:

  • ❌ 2 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 17 package(s) with unknown licenses.
  • ⚠️ 3 packages with OpenSSF Scorecard issues.

View full job summary

GirlBossRush and others added 6 commits August 12, 2026 16:13
Extract the bundled web fonts out of web/ into a dedicated
@goauthentik/fonts workspace package: the RedHat variable faces, the
PatternFly pficon icon face, and the FontAwesome Free solid face, each
with its upstream license recorded under licenses/.

web/ now pulls the faces and icons from the package's
@goauthentik/fonts/faces.css and @goauthentik/fonts/icons.css entry
points instead of the old #fonts/* import and the inlined pficon.scss
vendor sheet.

Anchor esbuild's [dir] at the monorepo root via outbase so assets pulled
from the out-of-web package no longer resolve to a "_.._" segment, which
Go's //go:embed silently drops from the embedded outpost build.

Co-Authored-By: Ken Sternberg <[email protected]>
Add @goauthentik/theme, which defines authentik's design tokens (color,
typography, fonts, spacing, shape, shadow, motion, z-index) in TypeScript
and builds them into CSS via styleframe.

Token names carry a distinct separator per category so the token type is
recoverable from the name alone. That is worth the verbosity: it keeps
the DX legible and leaves room for automatic theme management and future
tooling built on top of the token set.

Co-Authored-By: Ken Sternberg <[email protected]>
Add a self-contained demo page, built by build-demo.mjs, that renders
every theme token — colors, typography, spacing, shape, shadow, motion —
so the design system can be eyeballed in isolation while it evolves.

Co-Authored-By: Ken Sternberg <[email protected]>
@GirlBossRush
GirlBossRush merged commit 189a280 into main Aug 14, 2026
145 of 146 checks passed
@GirlBossRush
GirlBossRush deleted the slice/theme-package branch August 14, 2026 23:16
@github-project-automation github-project-automation Bot moved this from Todo to Done in authentik Core Aug 14, 2026
GirlBossRush added a commit that referenced this pull request Aug 14, 2026
)

* packages/fonts: add @goauthentik/fonts package

Extract the bundled web fonts out of web/ into a dedicated
@goauthentik/fonts workspace package: the RedHat variable faces, the
PatternFly pficon icon face, and the FontAwesome Free solid face, each
with its upstream license recorded under licenses/.

web/ now pulls the faces and icons from the package's
@goauthentik/fonts/faces.css and @goauthentik/fonts/icons.css entry
points instead of the old #fonts/* import and the inlined pficon.scss
vendor sheet.

Anchor esbuild's [dir] at the monorepo root via outbase so assets pulled
from the out-of-web package no longer resolve to a "_.._" segment, which
Go's //go:embed silently drops from the embedded outpost build.

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

* packages/theme: add @goauthentik/theme design-system package

Add @goauthentik/theme, which defines authentik's design tokens (color,
typography, fonts, spacing, shape, shadow, motion, z-index) in TypeScript
and builds them into CSS via styleframe.

Token names carry a distinct separator per category so the token type is
recoverable from the name alone. That is worth the verbosity: it keeps
the DX legible and leaves room for automatic theme management and future
tooling built on top of the token set.

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

* web/theme: add a demo page for the theme tokens

Add a self-contained demo page, built by build-demo.mjs, that renders
every theme token — colors, typography, spacing, shape, shadow, motion —
so the design system can be eyeballed in isolation while it evolves.

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

* Heal lockfile.

* Fix spelling.

* Fix grouping.

---------

Co-authored-by: Ken Sternberg <[email protected]>
GirlBossRush added a commit that referenced this pull request Aug 14, 2026
)

* packages/fonts: add @goauthentik/fonts package

Extract the bundled web fonts out of web/ into a dedicated
@goauthentik/fonts workspace package: the RedHat variable faces, the
PatternFly pficon icon face, and the FontAwesome Free solid face, each
with its upstream license recorded under licenses/.

web/ now pulls the faces and icons from the package's
@goauthentik/fonts/faces.css and @goauthentik/fonts/icons.css entry
points instead of the old #fonts/* import and the inlined pficon.scss
vendor sheet.

Anchor esbuild's [dir] at the monorepo root via outbase so assets pulled
from the out-of-web package no longer resolve to a "_.._" segment, which
Go's //go:embed silently drops from the embedded outpost build.

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

* packages/theme: add @goauthentik/theme design-system package

Add @goauthentik/theme, which defines authentik's design tokens (color,
typography, fonts, spacing, shape, shadow, motion, z-index) in TypeScript
and builds them into CSS via styleframe.

Token names carry a distinct separator per category so the token type is
recoverable from the name alone. That is worth the verbosity: it keeps
the DX legible and leaves room for automatic theme management and future
tooling built on top of the token set.

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

* web/theme: add a demo page for the theme tokens

Add a self-contained demo page, built by build-demo.mjs, that renders
every theme token — colors, typography, spacing, shape, shadow, motion —
so the design system can be eyeballed in isolation while it evolves.

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

* Heal lockfile.

* Fix spelling.

* Fix grouping.

---------

Co-authored-by: Ken Sternberg <[email protected]>
GirlBossRush added a commit that referenced this pull request Aug 24, 2026
* packages/theme: add the @goauthentik/theme design-system package (#23341)

* packages/fonts: add @goauthentik/fonts package

Extract the bundled web fonts out of web/ into a dedicated
@goauthentik/fonts workspace package: the RedHat variable faces, the
PatternFly pficon icon face, and the FontAwesome Free solid face, each
with its upstream license recorded under licenses/.

web/ now pulls the faces and icons from the package's
@goauthentik/fonts/faces.css and @goauthentik/fonts/icons.css entry
points instead of the old #fonts/* import and the inlined pficon.scss
vendor sheet.

Anchor esbuild's [dir] at the monorepo root via outbase so assets pulled
from the out-of-web package no longer resolve to a "_.._" segment, which
Go's //go:embed silently drops from the embedded outpost build.

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

* packages/theme: add @goauthentik/theme design-system package

Add @goauthentik/theme, which defines authentik's design tokens (color,
typography, fonts, spacing, shape, shadow, motion, z-index) in TypeScript
and builds them into CSS via styleframe.

Token names carry a distinct separator per category so the token type is
recoverable from the name alone. That is worth the verbosity: it keeps
the DX legible and leaves room for automatic theme management and future
tooling built on top of the token set.

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

* web/theme: add a demo page for the theme tokens

Add a self-contained demo page, built by build-demo.mjs, that renders
every theme token — colors, typography, spacing, shape, shadow, motion —
so the design system can be eyeballed in isolation while it evolves.

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

* Heal lockfile.

* Fix spelling.

* Fix grouping.

---------

Co-authored-by: Ken Sternberg <[email protected]>

* web/elements/ak-mdx: drop React + runtime MDX eval, use unified pipeline

Replace `@mdx-js/mdx`'s `evaluate`/`run` (which depends on `'unsafe-eval'`
in the page CSP) with a pure `unified`/remark/rehype pipeline. URL-mode
content now arrives from the build-time `mdx-plugin` as pre-rendered HTML
and is stamped through a Trusted Types passthrough policy
(`CompiledMarkdownTrustPolicy`) so admin-side custom elements like
`<ak-alert>` and `<ak-md-a>` survive. Content-mode (admin-supplied
markdown) is compiled in-browser via `compileRuntimeMarkdown` and routed
through the existing `BrandedHTMLPolicy` (DOMPurify).

`<ak-md-a>` replaces the React `MDXAnchor`/`MDXWrapper` pair: a tiny Lit
custom element with `display: contents` that intercepts in-doc fragment
clicks for shadow-root scrolling. The remark plugins gain `caution` and
`tip` admonition types and promote `:::name[Title]` directive labels to
`<strong>`. `one-dark.css` learns `:host` so syntax-highlighted code
blocks inherit the palette inside `<ak-mdx>`'s shadow tree.

Removes `@mdx-js/mdx`, `react`, `react-dom`, `rehype-mermaid`, and
`remark-mdx-frontmatter`. Adds `unified`, `remark-parse`, `remark-rehype`,
and `mdast-util-to-string`.

Co-Authored-By: Agent <[email protected]>

* web/bundler/mdx-plugin: pre-render markdown to HTML at build time

Compile each `.md` / `.mdx` file through a build-time `unified` pipeline
(remark-parse, GFM, frontmatter, directives, custom admonition/headings/
lists transforms; rehype-rehype, anchor wrapping, syntax highlighting,
mermaid extraction) and emit a JSON envelope of
`{ content: HTML, frontmatter, publicPath, publicDirectory }`. The
on-load result still ships via the `file` loader so the runtime side
keeps its existing fetch path. The compiled HTML uses `<ak-md-a>` and
`<ak-alert>` custom elements so `<ak-mdx>` can stamp it directly into
shadow DOM with no client-side JavaScript evaluation.

Plugin is split across four sibling files (`node.js`, `compile.js`,
`remark.js`, `rehype.js`) so each concern lives in its own module. The
title/wrapper HTML is built as a hast tree and serialized through
`hast-util-to-html` rather than string-concatenated, dropping the
hand-rolled `escapeHTML` helper and unifying escape semantics with the
rest of the document.

Co-Authored-By: Agent <[email protected]>

* web/test: e2e ak-mdx pipeline via OAuth2 provider docs

The OAuth2 provider docs page exercises the full pipeline in one place:
frontmatter title, multiple H2 slugs, `:::caution`/`:::info` admonitions
(with and without titles), relative-doc links, external links, and an
embedded mermaid sequence diagram. Tests boot the admin UI, provision a
fresh OAuth2 provider, navigate to its view page, and assert against the
compiled DOM inside `<ak-mdx>`'s shadow root.

Co-Authored-By: Agent <[email protected]>

* web/elements/ak-mdx: sanitize replacer output, note pipeline drift

Address PR review feedback on the URL-mode trust boundary. `<ak-mdx>`'s
`replacers` hook runs over pre-rendered build-time HTML before it is
stamped into the DOM, and consumers (e.g. `ProxyProviderViewPage`) splice
admin-controlled values such as `provider.externalHost` into it. The old
React pipeline ran replacers on raw markdown that was then compiled, so
those values were HTML-escaped on serialization; the new URL mode passed
the post-replacer HTML straight through, dropping that guarantee.

Replace the passthrough `CompiledMarkdownTrustPolicy` with
`CompiledMarkdownSanitizePolicy`: a DOMPurify policy that whitelists the
custom elements (`<ak-alert>`, `<ak-md-a>`, `<ak-diagram>`) and the
`part`/`level` attributes our pipeline emits, and strips anything else a
replacer could inject.

Also add a reciprocal drift note to the runtime `markdown.ts` pointing at
`bundler/mdx-plugin/`, mirroring the existing note on the bundler side.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* Fix anchor slugification.

* Spellcheck.

---------

Co-authored-by: Ken Sternberg <[email protected]>
Co-authored-by: Agent <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.

4 participants