mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-23 13:45:33 +02:00
👔 Adds theme selector to config css menu
This commit is contained in:
parent
ebbfe58cfd
commit
7e6cce8828
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="css-editor-outer">
|
<div class="css-editor-outer">
|
||||||
<!-- Add raw custom CSS -->
|
<!-- Add raw custom CSS -->
|
||||||
<div class="css-wrapper">
|
<div class="style-section css-wrapper">
|
||||||
<h2 class="css-input-title">Custom CSS</h2>
|
<h3>Custom CSS</h3>
|
||||||
<textarea class="css-editor" v-model="customCss" />
|
<textarea class="css-editor" v-model="customCss" />
|
||||||
<Button class="save-button" :click="save">{{ $t('config.css-save-btn') }}</Button>
|
<Button class="save-button" :click="save">{{ $t('config.css-save-btn') }}</Button>
|
||||||
<p class="quick-note">
|
<p class="quick-note">
|
||||||
@ -10,24 +10,31 @@
|
|||||||
{{ $t('config.css-note-l1') }} {{ $t('config.css-note-l2') }} {{ $t('config.css-note-l3') }}
|
{{ $t('config.css-note-l1') }} {{ $t('config.css-note-l2') }} {{ $t('config.css-note-l3') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Theme Selector -->
|
||||||
|
<div class="style-section base-theme-wrapper">
|
||||||
|
<h3>Base Theme</h3>
|
||||||
|
<ThemeSelector :hidePallete="true" />
|
||||||
|
</div>
|
||||||
<!-- UI color configurator -->
|
<!-- UI color configurator -->
|
||||||
<CustomThemeMaker :themeToEdit="currentTheme" class="color-config" />
|
<div class="style-section">
|
||||||
|
<CustomThemeMaker :themeToEdit="currentTheme" class="color-config" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import CustomThemeMaker from '@/components/Settings/CustomThemeMaker';
|
import CustomThemeMaker from '@/components/Settings/CustomThemeMaker';
|
||||||
|
import ThemeSelector from '@/components/Settings/ThemeSelector';
|
||||||
import Button from '@/components/FormElements/Button';
|
import Button from '@/components/FormElements/Button';
|
||||||
import StoreKeys from '@/utils/StoreMutations';
|
import StoreKeys from '@/utils/StoreMutations';
|
||||||
import { InfoHandler } from '@/utils/ErrorHandler';
|
|
||||||
import { localStorageKeys, theme as defaultTheme } from '@/utils/defaults';
|
import { localStorageKeys, theme as defaultTheme } from '@/utils/defaults';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'StyleEditor',
|
name: 'StyleEditor',
|
||||||
components: {
|
components: {
|
||||||
Button,
|
Button,
|
||||||
|
ThemeSelector,
|
||||||
CustomThemeMaker,
|
CustomThemeMaker,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -77,7 +84,6 @@ export default {
|
|||||||
/* Show success toast and lot update */
|
/* Show success toast and lot update */
|
||||||
showSuccessMsg() {
|
showSuccessMsg() {
|
||||||
this.$toasted.show('Changes saved successfully');
|
this.$toasted.show('Changes saved successfully');
|
||||||
InfoHandler('User syles has been saved', 'Custom CSS');
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -92,24 +98,29 @@ div.css-editor-outer {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
|
.style-section {
|
||||||
|
padding: 1rem;
|
||||||
|
&:not(:last-child) { border-bottom: 1px dashed var(--config-settings-color); }
|
||||||
|
h3 {
|
||||||
|
font-size: 1.4rem;
|
||||||
|
margin: 0.5rem 0 0.2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
div.css-wrapper {
|
div.css-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
h2.css-input-title {
|
|
||||||
margin: 0.5rem 0 0.2rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save button
|
// Save button
|
||||||
button.save-button{
|
button.save-button {
|
||||||
background: var(--config-settings-color);
|
background: var(--config-settings-background);
|
||||||
color: var(--config-settings-background);
|
color: var(--config-settings-color);
|
||||||
border: 1px solid var(--config-settings-background);
|
border: 1px solid var(--config-settings-color);
|
||||||
&:hover:not(:disabled) {
|
&:hover:not(:disabled) {
|
||||||
background: var(--config-settings-background);
|
background: var(--config-settings-color);
|
||||||
color: var(--config-settings-color);
|
color: var(--config-settings-background);
|
||||||
border-color: var(--config-settings-color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,14 +154,38 @@ p.quick-note {
|
|||||||
border-radius: var(--curve-factor);
|
border-radius: var(--curve-factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Base Theme Selector
|
||||||
|
.base-theme-wrapper {
|
||||||
|
span.theme-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
div.vs__dropdown-toggle {
|
||||||
|
border-color: var(--config-settings-color);
|
||||||
|
min-width: 16rem;
|
||||||
|
max-width: 32rem;
|
||||||
|
height: 2.4rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
margin: 0.5rem;
|
||||||
|
}
|
||||||
|
ul.vs__dropdown-menu {
|
||||||
|
min-width: 16rem;
|
||||||
|
max-width: 32rem;
|
||||||
|
background: var(--config-settings-background);
|
||||||
|
border-top: 1px solid var(--config-settings-color);
|
||||||
|
}
|
||||||
|
li.vs__dropdown-option--highlight {
|
||||||
|
background: var(--config-settings-color);
|
||||||
|
color: var(--config-settings-background);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Theme editor
|
// Theme editor
|
||||||
.color-config.theme-configurator-wrapper {
|
.color-config.theme-configurator-wrapper {
|
||||||
border: 1px solid var(--config-settings-color);
|
|
||||||
background: var(--config-settings-background);
|
background: var(--config-settings-background);
|
||||||
color: var(--config-settings-color);
|
color: var(--config-settings-color);
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
max-width: 24rem;
|
max-width: 32rem;
|
||||||
margin: 1rem auto;
|
margin: 1rem auto;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
right: 0;
|
right: 0;
|
||||||
@ -160,6 +195,12 @@ p.quick-note {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
max-height: unset;
|
max-height: unset;
|
||||||
}
|
}
|
||||||
|
.misc-input {
|
||||||
|
width: 6rem;
|
||||||
|
}
|
||||||
|
.misc-input.long-input {
|
||||||
|
width: 18rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<IconPalette
|
<IconPalette
|
||||||
|
v-if="!hidePallete"
|
||||||
class="color-button"
|
class="color-button"
|
||||||
@click="openThemeConfigurator"
|
@click="openThemeConfigurator"
|
||||||
v-tooltip="$t('theme-maker.title')"
|
v-tooltip="$t('theme-maker.title')"
|
||||||
@ -38,6 +39,9 @@ import IconPalette from '@/assets/interface-icons/config-color-palette.svg';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ThemeSelector',
|
name: 'ThemeSelector',
|
||||||
|
props: {
|
||||||
|
hidePallete: Boolean,
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
CustomThemeMaker,
|
CustomThemeMaker,
|
||||||
IconPalette,
|
IconPalette,
|
||||||
|
@ -20,6 +20,7 @@ const KEY_NAMES = [
|
|||||||
'REMOVE_ITEM',
|
'REMOVE_ITEM',
|
||||||
'INSERT_ITEM',
|
'INSERT_ITEM',
|
||||||
'UPDATE_CUSTOM_CSS',
|
'UPDATE_CUSTOM_CSS',
|
||||||
|
'CONF_MENU_INDEX',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Convert array of key names into an object, and export
|
// Convert array of key names into an object, and export
|
||||||
|
Loading…
x
Reference in New Issue
Block a user