fix: dynamically load theme from API endpoint (#2688)

* dynamically load theme from API endpoint

* add documentation
This commit is contained in:
Hayden
2023-10-26 22:09:22 -05:00
committed by GitHub
parent 18b7e3ac9a
commit 75e95817a3
6 changed files with 132 additions and 5 deletions

View File

@@ -3,6 +3,8 @@ from pathlib import Path
from pydantic import BaseSettings, NoneStr, validator
from mealie.core.settings.themes import Theme
from .db_providers import AbstractDBProvider, db_provider_factory
@@ -23,6 +25,8 @@ def determine_secrets(data_dir: Path, production: bool) -> str:
class AppSettings(BaseSettings):
theme: Theme = Theme()
PRODUCTION: bool
BASE_URL: str = "http://localhost:8080"
"""trailing slashes are trimmed (ex. `http://localhost:8080/` becomes ``http://localhost:8080`)"""

View File

@@ -0,0 +1,22 @@
from pydantic import BaseSettings
class Theme(BaseSettings):
light_primary: str = "#E58325"
light_accent: str = "#007A99"
light_secondary: str = "#973542"
light_success: str = "#43A047"
light_info: str = "#1976D2"
light_warning: str = "#FF6D00"
light_error: str = "#EF5350"
dark_primary: str = "#E58325"
dark_accent: str = "#007A99"
dark_secondary: str = "#973542"
dark_success: str = "#43A047"
dark_info: str = "#1976D2"
dark_warning: str = "#FF6D00"
dark_error: str = "#EF5350"
class Config:
env_prefix = "theme_"