Apply default theme to apps ()

This commit is contained in:
Nikhil Rao 2023-12-20 15:17:49 -08:00 committed by GitHub
parent 97f528e7b5
commit cfb9d44e0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -43,6 +43,7 @@ from reflex.components.navigation.client_side_routing import (
Default404Page,
wait_for_client_redirect,
)
from reflex.components.radix import themes
from reflex.config import get_config
from reflex.event import Event, EventHandler, EventSpec
from reflex.middleware import HydrateMiddleware, Middleware
@ -131,7 +132,7 @@ class App(Base):
background_tasks: Set[asyncio.Task] = set()
# The radix theme for the entire app
theme: Optional[Component] = None
theme: Optional[Component] = themes.theme(accent_color="blue")
def __init__(self, *args, **kwargs):
"""Initialize the app.

View File

@ -1199,7 +1199,7 @@ def compilable_app(tmp_path) -> Generator[tuple[App, Path], None, None]:
web_dir = app_path / ".web"
web_dir.mkdir(parents=True)
(web_dir / "package.json").touch()
app = App()
app = App(theme=None)
app.get_frontend_packages = unittest.mock.Mock()
with chdir(app_path):
yield app, web_dir