Spaces:
Sleeping
Sleeping
not needed
Browse files
styles.py
DELETED
|
@@ -1,78 +0,0 @@
|
|
| 1 |
-
import streamlit as st
|
| 2 |
-
|
| 3 |
-
def get_theme_colors(dark_mode: bool) -> dict:
|
| 4 |
-
"""Return a color palette based on dark mode preference."""
|
| 5 |
-
return {
|
| 6 |
-
"BG": "#0f1620" if dark_mode else "#f5f5f5",
|
| 7 |
-
"PANEL_BG": "#1c2330" if dark_mode else "#ffffff",
|
| 8 |
-
"TEXT": "#e3e8f1" if dark_mode else "#1a1a1a",
|
| 9 |
-
"ACCENT": "#ff5252",
|
| 10 |
-
"BORDER": "#2a3240" if dark_mode else "#dddddd",
|
| 11 |
-
"SHADOW": "rgba(0,0,0,0.3)" if dark_mode else "rgba(0,0,0,0.1)",
|
| 12 |
-
"ACE_THEME": "monokai" if dark_mode else "chrome",
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
def inject_global_css(colors: dict) -> None:
|
| 16 |
-
"""Inject global styling overrides into the Streamlit app based on theme colors."""
|
| 17 |
-
st.markdown(f"""
|
| 18 |
-
<style>
|
| 19 |
-
.stApp {{
|
| 20 |
-
background-color: {colors["BG"]};
|
| 21 |
-
color: {colors["TEXT"]};
|
| 22 |
-
}}
|
| 23 |
-
[data-testid="stSidebar"] {{
|
| 24 |
-
background-color: {colors["PANEL_BG"]} !important;
|
| 25 |
-
}}
|
| 26 |
-
.ace_editor, .ace_scroller {{
|
| 27 |
-
background: {colors["PANEL_BG"]} !important;
|
| 28 |
-
box-shadow: 0 4px 8px {colors["SHADOW"]} !important;
|
| 29 |
-
border-radius: 8px !important;
|
| 30 |
-
}}
|
| 31 |
-
textarea, input, .stTextArea textarea {{
|
| 32 |
-
background: {colors["PANEL_BG"]} !important;
|
| 33 |
-
color: {colors["TEXT"]} !important;
|
| 34 |
-
border: 1px solid {colors["BORDER"]} !important;
|
| 35 |
-
border-radius: 4px !important;
|
| 36 |
-
}}
|
| 37 |
-
button, .stDownloadButton > button {{
|
| 38 |
-
background-color: {colors["ACCENT"]} !important;
|
| 39 |
-
color: #fff !important;
|
| 40 |
-
border-radius: 6px !important;
|
| 41 |
-
transition: transform 0.1s;
|
| 42 |
-
}}
|
| 43 |
-
button:hover {{
|
| 44 |
-
transform: scale(1.02) !important;
|
| 45 |
-
}}
|
| 46 |
-
.chat-container {{
|
| 47 |
-
background: {colors["PANEL_BG"]} !important;
|
| 48 |
-
border: 1px solid {colors["BORDER"]} !important;
|
| 49 |
-
border-radius: 8px !important;
|
| 50 |
-
padding: 1rem;
|
| 51 |
-
max-height: 480px;
|
| 52 |
-
overflow-y: auto;
|
| 53 |
-
}}
|
| 54 |
-
.chat-message {{
|
| 55 |
-
margin-bottom: 1rem;
|
| 56 |
-
padding: 0.75rem 1rem;
|
| 57 |
-
border-radius: 12px;
|
| 58 |
-
}}
|
| 59 |
-
.user-message {{
|
| 60 |
-
background: rgba(100,149,237,0.2);
|
| 61 |
-
align-self: flex-end;
|
| 62 |
-
}}
|
| 63 |
-
.bot-message {{
|
| 64 |
-
background: rgba(200,200,200,0.2);
|
| 65 |
-
align-self: flex-start;
|
| 66 |
-
}}
|
| 67 |
-
pre code {{
|
| 68 |
-
display: block;
|
| 69 |
-
padding: 0.5rem;
|
| 70 |
-
background: rgba(0,0,0,0.1);
|
| 71 |
-
border-radius: 4px;
|
| 72 |
-
overflow-x: auto;
|
| 73 |
-
}}
|
| 74 |
-
label[data-testid="stMarkdownContainer"] > div > div {{
|
| 75 |
-
color: {colors["TEXT"]} !important;
|
| 76 |
-
}}
|
| 77 |
-
</style>
|
| 78 |
-
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|