Skip to content

Commit 8e4147e

Browse files
committed
Dark mode
This provides a lightweight dark mode. This is a work in progress. There's darker styles when the operating system is in dark mode. If you would like to try it out I am currently applying this patch in my [home assistant addon][ha-addon]. closes #580 Screenshots ----------- ![image](https://github.com/user-attachments/assets/56a66d64-b6e6-4dea-b1dd-5c5d40440f6f) ![Image](https://github.com/user-attachments/assets/899a76b5-8a9a-4a8a-8963-b3bdd267985a) ![Image](https://github.com/user-attachments/assets/c3acdc84-e44e-4374-af04-e5fa1b3e2e46) ![Image](https://github.com/user-attachments/assets/f37d0dd3-2970-4b27-8163-5894956b248d) ![image](https://github.com/user-attachments/assets/968e14ca-445b-4abd-89c8-69bd143e93a0) ![Image](https://github.com/user-attachments/assets/d0000ce5-0325-480d-be98-3dd0f5dcafe2) [ha-addon]: https://github.com/samrocketman/addons-homeassistant/
1 parent 2fdafd3 commit 8e4147e

File tree

4 files changed

+86
-1
lines changed

4 files changed

+86
-1
lines changed

custom/css/darkmode.css

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
@media (prefers-color-scheme: dark) {
2+
body, body.login-page, div.info-box {
3+
background-color: #343a40;
4+
color: #ffffff;
5+
}
6+
.main-header, .main-sidebar, .control-sidebar {
7+
background-color: #212529;
8+
color: #ffffff;
9+
}
10+
.content-wrapper {
11+
background-color: #495057;
12+
}
13+
/* Add more style overrides for other AdminLTE elements as needed */
14+
.card {
15+
background-color: #343a40;
16+
color: #ffffff;
17+
}
18+
.card-header {
19+
background-color: #212529;
20+
color: #ffffff;
21+
}
22+
a {
23+
color: #bb86fc;
24+
}
25+
a:hover {
26+
color: #3700b3;
27+
}
28+
.modal-content {
29+
background-color: #212529;
30+
color: #ffffff;
31+
}
32+
/* Example for table elements */
33+
.table {
34+
color: #ffffff;
35+
}
36+
.table thead th {
37+
border-bottom-color: #6c757d;
38+
color: #ffffff;
39+
}
40+
.table-bordered, .table-bordered td, .table-bordered th {
41+
border-color: #6c757d;
42+
}
43+
.table-striped tbody tr:nth-of-type(odd) {
44+
background-color: rgba(255, 255, 255, 0.05);
45+
}
46+
/* input boxes */
47+
.modal-content > input, .modal-content > input::placeholder, div.tagsinput, .modal-content > select, input.form-control {
48+
background-color: #495057;
49+
color: #ffffff;
50+
}
51+
/* login page */
52+
html body.login-page div.login-box div.card div.card-body.login-card-body {
53+
background-color: #202326;
54+
color: #bfbfbf;
55+
}
56+
html body.login-page div.login-box div.card div.card-body.login-card-body form div.row div.col-8 div.icheck-primary label {
57+
color: #0069d9;
58+
}
59+
/* disabled forms */
60+
.form-control:disabled, .form-control[readonly] {
61+
color: #000000;
62+
}
63+
/*
64+
.modal-content > input#client_allowed_ips_tag {
65+
color: #ffffff;
66+
}*/
67+
/* mobile hamburger */
68+
.navbar-light .navbar-nav .nav-link {
69+
color: rgba(255, 255, 255, .75);
70+
}
71+
.navbar-light .navbar-nav .nav-link:focus, .navbar-light .navbar-nav .nav-link:hover {
72+
color: #007bff;
73+
}
74+
html body.login-page div.login-box div.login-logo a {
75+
color: #dc3545;
76+
}
77+
/* subnet range dropdown */
78+
body.sidebar-mini.modal-open span.select2-container.select2-container--default.select2-container--open span.select2-dropdown.select2-dropdown--below span.select2-results ul#select2-subnet_ranges-results.select2-results__options li#select2-subnet_ranges-result-5jm4-DMZ Network.select2-results__option {
79+
color: #000000;
80+
}
81+
}

init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ case $WGUI_MANAGE_RESTART in (1|t|T|true|True|TRUE)
1818
done &
1919
esac
2020

21-
2221
./wg-ui &
22+
trap 'kill 0; exit 0;' SIGTERM INT EXIT
2323
wait $!

templates/base.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
<link rel="stylesheet" href="{{.basePath}}/static/dist/css/adminlte.min.css">
2828
<!-- Google Font: Source Sans Pro -->
2929
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
30+
<!-- Custom css -->
31+
<link rel="stylesheet" href="{{.basePath}}/static/custom/css/darkmode.css">
3032

3133
<!-- START: On page css -->
3234
{{template "top_css" .}}

templates/login.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<link rel="stylesheet" href="{{.basePath}}/static/dist/css/adminlte.min.css">
2121
<!-- Google Font: Source Sans Pro -->
2222
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
23+
<!-- Custom css -->
24+
<link rel="stylesheet" href="{{.basePath}}/static/custom/css/darkmode.css">
2325
</head>
2426

2527
<body class="hold-transition login-page">

0 commit comments

Comments
 (0)