background-color: background_fill_primary

This commit is contained in:
w-e-w
2024-07-07 00:22:27 +09:00
parent b82caf1322
commit ec580374e5
2 changed files with 45 additions and 1 deletions

View File

@@ -41,7 +41,10 @@ def css_html():
if os.path.exists(user_css):
head += stylesheet(user_css)
head += '<style> html { background-color: #121212; }</style>'
from modules.shared_gradio_themes import resolve_var
light = resolve_var('background_fill_primary')
dark = resolve_var('background_fill_primary_dark')
head += f'<style>html {{ background-color: {light}; }} @media (prefers-color-scheme: dark) {{ html {{background-color: {dark}; }} }}</style>'
return head