From a4ac3e3bc801f8232027f063e18482ac179f0378 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 4 Jul 2022 20:49:23 +0200 Subject: [PATCH] Theming support --- .gitignore | 1 + app/scss/main.scss | 3 +++ tasks.py | 10 ++++++++++ 3 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index 09e93dd..a655e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ __pycache__/ .pytest_cache/ docs/dist/ requirements.txt +app/scss/vars.scss diff --git a/app/scss/main.scss b/app/scss/main.scss index febbf72..9d9334e 100644 --- a/app/scss/main.scss +++ b/app/scss/main.scss @@ -10,6 +10,9 @@ $form-text-color: #222; $muted-color: #586e75; // solarized comment text // #93a1a1; solarized body text +// Load custom theme +@import "vars.scss"; + body { font-family: $font-stack; diff --git a/tasks.py b/tasks.py index 3a71423..4863399 100644 --- a/tasks.py +++ b/tasks.py @@ -40,6 +40,10 @@ def lint(ctx): @task def compile_scss(ctx, watch=False): # type: (Context, bool) -> None + vars_file = Path("app/scss/vars.scss") + if not vars_file.exists(): + vars_file.write_text("") + if watch: run("poetry run boussole watch", echo=True) else: @@ -113,3 +117,9 @@ def download_twemoji(ctx): emoji_name = Path(member.name).name with open(f"app/static/twemoji/{emoji_name}", "wb") as f: f.write(tf.extractfile(member).read()) # type: ignore + + +@task(download_twemoji, compile_scss, migrate_db) +def setup_static_dir(ctx): + # type: (Context) -> None + pass