Initial import
This commit is contained in:
25
app/styles.py
Normal file
25
app/styles.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user