Skip to content

web: share one brand CSS style sheet across elements (cherry-pick #27362 to version-2026.8) - #27454

Merged
dominic-r merged 3 commits into
version-2026.8from
cherry-pick/27362-to-version-2026.8
Nov 23, 2026
Merged

dominic-r merged 3 commits into
version-2026.8from
cherry-pick/27362-to-version-2026.8

Conversation

@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

Cherry-pick of #27362 to version-2026.8 branch.

Original PR: #27362
Original Author: @dominic-r
Cherry-picked commit: 4f14fc5

Every AKElement built its own CSSStyleSheet from the brand's custom CSS,
so a page with N elements parsed the brand CSS N times and held N
copies. Lit's sheet cache never hit because createCSSResult wraps the
string in a new strings array each call. This hurts most when the brand
CSS inlines a font or image.

Build the sheet once and have every element and nested shadow root
adopt it. The cache is keyed on the CSS text so a re-read server
context, as injectBrand does in tests, still gets a matching sheet.
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.08%. Comparing base (d83bded) to head (6964282).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@               Coverage Diff               @@
##           version-2026.8   #27454   +/-   ##
===============================================
  Coverage           92.07%   92.08%           
===============================================
  Files                1166     1166           
  Lines               75537    75537           
  Branches             4129     4129           
===============================================
+ Hits                69554    69557    +3     
+ Misses               5917     5914    -3     
  Partials               66       66           
Flag Coverage Δ
conformance 33.55% <ø> (ø)
e2e 38.16% <ø> (+<0.01%) ⬆️
integration 30.22% <ø> (+<0.01%) ⬆️
rust 46.45% <ø> (ø)
unit 93.51% <ø> (+<0.01%) ⬆️
unit-migrate 93.51% <ø> (+<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.

@netlify

netlify Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 6964282
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6aeca20f31c869a6b4de9dfa
😎 Deploy Preview https://deploy-preview-27454--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 Nov 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

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

version-2026.8 has no #common/brand or injectBrand, so the test
imported a module that does not exist on this branch. Write the
server-rendered JSON to window.authentik instead, which globalAK reads
and converts on this branch.
@dominic-r
dominic-r enabled auto-merge (squash) November 5, 2026 15:34
@dominic-r

Copy link
Copy Markdown
Member

Note

🤖 Claude Opus 5.5 responding on behalf of Dominic

Fixed in 9e01870: the backported test imported injectBrand from #common/brand, which does not exist on version-2026.8 (it came to main with #26269). The test now writes the server-rendered brand JSON to window.authentik, which globalAK() reads on this branch. CI didn't catch the bad import because the 2026.8 web test job runs pnpm run test || exit 0.

What I checked:

  • No conflict markers. Base.ts and the test file match web: share one brand CSS style sheet across elements #27362 line for line, apart from that test fix.
  • Merged origin/version-2026.8 in 6964282, with no conflicts. That brings in the docker save cache fix (02a9d19), which caused the earlier test-integration and test-e2e (scim) failures and with them ci-core-mark.
  • I ran no local tests. This run is left to CI.

Status: squash auto-merge is on. Merging still needs an approval from a @goauthentik/frontend code owner, because the existing approval doesn't count toward the code-owner rule.

@dominic-r

Copy link
Copy Markdown
Member

Note

🤖 Claude Opus 5.5 responding on behalf of Dominic

CI is green on 6964282: all four required checks passed, as did test-integration and test-e2e (scim), which failed before the base merge. The only thing blocking the merge is an approval from @goauthentik/frontend, which is already requested. Squash auto-merge is on, so the PR lands once that approval comes in.

@github-actions

github-actions Bot commented Nov 5, 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-6964282901fdb5cb057f5af1b2fe9459ab4455df
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-6964282901fdb5cb057f5af1b2fe9459ab4455df

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

@dominic-r
dominic-r merged commit 09d365f into version-2026.8 Nov 23, 2026
138 checks passed
@dominic-r
dominic-r deleted the cherry-pick/27362-to-version-2026.8 branch November 23, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants