Skip to content

Instantly share code, notes, and snippets.

@hansthen
Last active December 17, 2023 20:02
Show Gist options
  • Save hansthen/b7cfa530cd12cc1c4728a58ee4878cae to your computer and use it in GitHub Desktop.
Save hansthen/b7cfa530cd12cc1c4728a58ee4878cae to your computer and use it in GitHub Desktop.
Streamlit css
with st.sidebar:
st.markdown("""
<style>
:root {
--header-height: 50px;
}
[data-testid="stHeader"] {
background-image: url(/app/static/icons8-astrolabe-64.png);
background-repeat: no-repeat;
background-size: contain;
background-orgin: content-box;
}
[data-testid="stHeader"] {
background-color: grey;
padding-top: var(--header-height);
}
[data-testid="stSidebar"] {
margin-top: var(--header-height);
}
[data-testid="stToolbar"]::before {
content: "Astrolabium";
}
[data-testid="collapsedControl"] {
margin-top: var(--header-height);
}
[data-testid="stSidebarUserContent"] {
padding-top: 2rem;
}
</style>
""", unsafe_allow_html=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment