Preact (Vite)
Boss CSS ships with a Preact + Vite sample in test/sample/preact-base/.
1) PostCSS
// postcss.config.js
module.exports = {
plugins: {
'boss-css/postcss': {},
autoprefixer: {},
},
}
2) Import the runtime
Import the generated runtime once near the entry:
// src/index.tsx
import './.bo$$'
3) Use $$
export function App() {
return (
<>
<$$ color="blue">Hello world!!!!</$$>
<$$.Prepped>Prepped</$$.Prepped>
</>
)
}