mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
lighter node style of note map in dark theme
This commit is contained in:
parent
eecba725b0
commit
5938e033d4
@ -45,6 +45,9 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
|
||||||
|
const documentStyle = window.getComputedStyle(document.documentElement);
|
||||||
|
this.themeStyle = documentStyle.getPropertyValue('--theme-style')?.trim();
|
||||||
|
|
||||||
this.$container = this.$widget.find(".note-map-container");
|
this.$container = this.$widget.find(".note-map-container");
|
||||||
this.$styleResolver = this.$widget.find('.style-resolver');
|
this.$styleResolver = this.$widget.find('.style-resolver');
|
||||||
|
|
||||||
@ -156,7 +159,14 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
let colour = '#';
|
let colour = '#';
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
const value = (hash >> (i * 8)) & 0xFF;
|
let value = (hash >> (i * 8)) & 0xFF;
|
||||||
|
|
||||||
|
console.log("this.themeStyle", this.themeStyle);
|
||||||
|
|
||||||
|
if (this.themeStyle === "dark" && value < 128) {
|
||||||
|
value += 128; // lighten up the colors
|
||||||
|
}
|
||||||
|
|
||||||
colour += ('00' + value.toString(16)).substr(-2);
|
colour += ('00' + value.toString(16)).substr(-2);
|
||||||
}
|
}
|
||||||
return colour;
|
return colour;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
:root {
|
:root {
|
||||||
|
--theme-style: dark;
|
||||||
|
|
||||||
--main-font-family: MontserratLight;
|
--main-font-family: MontserratLight;
|
||||||
--main-font-size: normal;
|
--main-font-size: normal;
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
value from this theme will be used. For this reason this theme uses "html" instead of ":root"
|
value from this theme will be used. For this reason this theme uses "html" instead of ":root"
|
||||||
since it's less "specific" and thus serves as default */
|
since it's less "specific" and thus serves as default */
|
||||||
html {
|
html {
|
||||||
|
/* either light or dark, colored theme with darker tones are also dark, used e.g. for note map node colors */
|
||||||
|
--theme-style: light;
|
||||||
|
|
||||||
--main-font-family: MontserratLight;
|
--main-font-family: MontserratLight;
|
||||||
--main-font-size: normal;
|
--main-font-size: normal;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user