diff --git a/src/components/Settings/CustomThemeMaker.vue b/src/components/Settings/CustomThemeMaker.vue index 08fc3a0b..30614d30 100644 --- a/src/components/Settings/CustomThemeMaker.vue +++ b/src/components/Settings/CustomThemeMaker.vue @@ -31,6 +31,9 @@ /> +

+ Export Custom Variables +

Reset Styles for '{{ themeToEdit }}'

@@ -101,6 +104,15 @@ export default { this.customColors = this.makeInitialData(mainCssVars); this.saveChanges(); }, + exportToClipboard() { + const themeName = this.themeToEdit.replace(/^\w/, c => c.toUpperCase()); + let clipboardText = `// Custom Colors for ${themeName}\n`; + Object.keys(this.customColors).forEach((customVar) => { + clipboardText += (`--${customVar}: ${this.customColors[customVar]};\n`); + }); + navigator.clipboard.writeText(clipboardText); + this.$toasted.show(`Theme data for ${themeName} copied to clipboard`); + }, /* Returns a JSON object, with the variable name as key, and color as value */ makeInitialData(variableArray) { const data = {}; @@ -168,6 +180,7 @@ export default {