aileen3-core / demo /layout.py
ndurner's picture
dark mode, concise message
03c7ea3
raw
history blame
1.6 kB
from __future__ import annotations
CELL_CSS = """
.cell-wrapper {
border: 1px solid rgba(0, 0, 0, 0.9);
border-radius: 14px;
padding: 10px;
margin-bottom: 10px;
background: transparent;
}
.cell-title {
font-size: 1.15rem;
font-weight: 600;
margin: 0 0 10px;
}
.health-box {
border-radius: 14px;
padding: 18px;
border: 1px solid transparent;
}
.health-success {
background: #dcfce7;
border-color: #86efac;
color: #14532d;
}
.health-fail {
background: #fee2e2;
border-color: #fecaca;
color: #7f1d1d;
}
.health-box ul {
margin: 12px 0 0;
padding-left: 22px;
}
.health-box li {
margin-bottom: 6px;
}
.health-placeholder {
background: #f5f5f5 !important;
border-color: #d4d4d4 !important;
color: #1f2937 !important;
}
@media (prefers-color-scheme: dark) {
.cell-wrapper {
border-color: rgba(255, 255, 255, 0.45);
}
.health-success {
background: rgba(74, 222, 128, 0.12);
border-color: rgba(74, 222, 128, 0.55);
color: #ecfdf3;
}
.health-fail {
background: rgba(248, 113, 113, 0.12);
border-color: rgba(248, 113, 113, 0.6);
color: #fee2e2;
}
.health-placeholder {
background: rgba(148, 163, 184, 0.15) !important;
border-color: rgba(148, 163, 184, 0.4) !important;
color: #e2e8f0 !important;
}
}
"""
def wrap_cell(body_html: str) -> str:
return (
"<section class='cell-wrapper'>"
"<div class='cell-title'>πŸ§ͺ Health check</div>"
f"{body_html}"
"</section>"
)