import type { Gen } from '@fuzdev/gro'; import { default_themes } from './themes.ts'; import { render_style_variables } from './theme.ts'; import { default_variables } from './variables.ts'; // TODO maybe this should be `base_theme.css` or `base.css` or something /** @nodocs */ export const gen: Gen = ({ origin_path }) => { const banner = `/** * generated by ${origin_path} -- DO NOT EDIT DIRECTLY! * * This file contains all style variables. For optimized output that includes only * the variables your code uses, use the Vite plugin instead: * * import 'virtual:fuz.css'; * * Direct import of this file is for utility-only mode or non-bundled usage. * See: https://css.fuz.dev/docs/setup */`; const theme = default_themes[0]!; // the default theme's variables are the system's defaults, so they render // into the base layer; runtime theme overrides beat them from fuz.theme. // the theme itself is empty (it inherits the defaults), so the full set is // rendered as a variable set - the internal ramp variables included, which // a theme can't carry const theme_style = render_style_variables(default_variables, { comments: true, layer: 'fuz.base' }); return `${banner} /* theme: ${theme.name} */ ${theme_style} ${banner} `; };