DEV Community

Cover image for Did you know st-core.fscss doesn't need a runtime in production?
FSCSS for FSCSS tutorial

Posted on • Originally published at fscss.devtem.org

Did you know st-core.fscss doesn't need a runtime in production?

The <script> tag for FSCSS is a browser compiler- great for development, but optional for production.

You can compile your .fscss file down to plain .css ahead of time. The browser gets standard CSS. No runtime. No wait.


Compile with the CLI

npm install -g fscss
fscss style.fscss style.css
Enter fullscreen mode Exit fullscreen mode

That's it. style.css is now pure clip-path math and CSS variables — no FSCSS runtime needed.


Prefer a GUI? There's a VS Code extension

FSCSS for VS Code gives you:

  • Syntax highlighting for .fscss files
  • Autocomplete + snippets
  • Auto Compile on Save — outputs to filename.fscss.css automatically
  • Command Palette: FSCSS: Compile

Why bother compiling?

Dev (runtime) Prod (compiled)
Setup Drop in a <script> tag One CLI command
Performance JS parses before render Instant CSS render
JS disabled Chart won't show Chart still works
Bundle size Runtime included Zero runtime cost

Repo → github.com/fscss-ttr/st-core.fscss ⭐ MIT

Top comments (0)