Generated Runtime
Boss CSS generates runtime files inside .bo$$/. These are outputs, not source.
Files
.bo$$/styles.csscontains compiled CSS rules..bo$$/index.jswires the browser runtime and exports$$..bo$$/index.d.tsprovides types for$$and token autocompletion.
Typical runtime output (inline-first / classname-first)
import './styles.css'
import { createApi } from 'boss-css/api/browser'
import { proxy } from 'boss-css/runtime'
import { onBrowserObjectStart as onToken } from 'boss-css/use/token/browser'
import { onBrowserObjectStart as onJsx } from 'boss-css/parser/jsx/browser'
import { onBrowserObjectStart as onStrategy } from 'boss-css/strategy/inline-first/browser'
createApi({
plugins: [
{ onBrowserObjectStart: onToken },
{ onBrowserObjectStart: onJsx },
{ onBrowserObjectStart: onStrategy },
],
})
globalThis.$$ = proxy
export const $$ = proxy
The strategy import is either inline-first or classname-first depending on your config.
Runtime strategy output
When using the runtime strategy, the generated runtime wires a wrapper that selects the correct runtime-only handler at startup:
import { createApi } from 'boss-css/api/browser'
import { proxy } from 'boss-css/runtime'
import { onBrowserObjectStart as onToken } from 'boss-css/use/token/browser'
import { onBrowserObjectStart as onJsx } from 'boss-css/parser/jsx/browser'
import { onInit, onBrowserObjectStart as onRuntime } from 'boss-css/strategy/runtime/runtime-only'
createApi({
selectorPrefix: 'boss-',
selectorScope: '.scope ',
strategy: 'inline-first',
runtime: { only: true, strategy: 'inline-first' },
plugins: [
{ onBrowserObjectStart: onToken },
{ onBrowserObjectStart: onJsx },
{ onInit, onBrowserObjectStart: onRuntime },
],
})
globalThis.$$ = proxy
export const $$ = proxy
Notes:
- In runtime-only mode (
runtime.only: true),.bo$$/index.jsdoes not import./styles.cssunlessruntime.globals: 'file'. - The runtime wrapper initializes the client CSS injector and then dispatches to
inline-first,classname-first, orclassicbased onruntime.strategy. css.autoLoadcontrols whether.bo$$/index.jsimports./styles.css(default:true). Set it tofalsewhen you want to manage CSS yourself.
Do not edit
Any changes to .bo$$/ are overwritten on build. If you need to change output, update the source generators in src/.