<template>\r
<div class="container mx-auto flex h-screen flex-col px-2 py-4">\r
- <Toast class="ml-[20px]" :pt="toastStyle" position="bottom-right" />\r
+ <Toast position="bottom-right" />\r
<NavBar v-if="showNavBar" :hide-logo="!showNavBarLogo" />\r
<RouterView />\r
</div>\r
const showNavBarLogo = computed(() => {\r
return route.name !== "home";\r
});\r
-\r
-const toastStyle = {\r
- message: "flex flex-col items-end",\r
- container:\r
- "bg-theme-background-elevated border border-theme-border mb-2 px-3 py-2 rounded-lg max-w-96",\r
- icon: "invisible h-0 w-0",\r
- summary: "font-bold",\r
-};\r
</script>\r
<template>
<button
- class="hover:bg-theme-background-hover flex items-center rounded px-2 py-1 text-theme-text-muted"
+ class="hover:bg-theme-background-tint hover:dark:bg-theme-background-elevated flex items-center rounded px-2 py-1 text-theme-text-muted"
>
<SvgIcon
v-if="iconPath"
import App from "/App.vue";\r
import PrimeVue from "primevue/config";\r
-import ToastService from 'primevue/toastservice';\r
+import ToastService from "primevue/toastservice";\r
import { createApp } from "vue";\r
import { createPinia } from "pinia";\r
+import { primeStyles } from "./style.js";\r
import router from "/router.js";\r
\r
const app = createApp(App);\r
app.use(pinia);\r
app.use(PrimeVue, {\r
unstyled: true,\r
+ pt: primeStyles,\r
});\r
app.use(ToastService);\r
app.mount("#app");\r
});\r
\r
function toggleTheme() {\r
- document.body.classList.toggle("dark-theme");\r
+ document.body.classList.toggle("dark");\r
}\r
\r
function logOut() {\r
--theme-background-elevated: 255 255 255;\r
--theme-background-tint: 243 244 245;\r
--theme-background-highlight: 239 243 255;\r
- --theme-background-hover: var(--theme-background-tint);\r
\r
--theme-text: 44 49 57;\r
--theme-text-muted: 136 145 161;\r
--theme-border: 236 238 240;\r
}\r
\r
- body.dark-theme {\r
+ body.dark {\r
/* --theme-brand: 248 166 107; */\r
\r
--theme-background: 34 38 44;\r
--theme-background-elevated: 44 49 57;\r
--theme-background-tint: 34 38 44;\r
--theme-background-highlight: 136 145 161;\r
- --theme-background-hover: var(--theme-background-elevated);\r
\r
--theme-text: 193 199 208;\r
--theme-text-muted: 136 145 161;\r
--- /dev/null
+export const primeStyles = {
+ toast: {
+ message: "flex flex-col items-end ml-[20px]",
+ container: ({ props }) => ({
+ class: [
+ "mt-2 px-3 py-2 rounded-lg max-w-96",
+ "bg-theme-background-elevated border border-l-2 border-theme-border ",
+ {
+ "border-l-theme-success": props.message.severity == "success",
+ "border-l-theme-failure": props.message.severity == "error",
+ },
+ ],
+ }),
+ icon: "invisible h-0 w-0",
+ summary: "font-bold",
+ },
+};
/** @type {import('tailwindcss').Config} */\r
+const colors = require("tailwindcss/colors");\r
\r
module.exports = {\r
content: ["client/**/*.{html,js,vue}"],\r
+ darkMode: "selector",\r
theme: {\r
fontFamily: {\r
sans: ["Poppins", "sans-serif"],\r
},\r
extend: {\r
colors: {\r
+ // Dynamic\r
"theme-brand": "rgb(var(--theme-brand) / <alpha-value>)",\r
"theme-background": "rgb(var(--theme-background) / <alpha-value>)",\r
"theme-background-elevated":\r
"rgb(var(--theme-background-tint) / <alpha-value>)",\r
"theme-background-highlight":\r
"rgb(var(--theme-background-highlight) / <alpha-value>)",\r
- "theme-background-hover":\r
- "rgb(var(--theme-background-hover) / <alpha-value>)",\r
"theme-text": "rgb(var(--theme-text) / <alpha-value>)",\r
"theme-text-muted": "rgb(var(--theme-text-muted) / <alpha-value>)",\r
"theme-text-very-muted":\r
"rgb(var(--theme-text-very-muted) / <alpha-value>)",\r
"theme-shadow": "rgb(var(--theme-shadow) / <alpha-value>)",\r
"theme-border": "rgb(var(--theme-border) / <alpha-value>)",\r
+ // Static\r
+ "theme-success": colors.emerald[500],\r
+ "theme-failure": colors.red[500],\r
},\r
},\r
},\r