Instruction file imported from Pawlo77/happy-housing (
.cursor/rules/no-custom-css.mdc). Copyright stays with the author.
No custom CSS
Streamlit UI must use stock widgets + theme TOML only. No injected CSS/HTML chrome.
Forbidden in src/happy_housing/app/
<style>blocks for colours, fonts, cards, or general look-and-feel- Inline
style="..."attributes unsafe_allow_html=Truefor styling (except the layout-density helper below)st.html(...)/ raw HTML markup used only for look-and-feel- Custom CSS files, class-based skinning (
hh-*layout classes, etc.)
Allowed
- Theme tokens in
.streamlit/config.toml([theme], fonts, chart colours) - Streamlit widgets:
st.title,st.metric,st.tabs,st.markdown(GFM only — bold, strikethrough, links) - Map/deck.gl layer colours and Altair/plot encodings (data viz, not page CSS)
- One layout-density exception:
apply_dense_top_layout()may set mainblock-container/stMainBlockContainerpadding-toponly. Streamlit has no TOML knob for the large gap under topst.navigation. Do not extend this to colours, fonts, sidebars, or widget chrome.
Prefer
| Need | Use |
|---|---|
| Brand / page title | st.title / st.header (skip on pages already labeled by top nav) |
| KPIs | st.metric (+ delta / delta_color) |
| Emphasis / strike | Markdown (**bold**, ~~strike~~) |
| Layout | st.columns, st.container, st.tabs |
| Look & feel | .streamlit/config.toml only |
If a design seems to need custom CSS beyond the padding-top exception above, change the design to fit Streamlit — do not inject more CSS.
