Why Boss CSS
Boss CSS is a styling engine with two authoring inputs, multiple output strategies, and an optional compile step.
A tiny taste
import '../.bo$$'
export default function Hero() {
return (
<$$
display="flex"
gap={12}
hover={{ color: 'white', backgroundColor: 'black' }}
at={{ 'mobile+': { fontSize: 18 } }}
>
Inline + class output
</$$>
)
}
The product shape
Think about Boss in three layers:
- Authoring inputs
$$JSX props- Static
className/classtokens
- Output strategies
inline-firstclassname-firstclassname-onlyruntime
- Build modes
- PostCSS
npx boss-css build/watch- optional
npx boss-css compile
That separation matters:
classname-onlyis the static className lane. It is not the whole no-generated-runtime story.runtimeis the runtime strategy plugin. It is not the same thing as the generated runtime files.compileis an optional source-rewrite step. It is not a strategy.
Features at a glance
- Two authoring inputs: use
$$JSX props or staticclassName/classtokens. - Multiple output strategies: choose inline-heavy, class-heavy, static-class-only, or browser-evaluated output.
- Generated runtime + types: Boss writes
.bo$$/index.jsand.bo$$/index.d.tsfor strategies that use JSX authoring. - Usage-driven CSS: only used rules are emitted into
.bo$$/styles.cssand optional boundary files. - Optional compile step: rewrite supported JSX ahead of your app build when you want source transforms.
- Tokens + theming: typed token access with
$$.token. - Bosswind mode: Tailwind-like aliases on top of the same engine.
- Tooling agnostic: use PostCSS, CLI build/watch, or your own build orchestration.
- CSS boundaries: split CSS by directory without changing authoring.
- AI + devtools: generated agent context, runtime inspection, and linting support.
What Boss generates
Boss writes generated outputs. It does not expect you to hand-edit them.
.bo$$/index.jsand.bo$$/index.d.tsare the generated runtime forinline-first,classname-first, andruntime..bo$$/styles.cssand any*.boss.cssfiles contain generated CSS for build/watch/PostCSS flows.classname-onlyskips the generated runtime files and only emits CSS.- In
runtime.only, Boss skips server strategy CSS and only emitsstyles.csswhenruntime.globals: 'file'. - In compile temp mode, transformed source files and generated CSS are mirrored under
compile.tempOutDir.
Ideal use cases
Boss CSS works well when you need:
- Typed styling without committing the whole project to one authoring style.
- A JSX prop lane for component work and a static class string lane for templates or utility-style code.
- Strategy choices based on output trade-offs instead of rewriting every component.
- Browser-evaluated values when needed, without making every page pay that cost.
- A build step that can stay framework-agnostic.
Learn the model
For the full mental model, read: