File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 1+ from textwrap import dedent
2+
13from django .utils .safestring import mark_safe
24from django .utils .translation import gettext_lazy
35
5355 )
5456 ),
5557 auto_darkmode = Asset .js (
56- children__source = mark_safe ('''
58+ children__source = mark_safe (dedent ( '''
5759 function updateTheme() {
58- document.querySelector("html").setAttribute("data-bs-theme",
59- window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
60+ document.querySelector("html").setAttribute("data-bs-theme", window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
6061 }
6162 window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme)
6263 updateTheme()
63- ''' )
64+ ''' ))
6465 ),
66+ select2_dark_mode = Asset (
67+ tag = 'style' ,
68+ children__source = dedent ('''
69+ [data-bs-theme=dark] .select2-container--default .select2-selection--single,
70+ [data-bs-theme=dark] .select2-container--default .select2-results__option,
71+ [data-bs-theme=dark] .select2-container--default .select2-selection--multiple {
72+ color: white;
73+ background: var(--bs-body-bg);;
74+ }
75+ [data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__choice {
76+ color: white;
77+ background: #444;
78+ }
79+ ''' )
80+ )
6581 ),
6682 Container = dict (
6783 tag = 'div' ,
You can’t perform that action at this time.
0 commit comments