feat: 新增 global-dark-text-color 与 global-dark-background-color 主题变量
This commit is contained in:
		
							parent
							
								
									10d404239f
								
							
						
					
					
						commit
						08c2058707
					
				@ -19,7 +19,7 @@ const props = withDefaults(defineProps<LayTimelineProps>(), {
 | 
			
		||||
const timeLineClass = computed(() => [
 | 
			
		||||
  "layui-timeline",
 | 
			
		||||
  props.direction === "horizontal" ? "layui-timeline-horizontal" : "",
 | 
			
		||||
])
 | 
			
		||||
]);
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
 | 
			
		||||
@ -46,8 +46,12 @@ const changeTheme = (theme: string) => {
 | 
			
		||||
        brightness: 100,
 | 
			
		||||
        contrast: 90,
 | 
			
		||||
        sepia: 0,
 | 
			
		||||
        darkSchemeTextColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-text-color"),
 | 
			
		||||
        darkSchemeBackgroundColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-background-color")
 | 
			
		||||
        darkSchemeTextColor: getComputedStyle(
 | 
			
		||||
          document.documentElement
 | 
			
		||||
        ).getPropertyValue("--global-dark-text-color"),
 | 
			
		||||
        darkSchemeBackgroundColor: getComputedStyle(
 | 
			
		||||
          document.documentElement
 | 
			
		||||
        ).getPropertyValue("--global-dark-background-color"),
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        invert: [],
 | 
			
		||||
@ -60,10 +64,10 @@ const changeTheme = (theme: string) => {
 | 
			
		||||
        disableStyleSheetsProxy: false,
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
    localStorage.setItem('layui-vue-theme-dark','true')
 | 
			
		||||
    localStorage.setItem("layui-vue-theme-dark", "true");
 | 
			
		||||
  } else {
 | 
			
		||||
    disableDarkMode();
 | 
			
		||||
    localStorage.setItem('layui-vue-theme-dark','false')
 | 
			
		||||
    localStorage.setItem("layui-vue-theme-dark", "false");
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user