Grafex loads external CSS files at render time, which makes it a natural fit for Tailwind CSS. You generate a stylesheet with the Tailwind CLI, pointDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/andresilva-cc/grafex/llms.txt
Use this file to discover all available pages before exploring further.
config.css at it, and Grafex injects it as a <style> tag before the headless browser takes the screenshot. No plugins, no special configuration — just a stylesheet on disk.
Setup
Install dependencies
Add the Tailwind CLI and
concurrently as dev dependencies. concurrently is optional but makes the dev workflow much smoother.Create input.css
Create an
input.css file in your project root. This is the Tailwind entry point that the CLI reads.Generate styles.css
Run the Tailwind CLI once to produce the compiled stylesheet. Tailwind scans your
.tsx files for utility classes and writes only the ones you use.styles.css is a generated file — do not commit it. Add it to .gitignore. When using grafex dev, you don’t even need to generate it up front; Grafex renders without styles initially and re-renders automatically as soon as Tailwind creates the file.Reference styles.css in your composition config
Tell Grafex to load the compiled stylesheet by adding it to
config.css. Paths are resolved relative to the composition file.Write your composition with Tailwind classes
Use Tailwind utility classes on any element via
className. Here is the full source of the Tailwind example that ships with Grafex:Dev workflow
The live preview server watchesstyles.css as a CSS dependency (via config.css). When Tailwind rewrites that file, Grafex detects the change and re-renders within ~100ms — no manual reloads needed.
Two-terminal approach
Open two terminals side by side: one for Tailwind’s watcher, one for the Grafex dev server.http://localhost:3000 in your browser. Edit any class in card.tsx and both tools react automatically.
Single-terminal approach with concurrently
Wire both processes into a singlenpm run dev command so you only need one terminal.