We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
variable
1 parent 73e6db2 commit d680f1fCopy full SHA for d680f1f
packages/core/useCssVar/index.test.ts
@@ -19,6 +19,14 @@ describe('useCssVar', () => {
19
expect(el.style.getPropertyValue(color)).toBe('red')
20
})
21
22
+ it('should work with css variables', () => {
23
+ document.documentElement.style.setProperty('--rootColor', 'red')
24
+
25
+ const colorNoRef = useCssVar('--rootColor')
26
27
+ expect(colorNoRef.value).toBe('red')
28
+ })
29
30
it('should use window.document.documentElement as default element if not set', async () => {
31
const vm = mount(defineComponent({
32
setup() {
packages/core/useCssVar/index.ts
@@ -55,6 +55,7 @@ export function useCssVar(
55
old[0].style.removeProperty(old[1])
56
updateCssVar()
57
},
58
+ { immediate: true },
59
)
60
61
watch(
0 commit comments