From 4b9a978d28f5b395341f2e422d2d2bdd1ef7e4e4 Mon Sep 17 00:00:00 2001 From: Tyler-A Date: Sun, 2 Aug 2020 16:13:17 -0600 Subject: [PATCH] Add a mixin to be able to fetch the values from CSS variables. --- src/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.js b/src/main.js index 9d0a5c2..52bb176 100644 --- a/src/main.js +++ b/src/main.js @@ -3,6 +3,16 @@ import App from './App.vue'; Vue.config.productionTip = false; +// global mixings +Vue.mixin({ + methods: { + css_var(var_name) { + return getComputedStyle(document.documentElement).getPropertyValue(var_name); + }, + } +}); + + // eslint-disable-next-line const app = new Vue({ render: h => h(App),