global_css source file containing @import "tailwindcss";. Tailwind CSS 4 is already installed and integrated into Cactal’s website compiler, so there is no package installation or JavaScript configuration. Keep the import for Tailwind utilities and preflight, or remove it to use plain CSS without Tailwind’s preflight.
Add global CSS
Theglobal_css singleton contains raw site-wide CSS:
global_css
<head>. Modern CSS nesting, custom properties, media queries, keyframes, and standard at-rules are supported.
Upsert it like any other singleton:
Set global CSS
Enable or disable Tailwind CSS
New sites are already enabled by the visible Tailwind import at the top ofglobal_css:
global_css
pages/home
Class discovery
At build time, Cactal scans the website’s TSX source, including pages, components, and the custom not-found page. It recognizes complete class candidates in source strings, including variants, arbitrary values, important modifiers, and negative utilities.global_css.
Define a theme
Tailwind CSS 4 theme variables work directly inglobal_css:
global_css
bg-brand-500, font-display, and animate-fade-in when the utilities appear in scanned source.
You can combine Tailwind layers with ordinary selectors:
Use assets and fonts
Upload a font as afile asset. Begin the upload with the font’s canonical MIME type and exact byte size:
Begin the font upload
upload.url, method, and headers to send the raw bytes, then finalize the returned asset id:
Upload and finalize
@font-face or url(...):
application/octet-stream or with a legacy font MIME alias are stored with their canonical font MIME type. Fetch the current ready URL with GET /v1/websiteAssets/{assetId}. See Upload assets for the full upload flow.
Prefer absolute HTTPS or root-relative URLs. Because Cactal embeds site CSS in every page, a relative URL such as images/hero.png resolves relative to the requested page path and can break on nested routes.
Imports and plugins
@import "tailwindcss" is the only CSS import the compiler resolves. Local file imports, package CSS imports, and other import specifiers fail the framework quality gate.
Remote stylesheet imports such as @import url("https://fonts.googleapis.com/css2?family=Fraunces") are not resolved at build time and do not fail the gate. Placed above @import "tailwindcss", they pass through to the compiled stylesheet and the browser loads them at runtime. Placed after it, they are silently removed from the compiled output because the Tailwind import expands into regular rules and CSS requires every @import to precede other rules. For web fonts, prefer preconnect and stylesheet <link> tags in custom_head_start (the browser discovers them earlier than a CSS import) or a self-hosted @font-face as shown above. See Customize site-wide files for the head injection points.
Tailwind JavaScript configuration files and @plugin modules are not part of the website source model. Use CSS-first Tailwind configuration such as @theme, authored CSS, and keyframes in global_css.
Build behavior
The website build:- Scans website TSX source for Tailwind candidates.
- Compiles
global_css, loading Tailwind only when requested. - Generates utilities for discovered candidates.
- Optimizes, prefixes, and minifies the final stylesheet.
- Embeds the stylesheet before
custom_head_endcontent.
head/check and publish. The previous published deployment remains live when a new build fails.
Troubleshooting
Next steps
- Build pages with CMS data for the page and render API
- Customize site-wide files for custom HTML slots and the not-found page
- Edit source code for leases and singleton upserts
- Preview drafts and versions before publishing visual changes