25 lines
638 B
Python
25 lines
638 B
Python
|
|
import streamlit as st
|
||
|
|
import sql
|
||
|
|
|
||
|
|
|
||
|
|
def _load_css(filepath):
|
||
|
|
with open(filepath) as file:
|
||
|
|
st.html(f"<style>{file.read()}</style>")
|
||
|
|
|
||
|
|
|
||
|
|
def _load_color_selector_styles():
|
||
|
|
colors = sql.get_colors(1) #FIXME Change to use user profile color palette
|
||
|
|
for idx, c in enumerate(colors.keys()):
|
||
|
|
css_color = '#' + colors[c][0]
|
||
|
|
st.html(f"""
|
||
|
|
<style>
|
||
|
|
.st-key-color-selector label:has(> input[value='{idx}']) {{
|
||
|
|
background-color: {css_color};
|
||
|
|
}}
|
||
|
|
</style>
|
||
|
|
""")
|
||
|
|
|
||
|
|
|
||
|
|
def init_styles():
|
||
|
|
_load_css("css/theme.css")
|
||
|
|
_load_color_selector_styles()
|