mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
docs(components): [watermark] improve text color readability in dark (#23721)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
import { reactive, watch } from 'vue'
|
||||
import { isDark } from '~/composables/dark'
|
||||
|
||||
const config = reactive({
|
||||
content: 'Element Plus',
|
||||
@@ -12,6 +13,16 @@ const config = reactive({
|
||||
gap: [100, 100] as [number, number],
|
||||
offset: [] as unknown as [number, number],
|
||||
})
|
||||
|
||||
watch(
|
||||
isDark,
|
||||
(value) => {
|
||||
config.font.color = value
|
||||
? 'rgba(255, 255, 255, .15)'
|
||||
: 'rgba(0, 0, 0, .15)'
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user