mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
fix setting color-scheme css property
This commit is contained in:
@@ -5,10 +5,6 @@ let socket;
|
|||||||
|
|
||||||
// Document ready function
|
// Document ready function
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches
|
|
||||||
? "light"
|
|
||||||
: "dark";
|
|
||||||
$(":root").css("color-scheme", systemTheme);
|
|
||||||
var defaultTheme = "blender";
|
var defaultTheme = "blender";
|
||||||
var theme = localStorage.getItem("theme") || defaultTheme;
|
var theme = localStorage.getItem("theme") || defaultTheme;
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
@@ -276,6 +272,7 @@ function displayDrawingsNames(blenderId, ifcFile) {
|
|||||||
|
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
$("html").removeClass("light dark blender").addClass(theme);
|
$("html").removeClass("light dark blender").addClass(theme);
|
||||||
|
$(":root").css("color-scheme", theme);
|
||||||
if (theme === "light") {
|
if (theme === "light") {
|
||||||
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
|
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
|
||||||
} else if (theme === "dark") {
|
} else if (theme === "dark") {
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ const pageSizes = [
|
|||||||
|
|
||||||
// Document ready function
|
// Document ready function
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches
|
|
||||||
? "light"
|
|
||||||
: "dark";
|
|
||||||
$(":root").css("color-scheme", systemTheme);
|
|
||||||
var defaultTheme = "blender";
|
var defaultTheme = "blender";
|
||||||
var theme = localStorage.getItem("theme") || defaultTheme;
|
var theme = localStorage.getItem("theme") || defaultTheme;
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
@@ -438,6 +434,7 @@ function editValue(list, task, event, cell, column) {
|
|||||||
|
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
$("html").removeClass("light dark blender").addClass(theme);
|
$("html").removeClass("light dark blender").addClass(theme);
|
||||||
|
$(":root").css("color-scheme", theme);
|
||||||
if (theme === "light") {
|
if (theme === "light") {
|
||||||
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
|
$("#toggle-theme").html('<i class="fas fa-sun"></i>');
|
||||||
} else if (theme === "dark") {
|
} else if (theme === "dark") {
|
||||||
|
|||||||
@@ -5,10 +5,6 @@ let socket;
|
|||||||
|
|
||||||
// Document ready function
|
// Document ready function
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches
|
|
||||||
? "light"
|
|
||||||
: "dark";
|
|
||||||
$(":root").css("color-scheme", systemTheme);
|
|
||||||
var defaultTheme = "blender";
|
var defaultTheme = "blender";
|
||||||
var theme = localStorage.getItem("theme") || defaultTheme;
|
var theme = localStorage.getItem("theme") || defaultTheme;
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
@@ -313,6 +309,7 @@ function compareHeaders(headers1, headers2) {
|
|||||||
|
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
$("html").removeClass("light dark blender").addClass(theme);
|
$("html").removeClass("light dark blender").addClass(theme);
|
||||||
|
$(":root").css("color-scheme", theme);
|
||||||
var stylesheet = $("#tabulator-stylesheet");
|
var stylesheet = $("#tabulator-stylesheet");
|
||||||
if (theme === "light") {
|
if (theme === "light") {
|
||||||
stylesheet.attr(
|
stylesheet.attr(
|
||||||
|
|||||||
Reference in New Issue
Block a user