-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix-css.mjs
More file actions
30 lines (27 loc) · 814 Bytes
/
fix-css.mjs
File metadata and controls
30 lines (27 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import fs from 'fs';
const file = 'src/app/globals.css';
let content = fs.readFileSync(file, 'utf8');
// Replace @tailwind directives with @import "tailwindcss" and @theme
content = content.replace(
`@tailwind base;
@tailwind components;
@tailwind utilities;`,
`@import "tailwindcss";
@theme {
--color-bg: var(--bg);
--color-fg: var(--fg);
--color-muted: var(--muted);
--color-border: var(--border);
--color-brand: var(--brand);
--color-brand-contrast: var(--brand-contrast);
--color-card: var(--card);
--color-card-fg: var(--card-fg);
--color-accent: var(--accent);
--color-accent-contrast: var(--accent-contrast);
--radius-xl: var(--radius);
--radius-2xl: calc(var(--radius) + 6px);
--shadow-soft: var(--shadow);
--width-screen: var(--maxw);
}`
);
fs.writeFileSync(file, content);