Skip to content

feat: CSS file injection via config.css#38

Merged
andresilva-cc merged 1 commit intomainfrom
feat/tailwind-support
Mar 19, 2026
Merged

feat: CSS file injection via config.css#38
andresilva-cc merged 1 commit intomainfrom
feat/tailwind-support

Conversation

@andresilva-cc
Copy link
Copy Markdown
Contributor

Summary

  • config.css: ['./styles.css'] — load external CSS files into compositions
  • Paths resolved relative to the composition file (not CWD)
  • CSS injected as <style> tags in HTML <head> after base reset and fonts
  • </style> token escaping to prevent early tag termination
  • Zero new dependencies — Tailwind is a documentation recipe, not a code dependency
  • Descriptive error for missing CSS files

Closes #22

Usage

export const config: CompositionConfig = {
  width: 1200,
  height: 630,
  css: ['./styles.css'],
};

export default function Card() {
  return <div className="card"><h1 className="title">Hello</h1></div>;
}

Test plan

  • 228 tests pass (12 new: unit + integration)
  • CSS classes applied correctly in rendered output
  • Missing CSS file throws descriptive error
  • </style> escape protection
  • CLI and library API verified visually

Generic CSS file support — load external stylesheets into compositions.
Paths resolved relative to composition file. Enables Tailwind via
pre-compiled CSS output. </style> escape protection.
Updated docs, README, website, llms-full.txt.
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grafex Ready Ready Preview, Comment Mar 19, 2026 10:31pm

@andresilva-cc andresilva-cc merged commit 173a28f into main Mar 19, 2026
5 checks passed
@andresilva-cc andresilva-cc deleted the feat/tailwind-support branch March 19, 2026 22:32
@andresilva-cc andresilva-cc linked an issue Mar 19, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: className with user-defined CSS classes feat: Tailwind CSS support

1 participant