textai-v2 / modules /theme.py
rbt2025's picture
Deploy TextAI v2 - Clean architecture
02daacc verified
"""
Theme Module
Dark theme CSS and styling.
"""
DARK_CSS = """
/* GitHub Dark Theme */
.gradio-container { background: #0d1117 !important; color: #c9d1d9 !important; }
h1, h2, h3 { color: #58a6ff !important; }
/* Inputs */
input, textarea, select { background: #0d1117 !important; border: 1px solid #30363d !important; color: #c9d1d9 !important; border-radius: 6px !important; }
input:focus, textarea:focus { border-color: #58a6ff !important; }
/* Buttons */
button { background: #21262d !important; border: 1px solid #30363d !important; color: #c9d1d9 !important; }
button:hover { background: #30363d !important; }
button.primary { background: #238636 !important; border-color: #238636 !important; color: #fff !important; }
button.stop { background: #da3633 !important; border-color: #da3633 !important; color: #fff !important; }
/* Tables */
table { background: #0d1117 !important; }
th { background: #161b22 !important; color: #8b949e !important; }
td { background: #0d1117 !important; color: #c9d1d9 !important; }
tr:hover td { background: #161b22 !important; }
/* Blocks */
.block { background: #161b22 !important; border: 1px solid #30363d !important; }
pre, code { background: #161b22 !important; color: #79c0ff !important; }
/* Tabs */
.tab-nav button { background: #21262d !important; color: #8b949e !important; }
.tab-nav button.selected { background: #0d1117 !important; color: #58a6ff !important; border-bottom: 2px solid #58a6ff !important; }
/* Sidebar */
.folder-tree { background: #0d1117 !important; border: 1px solid #30363d !important; border-radius: 8px !important; padding: 10px !important; font-family: 'Consolas', monospace !important; }
.folder-tree table { background: transparent !important; }
.folder-tree td { padding: 4px 8px !important; cursor: pointer !important; }
.folder-tree tr:hover td { background: #21262d !important; }
/* Toolbar */
.toolbar { background: #161b22 !important; border: 1px solid #30363d !important; border-radius: 8px !important; padding: 8px !important; }
/* Status */
.status { background: #161b22 !important; border: 1px solid #30363d !important; color: #8b949e !important; font-size: 12px !important; }
/* Breadcrumb */
.breadcrumb { background: #161b22 !important; color: #58a6ff !important; font-family: monospace !important; }
/* Home cards */
.home-card { background: #161b22 !important; border: 1px solid #30363d !important; border-radius: 12px !important; padding: 20px !important; }
/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d1117; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 4px; }
label { color: #8b949e !important; }
"""
def get_theme():
"""Get Gradio theme configuration"""
import gradio as gr
return gr.themes.Base().set(
body_background_fill="#0d1117",
block_background_fill="#161b22",
border_color_primary="#30363d",
)