-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Tailwind update tool and migrate to tailwindcss/vite
Tailwind's `safelist` config is not (yet?) supported in 4.0 so the classes are now referenced from the source code.
- Loading branch information
1 parent
a8d7395
commit 4d3679f
Showing
15 changed files
with
584 additions
and
246 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,45 @@ | ||
const testResultStatusColor = (status: string) => { | ||
export const testResultStatusForegroundColorClass = (status: string) => { | ||
switch (status) { | ||
case "SUCCESSFUL": | ||
return "green"; | ||
return "text-green-600"; | ||
case "ABORTED": | ||
return "yellow"; | ||
return "text-yellow-600"; | ||
case "SKIPPED": | ||
return "sky"; | ||
return "text-sky-600"; | ||
default: | ||
return "red"; | ||
return "text-red-600"; | ||
} | ||
}; | ||
|
||
export default testResultStatusColor; | ||
export const testResultStatusBackgroundColorClasses = (status: string) => { | ||
switch (status) { | ||
case "SUCCESSFUL": | ||
return [ | ||
"border-green-600", | ||
"bg-green-500", | ||
"dark:border-green-500", | ||
"dark:bg-green-600", | ||
]; | ||
case "ABORTED": | ||
return [ | ||
"border-yellow-600", | ||
"bg-yellow-500", | ||
"dark:border-yellow-500", | ||
"dark:bg-yellow-600", | ||
]; | ||
case "SKIPPED": | ||
return [ | ||
"border-sky-600", | ||
"bg-sky-500", | ||
"dark:border-sky-500", | ||
"dark:bg-sky-600", | ||
]; | ||
default: | ||
return [ | ||
"border-red-600", | ||
"bg-red-500", | ||
"dark:border-red-500", | ||
"dark:bg-red-600", | ||
]; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@import 'tailwindcss'; | ||
|
||
@config '../tailwind.config.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,5 @@ | ||
import { defaultIconProps } from "./src/components/common/icon.ts"; | ||
|
||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], | ||
darkMode: "selector", | ||
theme: { | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
safelist: [ | ||
...["red", "green", "yellow", "sky"].flatMap((color) => [ | ||
`border-${color}-600`, | ||
`bg-${color}-500`, | ||
`text-${color}-600`, | ||
`dark:border-${color}-500`, | ||
`dark:bg-${color}-600`, | ||
`dark:border-${color}-500`, | ||
`dark:bg-${color}-600`, | ||
]), | ||
"text-white", | ||
`ml-[${defaultIconProps.size}px]`, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import { defineConfig } from "vite"; | ||
import vue from "@vitejs/plugin-vue"; | ||
import { viteSingleFile } from "vite-plugin-singlefile"; | ||
import tailwindcss from "@tailwindcss/vite"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(({ command }) => { | ||
const defaultPlugins = [vue(), tailwindcss()]; | ||
if (command === "serve") { | ||
return { | ||
plugins: [vue()], | ||
plugins: defaultPlugins, | ||
}; | ||
} else { | ||
// command === 'build' | ||
return { | ||
plugins: [vue(), viteSingleFile()], | ||
plugins: [...defaultPlugins, viteSingleFile()], | ||
}; | ||
} | ||
}); |