From 424b6bcc1f967de0fc155490140b0636633416b9 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Wed, 29 Jun 2022 19:30:24 +0200 Subject: [PATCH] added `getValue` to methods --- packages/app/src/cores/style/index.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/app/src/cores/style/index.jsx b/packages/app/src/cores/style/index.jsx index d445b32e..654adf1f 100644 --- a/packages/app/src/cores/style/index.jsx +++ b/packages/app/src/cores/style/index.jsx @@ -123,6 +123,20 @@ export default class StyleCore extends Core { return app.settings.get("themeVariant") } + getValue = (key) => { + if (typeof key === "undefined") { + return { + ...staticValues, + ...storagedModifications + } + } + + const storagedModifications = this.getStoragedModifications() + const staticValues = this.theme.staticVars + + return storagedModifications[key] || staticValues[key] + } + setVariant = (variationKey) => { return app.settings.set("themeVariant", variationKey) }