Files
shared/scripts/build-root-styles.mjs
T
Gabriel20xx d134d6626a
Lint / Lint (Node/Svelte) (push) Successful in 14s
Lint / Lint (Go) (push) Successful in 15s
Lint / Lint (Python) (push) Successful in 9s
Tests / Test (Node/Svelte) (push) Successful in 12s
Tests / Test (Go) (push) Successful in 15s
Tests / Test (Python) (push) Successful in 9s
Inline shared UI styles for Git consumers
2026-08-04 15:44:55 +02:00

16 lines
514 B
JavaScript

import { readFile, writeFile } from 'node:fs/promises';
const source = await readFile(new URL('../packages/web-ui/dist/styles.css', import.meta.url), 'utf8');
const tokenImport = "@import '@gabriel20xx/design-tokens/theme.css';";
const componentStyles = source
.split(/\r?\n/)
.filter((line) => line.trim() !== tokenImport)
.join('\n')
.trimStart();
await writeFile(
new URL('../shared-styles.css', import.meta.url),
`@import './packages/design-tokens/theme.css';\n\n${componentStyles}`,
'utf8'
);