Skip to content

Commit

Permalink
Include CSS in build + prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Feb 1, 2025
1 parent d32a3f8 commit 4df2383
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 38 deletions.
3 changes: 2 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"*.ts": ["eslint --fix", "prettier --write"]
"*.ts": ["eslint --fix"],
"*.{ts,css}": ["prettier --write"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"scripts": {
"lint": "eslint \"**/*.ts\"",
"lint:fix": "eslint \"**/*.ts\" --fix",
"format": "prettier --write \"**/*.ts\"",
"format:check": "prettier --check \"**/*.ts\"",
"format": "prettier --write \"**/*.{ts,css}\"",
"format:check": "prettier --check \"**/*.{ts,css}\"",
"test": "tsc --noEmit",
"prepare": "husky",
"prepublishOnly": "tsx script/build.ts"
Expand Down
10 changes: 10 additions & 0 deletions script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
readFile,
stat,
unlink,
copyFile,
} from "node:fs/promises";

import optimize from "./optimize";
Expand Down Expand Up @@ -64,4 +65,13 @@ const processed = new Set(optimized.values());
const files = glob(`${src}/**/*.ts`);
for await (const file of files)
processed.add(await imports(file, file.replace(src, dest), optimized));

const css = glob(`${src}/**/*.css`);
for await (const file of css) {
const path = file.replace(src, dest);
await mkdir(dirname(path), { recursive: true });
await copyFile(file, path);
processed.add(path);
}

await clean(dest, processed);
70 changes: 35 additions & 35 deletions src/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
@import "tailwindcss";

@theme {
--color-alveus-tan: oklch(from #FAEEE6 l c h);
--color-alveus-tan-50: oklch(from #FDFAF7 l c h);
--color-alveus-tan-100: oklch(from #FAEEE6 l c h);
--color-alveus-tan-200: oklch(from #F1CEB7 l c h);
--color-alveus-tan-300: oklch(from #E7AE88 l c h);
--color-alveus-tan-400: oklch(from #DE8F5A l c h);
--color-alveus-tan-500: oklch(from #D56F2B l c h);
--color-alveus-tan-600: oklch(from #A65621 l c h);
--color-alveus-tan-700: oklch(from #773E18 l c h);
--color-alveus-tan-800: oklch(from #49260F l c h);
--color-alveus-tan-900: oklch(from #1A0E05 l c h);

--color-alveus-green: oklch(from #636A60 l c h);
--color-alveus-green-50: oklch(from #E9EBE9 l c h);
--color-alveus-green-100: oklch(from #DFE1DE l c h);
--color-alveus-green-200: oklch(from #CACEC8 l c h);
--color-alveus-green-300: oklch(from #B5BAB3 l c h);
--color-alveus-green-400: oklch(from #A0A79E l c h);
--color-alveus-green-500: oklch(from #8C9388 l c h);
--color-alveus-green-600: oklch(from #777F73 l c h);
--color-alveus-green-700: oklch(from #636A60 l c h);
--color-alveus-green-800: oklch(from #484D45 l c h);
--color-alveus-green-900: oklch(from #2C2F2B l c h);

--color-fall: oklch(from #834A26 l c h);
--color-carnival: oklch(from #4E1362 l c h);
--color-carnival-700: oklch(from #390E47 l c h);
--color-carnival-800: oklch(from #28122F l c h);

--color-twitch: oklch(from #6441A5 l c h);

--color-highlight: oklch(from #FF9F1C l c h);
--color-alveus-tan: oklch(from #faeee6 l c h);
--color-alveus-tan-50: oklch(from #fdfaf7 l c h);
--color-alveus-tan-100: oklch(from #faeee6 l c h);
--color-alveus-tan-200: oklch(from #f1ceb7 l c h);
--color-alveus-tan-300: oklch(from #e7ae88 l c h);
--color-alveus-tan-400: oklch(from #de8f5a l c h);
--color-alveus-tan-500: oklch(from #d56f2b l c h);
--color-alveus-tan-600: oklch(from #a65621 l c h);
--color-alveus-tan-700: oklch(from #773e18 l c h);
--color-alveus-tan-800: oklch(from #49260f l c h);
--color-alveus-tan-900: oklch(from #1a0e05 l c h);

--color-alveus-green: oklch(from #636a60 l c h);
--color-alveus-green-50: oklch(from #e9ebe9 l c h);
--color-alveus-green-100: oklch(from #dfe1de l c h);
--color-alveus-green-200: oklch(from #cacec8 l c h);
--color-alveus-green-300: oklch(from #b5bab3 l c h);
--color-alveus-green-400: oklch(from #a0a79e l c h);
--color-alveus-green-500: oklch(from #8c9388 l c h);
--color-alveus-green-600: oklch(from #777f73 l c h);
--color-alveus-green-700: oklch(from #636a60 l c h);
--color-alveus-green-800: oklch(from #484d45 l c h);
--color-alveus-green-900: oklch(from #2c2f2b l c h);

--color-fall: oklch(from #834a26 l c h);

--color-carnival: oklch(from #4e1362 l c h);
--color-carnival-700: oklch(from #390e47 l c h);
--color-carnival-800: oklch(from #28122f l c h);

--color-twitch: oklch(from #6441a5 l c h);

--color-highlight: oklch(from #ff9f1c l c h);
}

@utility grid-cols-auto-* {
grid-template-columns: repeat(--value(integer, [integer]), auto);
grid-template-columns: repeat(--value(integer, [integer]), auto);
}

@utility grid-rows-auto-* {
grid-template-rows: repeat(--value(integer, [integer]), auto);
grid-template-rows: repeat(--value(integer, [integer]), auto);
}

0 comments on commit 4df2383

Please sign in to comment.