Merhaba xenforo ya karanlık mod özeliği eklemek istiyorum bunu yaparken ayrı ayrı temalar kullanmak istemiyorum zira bu çok anlamsız yapmak istediğim js/css ile bunu yapmak
js
css
kodlar gayet uyumlu çalışıyor sorun benim xenforo renk kodlarını bilmemem bunlara nasıl ulaşırım.
js
JavaScript:
$(function() {
var darkSwitch = document.getElementById("darkSwitch");
if (darkSwitch) {
initTheme();
darkSwitch.addEventListener("change", function(event) {
resetTheme();
});
function initTheme() {
var darkThemeSelected =
localStorage.getItem("darkSwitch") !== null &&
localStorage.getItem("darkSwitch") === "dark";
darkSwitch.checked = darkThemeSelected;
darkThemeSelected
? document.body.setAttribute("data-theme", "dark")
: document.body.removeAttribute("data-theme");
}
function resetTheme() {
if (darkSwitch.checked) {
document.body.setAttribute("data-theme", "dark");
localStorage.setItem("darkSwitch", "dark");
} else {
document.body.removeAttribute("data-theme");
localStorage.removeItem("darkSwitch");
}
}
}
css
CSS:
[data-theme="dark"] {
--dark-color: #323a45;
--color-fff: #000000;
--color-10: #3e5a78;
--color-100: #212121;
--color-200: #262727;
--color-200-s: #262727;
--color-300: #616161;
--color-400: #757575;
--color-500: #8f8f8f;
--color-600: #bdbdbd;
--color-700: #e0e0e0;
--color-800: #eeeeee;
--color-900: #f0f0f0;
--color-000: #ffffff;
--border-color: #494c62;
--border-color-s: #353535;
--card-color: #262727;
--body-color: #383b50;
--white-color: #ffffff;
--sidebar-color: #fcfcfc;
--text-color: #d9dae9;
--text-color-a: #292525;
--hc-font-color: #555555;
--hc-bg-color: rgb(0 0 0 / 10%);
--border-bottom: #494c62;
--main-menu: #323448;
--table-color: #333549;
--bg-color: #333549;
--head-color: #3f4257;
--head-renk: #b46100;
--cell-user: #383b50;
--user-Arrow: #333549;
--Arrow-after: #333549;
--children: #383b50;
--poster: #333549;
--poster-left: #2c2e40;
--ulke: #333549;
--ulke-s: #3f4257;
}
kodlar gayet uyumlu çalışıyor sorun benim xenforo renk kodlarını bilmemem bunlara nasıl ulaşırım.