diff --git a/changedetectionio/static/styles/scss/parts/_darkmode.scss b/changedetectionio/static/styles/scss/parts/_darkmode.scss new file mode 100644 index 00000000..a9719d3c --- /dev/null +++ b/changedetectionio/static/styles/scss/parts/_darkmode.scss @@ -0,0 +1,25 @@ + +#toggle-light-mode { + width: 3rem; + /* default */ + .icon-dark { + display: none; + } + +} + +html[data-darkmode="true"] { + #toggle-light-mode { + .icon-light { + display: none; + } + + .icon-dark { + display: block; + } + } +} + + + + diff --git a/changedetectionio/static/styles/scss/styles.scss b/changedetectionio/static/styles/scss/styles.scss index 90b0ffd4..479837e8 100644 --- a/changedetectionio/static/styles/scss/styles.scss +++ b/changedetectionio/static/styles/scss/styles.scss @@ -8,6 +8,7 @@ @import "parts/_pagination"; @import "parts/_spinners"; @import "parts/_variables"; +@import "parts/_darkmode"; body { color: var(--color-text); @@ -54,22 +55,6 @@ a.github-link { } } -#toggle-light-mode { - width: 3rem; - .icon-dark { - display: none; - } - - &.dark { - .icon-light { - display: none; - } - - .icon-dark { - display: block; - } - } -} #toggle-search { width: 2rem; diff --git a/changedetectionio/static/styles/styles.css b/changedetectionio/static/styles/styles.css index d4b97ea8..396ae65f 100644 --- a/changedetectionio/static/styles/styles.css +++ b/changedetectionio/static/styles/styles.css @@ -316,6 +316,18 @@ html[data-darkmode="true"] { html[data-darkmode="true"] .watch-table .unviewed.error { color: var(--color-watch-table-error); } +#toggle-light-mode { + width: 3rem; + /* default */ } + #toggle-light-mode .icon-dark { + display: none; } + +html[data-darkmode="true"] #toggle-light-mode .icon-light { + display: none; } + +html[data-darkmode="true"] #toggle-light-mode .icon-dark { + display: block; } + body { color: var(--color-text); background: var(--color-background-page); } @@ -350,15 +362,6 @@ a.github-link { a.github-link:hover { color: var(--color-icon-github-hover); } -#toggle-light-mode { - width: 3rem; } - #toggle-light-mode .icon-dark { - display: none; } - #toggle-light-mode.dark .icon-light { - display: none; } - #toggle-light-mode.dark .icon-dark { - display: block; } - #toggle-search { width: 2rem; }