包文件→ .shtukbase/packages/shtukbase-style/lib/stylelib.ts
lib/stylelib.ts
17 行, 872 B.
文件按包中的原样显示:代码及其注释不做翻译。
- // Shared by the actions and checks of shtukbase-style. The working directory is the project root.
- // The style lives in /design/shtukbase-style/. Its CSS is built with the library of the design-tokens package
- // (`styleConfig` of a style package: tokens.json and tokens.dark.json into tokens.css, dark on `.dark, [data-theme="dark"]`).
- import { build, styleConfig } from '../../design-tokens/actions/tokenslib.ts';
- export const ID = 'shtukbase-style';
- export const DIR = `design/${ID}`;
- export const TOKENS = `${DIR}/tokens.json`;
- export const DARK = `${DIR}/tokens.dark.json`;
- export const CSS = `${DIR}/tokens.css`;
- export type Built = { text: string; problems: string[] };
- /** The tokens.css that the tokens of the style give now (or the problems of the tokens). */
- export function buildStyle(root = process.cwd()): Built {
- return build(root, styleConfig(ID));
- }