mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-29 01:04:18 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			507 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			507 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Plugin } from "@nuxt/types"
 | |
| import { useDark } from "@vueuse/core";
 | |
| 
 | |
| const darkModePlugin: Plugin = ({ $vuetify }, _) => {
 | |
|   const isDark = useDark();
 | |
| 
 | |
|   // Vuetify metadata is bugged and doesn't render dark mode fully when called immediately
 | |
|   // Adding a 0.5 millisecond delay fixes this problem
 | |
|   // https://stackoverflow.com/questions/69399797/vuetify-darkmode-colors-wrong-after-page-reload
 | |
|   setTimeout( () => { $vuetify.theme.dark = isDark.value; }, 0.5);
 | |
| };
 | |
| 
 | |
| export default darkModePlugin;
 |