Vite + Tailwind consumer recipe
Brickwork Theme Phase F (icvoss/django-brickwork#601). Copy these files into a consuming Django project, adjust paths, then run the sync command.
Layout
frontend/
css/main.css # this recipe's entry (below)
src/brickwork-theme.css # vendored by sync_brickwork_projection
brands/<slug>/tokens.css # your Brickwork Theme profile (optional)
package.json
vite.config.js
Sync the projection (once per brickwork bump)
python manage.py sync_brickwork_projection frontend/src/brickwork-theme.css
That replaces AgentPM-style hand copies from site-packages. See INTEGRATION.md.
frontend/css/main.css
@import "tailwindcss";
/* Point dark: at brickwork's data-theme axis (not prefers-color-scheme). */
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
@source "../../templates";
@source "../js";
@import "../src/brickwork-theme.css";
/* Optional: your L1 to L4 brand delta (after projection). */
/* @import "../brands/northline/tokens.css"; */
package.json (devDependencies excerpt)
{
"devDependencies": {
"@tailwindcss/vite": "^4.0.0",
"tailwindcss": "^4.0.0",
"vite": "^6.0.0"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"sync:bw-theme": "python manage.py sync_brickwork_projection frontend/src/brickwork-theme.css"
}
}
vite.config.js (minimal)
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [tailwindcss()],
build: {
outDir: "static/dist",
emptyOutDir: true,
rollupOptions: {
input: "frontend/css/main.css",
output: { assetFileNames: "app.css" },
},
},
});
Template cascade
- Shell links
{% static "brickwork/dist/brickwork.css" %}(tokens +.bw-*). head_extralinks your builtapp.css(utilities + brand).- Do not import
brickwork.cssinto Vite; do not dual-link it.
Brand profile depth: THEME.md.