From 4df2383b43819434e74404fa69b4a58d81e9f611 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Sat, 1 Feb 2025 17:02:53 +0000 Subject: [PATCH] Include CSS in build + prettier --- .lintstagedrc.json | 3 +- package.json | 4 +-- script/build.ts | 10 +++++++ src/tailwind.css | 70 +++++++++++++++++++++++----------------------- 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index a6328f8..0e66114 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,3 +1,4 @@ { - "*.ts": ["eslint --fix", "prettier --write"] + "*.ts": ["eslint --fix"], + "*.{ts,css}": ["prettier --write"] } diff --git a/package.json b/package.json index 4392f13..4089208 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/script/build.ts b/script/build.ts index 2cd3e3e..8b448a8 100644 --- a/script/build.ts +++ b/script/build.ts @@ -9,6 +9,7 @@ import { readFile, stat, unlink, + copyFile, } from "node:fs/promises"; import optimize from "./optimize"; @@ -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); diff --git a/src/tailwind.css b/src/tailwind.css index eace7e3..4e0b126 100644 --- a/src/tailwind.css +++ b/src/tailwind.css @@ -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); }