2026-08-04 15:38:26 +02:00
|
|
|
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';";
|
2026-08-04 15:44:55 +02:00
|
|
|
const componentStyles = source
|
|
|
|
|
.split(/\r?\n/)
|
|
|
|
|
.filter((line) => line.trim() !== tokenImport)
|
|
|
|
|
.join('\n')
|
|
|
|
|
.trimStart();
|
2026-08-04 15:38:26 +02:00
|
|
|
|
|
|
|
|
await writeFile(
|
|
|
|
|
new URL('../shared-styles.css', import.meta.url),
|
|
|
|
|
`@import './packages/design-tokens/theme.css';\n\n${componentStyles}`,
|
|
|
|
|
'utf8'
|
|
|
|
|
);
|