mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-21 12:45:16 +02:00
🔥 Applies users colors to workspace, fixes spacing on CSS config view, and improves theme reset process
This commit is contained in:
parent
514edcbde9
commit
f5eb8f262c
@ -115,7 +115,7 @@ p.quick-note {
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 24rem;
|
max-width: 24rem;
|
||||||
margin: 2rem auto;
|
margin: 1rem auto;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -99,11 +99,15 @@ export default {
|
|||||||
this.customColors = this.makeInitialData(mainCssVars);
|
this.customColors = this.makeInitialData(mainCssVars);
|
||||||
this.$emit('closeThemeConfigurator');
|
this.$emit('closeThemeConfigurator');
|
||||||
},
|
},
|
||||||
|
/* Resets styles, and removes data for current theme from local storage */
|
||||||
resetAndSave() {
|
resetAndSave() {
|
||||||
|
const priorSettings = JSON.parse(localStorage[localStorageKeys.CUSTOM_COLORS] || '{}');
|
||||||
|
delete priorSettings[this.themeToEdit];
|
||||||
|
localStorage.setItem(localStorageKeys.CUSTOM_COLORS, JSON.stringify(priorSettings));
|
||||||
this.resetUnsavedColors();
|
this.resetUnsavedColors();
|
||||||
this.customColors = this.makeInitialData(mainCssVars);
|
this.$toasted.show(`Custom Colors for ${this.themeToEdit} Removed`);
|
||||||
this.saveChanges();
|
|
||||||
},
|
},
|
||||||
|
/* Generates CSS for the currently applied variables, and copys to users clipboard */
|
||||||
exportToClipboard() {
|
exportToClipboard() {
|
||||||
const themeName = this.themeToEdit.replace(/^\w/, c => c.toUpperCase());
|
const themeName = this.themeToEdit.replace(/^\w/, c => c.toUpperCase());
|
||||||
let clipboardText = `// Custom Colors for ${themeName}\n`;
|
let clipboardText = `// Custom Colors for ${themeName}\n`;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
import SideBar from '@/components/Workspace/SideBar';
|
import SideBar from '@/components/Workspace/SideBar';
|
||||||
import WebContent from '@/components/Workspace/WebContent';
|
import WebContent from '@/components/Workspace/WebContent';
|
||||||
import Defaults from '@/utils/defaults';
|
import Defaults from '@/utils/defaults';
|
||||||
import { ApplyLocalTheme, GetTheme } from '@/utils/ThemeHelper';
|
import { GetTheme, ApplyLocalTheme, ApplyCustomVariables } from '@/utils/ThemeHelper';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Workspace',
|
name: 'Workspace',
|
||||||
@ -22,6 +22,7 @@ export default {
|
|||||||
url: '', // this.$route.query.url || '',
|
url: '', // this.$route.query.url || '',
|
||||||
GetTheme,
|
GetTheme,
|
||||||
ApplyLocalTheme,
|
ApplyLocalTheme,
|
||||||
|
ApplyCustomVariables,
|
||||||
}),
|
}),
|
||||||
components: {
|
components: {
|
||||||
SideBar,
|
SideBar,
|
||||||
@ -32,7 +33,9 @@ export default {
|
|||||||
this.url = url;
|
this.url = url;
|
||||||
},
|
},
|
||||||
setTheme() {
|
setTheme() {
|
||||||
this.ApplyLocalTheme(this.GetTheme());
|
const theme = this.GetTheme();
|
||||||
|
this.ApplyLocalTheme(theme);
|
||||||
|
this.ApplyCustomVariables(theme);
|
||||||
},
|
},
|
||||||
initiateFontAwesome() {
|
initiateFontAwesome() {
|
||||||
const fontAwesomeScript = document.createElement('script');
|
const fontAwesomeScript = document.createElement('script');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user