Files
daily-counter/app/styles.py
John Ahlroos 0632899f7a
Some checks failed
Run Tests / run-tests (push) Failing after 1m2s
Support demo users
2026-05-01 17:41:42 +02:00

26 lines
708 B
Python

import streamlit as st
from queries import crud
from user import is_logged_in
def _load_css(filepath):
with open(filepath) as file:
st.html(f"<style>{file.read()}</style>")
def _load_color_selector_styles():
if is_logged_in():
colors = crud.get_colors()
for idx, c in enumerate(colors.keys()):
css_color = '#' + colors[c][0]
st.html(f"""
<style>
.st-key-new_counter_color_selector label:has(> input[value='{idx}']) {{
background-color: {css_color};
}}
</style>
""")
def init_styles():
_load_css("css/theme.css")
_load_color_selector_styles()