mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-20 22:13:43 +00:00
Force dark theme on the Gradio login page
This commit is contained in:
parent
645463b9f0
commit
3344510553
2 changed files with 30 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import builtins
|
||||
import io
|
||||
import re
|
||||
|
||||
import requests
|
||||
|
||||
|
|
@ -62,6 +63,13 @@ def my_open(*args, **kwargs):
|
|||
'\n </head>'
|
||||
)
|
||||
|
||||
file_contents = re.sub(
|
||||
r'@media \(prefers-color-scheme: dark\) \{\s*body \{([^}]*)\}\s*\}',
|
||||
r'body.dark {\1}',
|
||||
file_contents,
|
||||
flags=re.DOTALL
|
||||
)
|
||||
|
||||
if len(args) > 1 and args[1] == 'rb':
|
||||
file_contents = file_contents.encode('utf-8')
|
||||
return io.BytesIO(file_contents)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue