mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-06 07:53:11 -05:00
fix: dynamically load theme from API endpoint (#2688)
* dynamically load theme from API endpoint * add documentation
This commit is contained in:
@@ -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`)"""
|
||||
|
||||
22
mealie/core/settings/themes.py
Normal file
22
mealie/core/settings/themes.py
Normal 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_"
|
||||
Reference in New Issue
Block a user