Files
romm/frontend/src/plugins/vuetify.ts
zurdi 674ca98c57 feat: add RExpandTransition component for height animations
- Introduced RExpandTransition.vue to animate height changes of wrapped elements using v-if or v-show.
- Added index.ts to export the new RExpandTransition component.
- Updated RList, RListItem, RToolbar, RTooltip, RVirtualScroller components to remove Vuetify references in comments.
- Replaced v-expand-transition with RExpandTransition in Login.vue and Patcher.vue for consistent animation behavior.
- Refactored Scan.vue to manage open panels using a Set for better performance and clarity.
- Updated styles in global.css and tokens.css to improve focus ring visibility and component styling.
- Removed vuetify.ts theme definitions as they are no longer needed.
2026-05-14 15:07:03 +00:00

35 lines
1.1 KiB
TypeScript

import "@mdi/font/css/materialdesignicons.css";
import { useLocalStorage } from "@vueuse/core";
import { createVuetify } from "vuetify";
import { VDateInput } from "vuetify/labs/VDateInput";
import "vuetify/styles";
import { dark, light } from "@/styles/themes";
// Initial theme resolution only — runtime theme changes are owned by
// RomM.vue, which keeps Vuetify's name in sync with user preference.
// v2 surfaces don't read from Vuetify's runtime theme; they read tokens
// off `.r-v2-dark` / `.r-v2-light` on <html>.
function getInitialTheme(): "dark" | "light" {
const storedTheme = useLocalStorage("settings.theme", "auto");
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
if (storedTheme.value === "dark") return "dark";
if (storedTheme.value === "light") return "light";
return prefersDark ? "dark" : "light";
}
const instance = createVuetify({
components: {
VDateInput,
},
icons: {
defaultSet: "mdi",
},
theme: {
defaultTheme: getInitialTheme(),
themes: { dark, light },
},
});
export default instance;