Skip to content

Dark mode #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
body {
background: #f5f5f5;
@media (prefers-color-scheme: light) {
body {
background: #f5f5f5;
}

.drag {
background-color: lightblue;
}

#header {
background: #A0CFFF;
color: #3474A8;
}

.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: #F5F5E7;
}
}

.drag {
background-color: lightblue;
}

#header {
background: #A0CFFF;
color: #3474A8;
@media (prefers-color-scheme: dark) {
body {
background: #1a1a1a;
}

.drag {
background-color: #1e3a5f;
}

#header {
background: #0d3b66;
color: #7ab5e6;
}

.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: #2c2c1e;
}
}

#dropzone {
Expand All @@ -24,10 +49,6 @@ body {
opacity: 0;
}

.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: #F5F5E7;
}

#data {
margin-bottom: 0;
}
Expand Down
16 changes: 15 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,26 @@
gtag('js', new Date());
gtag('config', 'G-N22SYDVQHZ');
</script>
<script>
const darkModeMediaQuery = window.matchMedia(
"(prefers-color-scheme: dark)",
);
function applyTheme() {
if (darkModeMediaQuery.matches) {
document.documentElement.setAttribute("data-bs-theme","dark");
} else {
document.documentElement.setAttribute("data-bs-theme","light");
}
}
darkModeMediaQuery.addEventListener("change", applyTheme);
applyTheme();
</script>
</head>
<body>

<img src="img/icon.png" style="display: none;"/>

<div id="main-container" class="container shadow bg-white">
<div id="main-container" class="container shadow">
<header id="header" class="row align-items-center p-4">
<img src="img/logo.svg" width="54" height="54" class="col-auto p-0" alt="Database logo"/>

Expand Down