Theming support

This commit is contained in:
Thomas Sileo 2022-07-04 20:49:23 +02:00
parent dfa6b6de3c
commit a4ac3e3bc8
3 changed files with 14 additions and 0 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ __pycache__/
.pytest_cache/ .pytest_cache/
docs/dist/ docs/dist/
requirements.txt requirements.txt
app/scss/vars.scss

View file

@ -10,6 +10,9 @@ $form-text-color: #222;
$muted-color: #586e75; // solarized comment text $muted-color: #586e75; // solarized comment text
// #93a1a1; solarized body text // #93a1a1; solarized body text
// Load custom theme
@import "vars.scss";
body { body {
font-family: $font-stack; font-family: $font-stack;

View file

@ -40,6 +40,10 @@ def lint(ctx):
@task @task
def compile_scss(ctx, watch=False): def compile_scss(ctx, watch=False):
# type: (Context, bool) -> None # type: (Context, bool) -> None
vars_file = Path("app/scss/vars.scss")
if not vars_file.exists():
vars_file.write_text("")
if watch: if watch:
run("poetry run boussole watch", echo=True) run("poetry run boussole watch", echo=True)
else: else:
@ -113,3 +117,9 @@ def download_twemoji(ctx):
emoji_name = Path(member.name).name emoji_name = Path(member.name).name
with open(f"app/static/twemoji/{emoji_name}", "wb") as f: with open(f"app/static/twemoji/{emoji_name}", "wb") as f:
f.write(tf.extractfile(member).read()) # type: ignore f.write(tf.extractfile(member).read()) # type: ignore
@task(download_twemoji, compile_scss, migrate_db)
def setup_static_dir(ctx):
# type: (Context) -> None
pass