mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
- 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.
35 lines
1.1 KiB
TypeScript
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;
|