bundled_resources.ts

Construction of the bundled CSS resources (style-rule index and variable graph) shared by the Gro generator and the Vite plugin.

The two generators consume these differently - the Gro generator caches one bundle per instance, the Vite plugin loads eagerly at dev-server startup and on first virtual-module access in a build - but build them identically from the same options. This keeps that construction in one place.

view source

Declarations
#

3 declarations

BundledCssResources
#

create_bundled_resources
#

bundled_resources.ts view source

(options: CreateBundledResourcesOptions): Promise<BundledCssResources> import {create_bundled_resources} from '@fuzdev/fuz_css/bundled_resources.js';

Builds the bundled CSS resources from generator options. The style-rule index is always built, even when only theme output is enabled - from the default style.css unless base_css supplies a stylesheet.

options

returns

Promise<BundledCssResources>

throws

  • if - `base_css` supplies something that isn't parseable CSS, including a callback that returns a non-string

CreateBundledResourcesOptions
#

bundled_resources.ts view source

CreateBundledResourcesOptions import type {CreateBundledResourcesOptions} from '@fuzdev/fuz_css/bundled_resources.js';

base_css

Base CSS source: custom string, callback over the default, or default.

type BaseCssOption

variables

Theme variables source.

type VariablesOption

theme?

Optional theme baked into the variables, overlaid last-wins by name.

type Theme | null

deps

Filesystem deps for loading the default style.css.

type CacheDeps

Depends on
#

Imported by
#