admin / body

Last active 1 month ago

Like 0

Revision e025822ef2e5d853a84104ace279d4bdf3e43c65

gistfile1.txt Raw
1<script>
2(function() {
3 if (localStorage.getItem("dark_mode") === "on") {
4 document.documentElement.classList.add("dark-mode");
5 document.body.classList.add("dark-mode");
6 document.documentElement.style.background = "#121212";
7 document.body.style.background = "#121212";
8 }
9})();
10</script>
11
12<style>
13
14/* ============================================================
15 GLOBAL ROOT OVERRIDES
16 ============================================================ */
17html.dark-mode,
18body.dark-mode {
19 --body-bg: #121212 !important;
20 --body-color: #e0e0e0 !important;
21
22 --100: #1e1e1e !important;
23 --200: #2a2a2a !important;
24 --300: #333333 !important;
25 --400: #3d3d3d !important;
26 --500: #555555 !important;
27 --600: #777777 !important;
28 --700: #aaaaaa !important;
29 --800: #cccccc !important;
30 --900: #e0e0e0 !important;
31
32 --bg-light: #1e1e1e !important;
33 --color-light: #e0e0e0 !important;
34
35 --navbar-color: #e0e0e0 !important;
36 --navbar-hover-color: #ffffff !important;
37 --navbar-brand-color: #e0e0e0 !important;
38 --navbar-brand-hover-color: #ffffff !important;
39
40 --btn-primary: #4a90e2 !important;
41 --btn-primary-text: #ffffff !important;
42 --btn-primary-border: #4a90e2 !important;
43
44 --btn-secondary: #2a2a2a !important;
45 --btn-secondary-text: #e0e0e0 !important;
46 --btn-secondary-border: #3a3a3a !important;
47
48 --dropdown-bg: #1e1e1e !important;
49 --dropdown-link-color: #e0e0e0 !important;
50 --dropdown-link-hover-color: #ffffff !important;
51 --dropdown-border-color: #3a3a3a !important;
52}
53
54/* ============================================================
55 SAFE GLOBAL TEXT COLOR (NO BADGES / INPUTS / SEARCH / QUIZ)
56 ============================================================ */
57html.dark-mode body *:not(.badge):not(.o_filter_tag):not(.form-control):not(.form-select):not(.o-autocomplete--dropdown-item):not(.o_dropdown_menu):not(i.fa-circle):not(i.fa-check-circle-o):not(button):not(.btn):not(.navbar a):not(.nav-link),
58body.dark-mode body *:not(.badge):not(.o_filter_tag):not(.form-control):not(.form-select):not(.o-autocomplete--dropdown-item):not(.o_dropdown_menu):not(i.fa-circle):not(i.fa-check-circle-o):not(button):not(.btn):not(.navbar a):not(.nav-link) {
59 color: var(--body-color) !important;
60}
61
62/* ============================================================
63 BADGES / FILTER TAGS
64 ============================================================ */
65html.dark-mode .badge,
66body.dark-mode .badge,
67html.dark-mode .o_filter_tag,
68body.dark-mode .o_filter_tag {
69 background: var(--bg-light) !important;
70 color: var(--color-light) !important;
71 border-color: var(--bg-solid, #555) !important;
72}
73
74/* ============================================================
75 QUIZ ICON FIX
76 ============================================================ */
77html.dark-mode .o_wslides_js_lesson_quiz_question .list-group-item input:checked + i.fa-circle,
78body.dark-mode .o_wslides_js_lesson_quiz_question .list-group-item input:checked + i.fa-circle {
79 color: #6A3DFF !important;
80}
81
82/* ============================================================
83 GLOBAL BACKGROUND FIX
84 ============================================================ */
85html.dark-mode,
86body.dark-mode,
87html.dark-mode #wrapwrap,
88body.dark-mode #wrapwrap,
89html.dark-mode #wrapwrap > main,
90body.dark-mode #wrapwrap > main {
91 background-color: #121212 !important;
92 color: #e0e0e0 !important;
93}
94
95/* ============================================================
96 FIX .bg-white OVERRIDES
97 ============================================================ */
98html.dark-mode .bg-white,
99body.dark-mode .bg-white,
100html.dark-mode .bg-100,
101body.dark-mode .bg-100,
102html.dark-mode .bg-200,
103body-dark-mode .bg-200,
104html.dark-mode .bg-300,
105body-dark-mode .bg-300,
106html.dark-mode .bg-400,
107body-dark-mode .bg-400,
108html.dark-mode .bg-500,
109body-dark-mode .bg-500,
110html.dark-mode .bg-600,
111body-dark-mode .bg-600,
112html.dark-mode .bg-700,
113body-dark-mode .bg-700,
114html.dark-mode .bg-800,
115body-dark-mode .bg-800,
116html.dark-mode .bg-900,
117body-dark-mode .bg-900 {
118 background-color: #1e1e1e !important;
119 color: #e0e0e0 !important;
120}
121
122/* ============================================================
123 SLIDES / COURSE CONTENT
124 ============================================================ */
125html.dark-mode .o_wslides_body,
126body-dark-mode .o_wslides_body,
127html.dark-mode .o_wslides_body > #wrapwrap > main,
128body-dark-mode .o_wslides_body > #wrapwrap > main,
129html.dark-mode .o_wslides_course_main,
130body-dark-mode .o_wslides_course_main,
131html.dark-mode .o_wslides_course_main *,
132body-dark-mode .o_wslides_course_main *,
133html.dark-mode .o_wslides_course_sidebar,
134body-dark-mode .o_wslides_course_sidebar,
135html.dark-mode .o_wslides_course_sidebar *,
136body-dark-mode .o_wslides_course_sidebar *,
137html.dark-mode .o_wslides_lesson_content,
138body-dark-mode .o_wslides_lesson_content,
139html.dark-mode .o_wslides_lesson_content *,
140body-dark-mode .o_wslides_lesson_content *,
141html.dark-mode .o_wslides_quiz,
142body-dark-mode .o_wslides_quiz,
143html.dark-mode .o_wslides_quiz *,
144body-dark-mode .o_wslides_quiz * {
145 background-color: #121212 !important;
146 color: #e0e0e0 !important;
147}
148
149/* ============================================================
150 SECTIONS / SNIPPETS
151 ============================================================ */
152html.dark-mode section,
153body-dark-mode section,
154html.dark-mode .s_block,
155body-dark-mode .s_block,
156html.dark-mode .s_text_block,
157body-dark-mode .s_text_block,
158html.dark-mode .s_cover,
159body-dark-mode .s_cover,
160html.dark-mode .s_banner,
161body-dark-mode .s_banner,
162html.dark-mode .s_features,
163body-dark-mode .s_features,
164html.dark-mode .s_call_to_action,
165body-dark-mode .s_call_to_action,
166html.dark-mode .o_panel,
167body-dark-mode .o_panel,
168html.dark-mode .o_cc1,
169body-dark-mode .o_cc1,
170html.dark-mode .o_cc2,
171body-dark-mode .o_cc2,
172html.dark-mode .o_cc3,
173body-dark-mode .o_cc3,
174html.dark-mode .o_cc4,
175body-dark-mode .o_cc4,
176html.dark-mode .o_cc5,
177body-dark-mode .o_cc5 {
178 background-color: #1e1e1e !important;
179 color: #e0e0e0 !important;
180}
181
182/* ============================================================
183 CONTAINERS / CARDS
184 ============================================================ */
185html.dark-mode .container,
186body-dark-mode .container,
187html.dark-mode .row,
188body-dark-mode .row,
189html.dark-mode .card,
190body-dark-mode .card,
191html.dark-mode .card-body,
192body-dark-mode .card-body,
193html.dark-mode .o_panel,
194body-dark-mode .o_panel {
195 background-color: #1e1e1e !important;
196 color: #e0e0e0 !important;
197}
198
199/* ============================================================
200 INPUTS / FORM CONTROLS
201 ============================================================ */
202html.dark-mode input,
203body-dark-mode input,
204html.dark-mode textarea,
205body-dark-mode textarea,
206html.dark-mode select,
207body-dark-mode select,
208html.dark-mode .form-control,
209body-dark-mode .form-control,
210html.dark-mode .form-select,
211body-dark-mode .form-select {
212 background-color: #2a2a2a !important;
213 color: #e0e0e0 !important;
214 border-color: #3a3a3a !important;
215}
216
217/* ============================================================
218 SEARCHBAR RESULTS / AUTOCOMPLETE
219 ============================================================ */
220html.dark-mode .o-autocomplete--dropdown-menu,
221body-dark-mode .o-autocomplete--dropdown-menu,
222html.dark-mode .o_dropdown_menu,
223body-dark-mode .o_dropdown_menu {
224 background-color: #1e1e1e !important;
225 border-color: #3a3a3a !important;
226}
227
228html.dark-mode .o-autocomplete--dropdown-item,
229body-dark-mode .o-autocomplete--dropdown-item,
230html.dark-mode .o_dropdown_menu .dropdown-item,
231body-dark-mode .o_dropdown_menu .dropdown-item {
232 color: #e0e0e0 !important;
233 background-color: transparent !important;
234}
235
236html.dark-mode .o-autocomplete--dropdown-item:hover,
237body-dark-mode .o-autocomplete--dropdown-item:hover,
238html.dark-mode .o_dropdown_menu .dropdown-item:hover,
239body-dark-mode .o_dropdown_menu .dropdown-item:hover {
240 background-color: #2a2a2a !important;
241 color: #ffffff !important;
242}
243
244html.dark-mode .o-autocomplete--dropdown-item *,
245body-dark-mode .o-autocomplete--dropdown-item *,
246html.dark-mode .o_dropdown_menu .dropdown-item *,
247body-dark-mode .o_dropdown_menu .dropdown-item * {
248 color: inherit !important;
249}
250
251/* ============================================================
252 DESKTOP NAVBAR
253 ============================================================ */
254html.dark-mode header,
255body-dark-mode header,
256html.dark-mode .navbar,
257body-dark-mode .navbar,
258html.dark-mode .navbar-light,
259body-dark-mode .navbar-light {
260 background-color: #1e1e1e !important;
261 color: #e0e0e0 !important;
262}
263
264html.dark-mode .navbar a,
265body-dark-mode .navbar a,
266html.dark-mode .navbar-nav .nav-link,
267body-dark-mode .navbar-nav .nav-link {
268 color: #e0e0e0 !important;
269}
270
271html.dark-mode .navbar-nav .nav-link:hover,
272body-dark-mode .navbar-nav .nav-link:hover {
273 color: #ffffff !important;
274}
275
276/* ============================================================
277 MOBILE NAVBAR
278 ============================================================ */
279html.dark-mode .o_navbar_mobile,
280body-dark-mode .o_navbar_mobile {
281 background-color: #1e1e1e !important;
282 color: #e0e0e0 !important;
283}
284
285html.dark-mode .o_menu_toggle,
286body-dark-mode .o_menu_toggle {
287 color: #e0e0e0 !important;
288 filter: invert(1) brightness(2);
289}
290
291html.dark-mode .o_menu_drawer,
292body-dark-mode .o_menu_drawer {
293 background-color: #1e1e1e !important;
294 color: #e0e0e0 !important;
295 backdrop-filter: none !important;
296}
297
298html.dark-mode .o_menu_sections,
299body-dark-mode .o_menu_sections {
300 background-color: #1e1e1e !important;
301}
302
303html.dark-mode .o_nav_entry,
304body-dark-mode .o_nav_entry,
305html.dark-mode .o_menu_item,
306body-dark-mode .o_menu_item {
307 color: #e0e0e0 !important;
308}
309
310html.dark-mode .o_nav_entry:hover,
311body-dark-mode .o_nav_entry:hover,
312html.dark-mode .o_menu_item:hover,
313body-dark-mode .o_menu_item:hover {
314 background-color: #2a2a2a !important;
315 color: #ffffff !important;
316}
317
318html.dark-mode .o_nav_entry.active,
319body-dark-mode .o_nav_entry.active,
320html.dark-mode .o_menu_item.active,
321body-dark-mode .o_menu_item.active {
322 background-color: #4a90e2 !important;
323 color: #ffffff !important;
324}
325
326/* ============================================================
327 DARK MODE MENU LINK
328 ============================================================ */
329a[href="#darkmode"] {
330 display: inline-block !important;
331 padding: .5rem 1rem !important;
332 color: inherit !important;
333}
334
335html.dark-mode a[href="#darkmode"]:hover,
336body-dark-mode a[href="#darkmode"]:hover {
337 color: #ffffff !important;
338}
339
340/* ============================================================
341 HAMBURGER ICON
342 ============================================================ */
343html.dark-mode .navbar-toggler-icon,
344body-dark-mode .navbar-toggler-icon {
345 filter: invert(1) brightness(2);
346}
347
348/* ============================================================
349 FOOTER
350 ============================================================ */
351html.dark-mode footer,
352body-dark-mode footer {
353 background-color: #1e1e1e !important;
354 color: #e0e0e0 !important;
355}
356/* ============================================
357 FINAL OVERRIDE — FIX WHITE DROPDOWN BACKGROUND
358 ============================================ */
359
360html.dark-mode:root,
361body.dark-mode:root {
362 --dropdown-bg: #000000 !important;
363 --dropdown-link-color: #e0e0e0 !important;
364 --dropdown-link-hover-bg: #2a2a2a !important;
365 --dropdown-link-hover-color: #ffffff !important;
366}
367html.dark-mode .dropdown-menu,
368body.dark-mode .dropdown-menu,
369html.dark-mode .o_dropdown_menu,
370body.dark-mode .o_dropdown_menu {
371 background-color: #000000 !important;
372}
373/* ============================================
374 PORTAL CHATTER — JS-INJECTED STYLE OVERRIDE
375 ============================================ */
376
377html.dark-mode .o-mail-Chatter-top,
378html.dark-mode .o-portal-Chatter .o-mail-Chatter-top,
379html.dark-mode .o-mail-Chatter-top.o-mail-Chatter-top,
380html.dark-mode .o-mail-Chatter-top[class],
381html.dark-mode .o-mail-Chatter-top:not([style]) {
382 background-color: #1e1e1e !important;
383 color: #e0e0e0 !important;
384}
385/* ============================================================
386 BOOTSTRAP 5.3 POPOVER + TOOLTIP DARK-MODE FIX
387 ============================================================ */
388
389html.dark-mode,
390body.dark-mode {
391 /* Core BS popover tokens */
392 --bs-popover-bg: #1e1e1e !important;
393 --bs-popover-border-color: #3a3a3a !important;
394 --bs-popover-header-bg: #2a2a2a !important;
395 --bs-popover-header-color: #e0e0e0 !important;
396 --bs-popover-body-color: #e0e0e0 !important;
397 --bs-popover-box-shadow: 0px 4px 16px rgba(0,0,0,0.45) !important;
398
399 /* Tooltip tokens */
400 --bs-tooltip-bg: #2a2a2a !important;
401 --bs-tooltip-color: #e0e0e0 !important;
402}
403
404/* Hard element overrides (Bootstrap injects these dynamically) */
405html.dark-mode .popover,
406body.dark-mode .popover {
407 background-color: var(--bs-popover-bg) !important;
408 border-color: var(--bs-popover-border-color) !important;
409 color: var(--bs-popover-body-color) !important;
410}
411
412html.dark-mode .popover-header,
413body.dark-mode .popover-header {
414 background-color: var(--bs-popover-header-bg) !important;
415 color: var(--bs-popover-header-color) !important;
416 border-bottom-color: var(--bs-popover-border-color) !important;
417}
418
419html.dark-mode .popover-body,
420body.dark-mode .popover-body {
421 color: var(--bs-popover-body-color) !important;
422}
423
424/* Tooltip hard override */
425html.dark-mode .tooltip-inner,
426body.dark-mode .tooltip-inner {
427 background-color: var(--bs-tooltip-bg) !important;
428 color: var(--bs-tooltip-color) !important;
429}
430
431/* ============================================================
432 DARK MODE ALERT FIX — CORRECT COLORS
433 ============================================================ */
434
435html.dark-mode .alert,
436body.dark-mode .alert {
437 background-color: #1e1e1e !important;
438 color: #e0e0e0 !important;
439 border-color: #3a3a3a !important;
440}
441
442/* Danger */
443html.dark-mode .alert-danger,
444body.dark-mode .alert-danger {
445 --alert-bg: #2a1a1a !important;
446 --alert-border-color: #5a2a2a !important;
447 --alert-color: #ffb3b3 !important;
448}
449
450/* Warning */
451html.dark-mode .alert-warning,
452body.dark-mode .alert-warning {
453 --alert-bg: #3a3200 !important;
454 --alert-border-color: #5a4a00 !important;
455 --alert-color: #ffe9a6 !important;
456}
457
458/* Success */
459html.dark-mode .alert-success,
460body.dark-mode .alert-success {
461 --alert-bg: #0f2a1a !important;
462 --alert-border-color: #1f4a2a !important;
463 --alert-color: #b3ffd1 !important;
464}
465
466/* Info */
467html.dark-mode .alert-info,
468body.dark-mode .alert-info {
469 --alert-bg: #0a2a33 !important;
470 --alert-border-color: #0f3a4a !important;
471 --alert-color: #b3ecff !important;
472}
473html.dark-mode .o_wslides_body a.o_wslides_js_quiz_is_correct input:checked + i.fa-check-circle-o,
474body.dark-mode .o_wslides_body a.o_wslides_js_quiz_is_correct input:checked + i.fa-check-circle-o {
475 color: #6A3DFF !important;
476}
477/* ============================================================
478 DARK MODE QUIZ LIST-GROUP — HARD OVERRIDE
479 ============================================================ */
480
481/* Force background + text for quiz answer blocks */
482html.dark-mode .o_wslides_js_lesson_quiz_question .list-group,
483body.dark-mode .o_wslides_js_lesson_quiz_question .list-group {
484 background-color: #232323 !important;
485}
486/* Actual answer rows */
487html.dark-mode .o_wslides_js_lesson_quiz_question .list-group-item,
488body-dark-mode .o_wslides_js_lesson_quiz_question .list-group-item {
489 background-color: #121212 !important;
490 color: #f5f5f5 !important;
491 border-color: #1e1e1e !important;
492}
493
494
495
496</style>
497