Fix branding not applying: move CSS vars out of @theme, inject after Tailwind
Tailwind v4's @theme block outputs CSS that came after the tenant theme
<style> tag, causing the defaults to win by source order. Two fixes:
- Move custom property defaults from @theme {} to :root {} so they're
at the same cascade level as tenant overrides
- Inject tenant CSS before </head> instead of after <head> so it comes
after all Tailwind output in the cascade
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -63,7 +63,7 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
|
||||
const response = await resolve(event, {
|
||||
transformPageChunk: tenantCSS
|
||||
? ({ html }) => html.replace('<head>', `<head>${tenantCSS}`)
|
||||
? ({ html }) => html.replace('</head>', `${tenantCSS}</head>`)
|
||||
: undefined
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user