arnaudmiribel / streamlit-extras

Discover, try, install and share Streamlit re-usable bits we call "extras"!
https://extras.streamlit.app
Apache License 2.0
727 stars 124 forks source link

🐛 [BUG] - Styleable Container does not work in Bottom Container #243

Open christopherwerner opened 1 month ago

christopherwerner commented 1 month ago

Description

Using the [Bottom Container] (https://arnaudmiribel.github.io/streamlit-extras/extras/bottom_container/) to move a Styleable Container to the bottom of the view port disables the styling.

In the code below, the button at the bottom has no style, but the one at the top does - both are using the same stylable_container code.

Reproduction steps

import streamlit as st
from streamlit_extras.bottom_container import bottom
from streamlit_extras.stylable_container import stylable_container

with stylable_container(
        key="test_button1",
        css_styles="""

        button {
            background-color: white;
            border: none;
            color: blue;
        }
        """,
):
    with bottom():
        st.button("Styled Container FAILS it bottom")

with stylable_container(
        key="test_button2",
        css_styles="""

        button {
            background-color: white;
            border: none;
            color: blue;
        }
        """,
):
    st.button("Styled Container WORKS without bottom")

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Version of streamlit

1.37

Version of streamlit-extras

0.4.3

arnaudmiribel commented 1 month ago

Hey @christopherwerner, does it also not work if you do it the other way, i.e.:

with bottom():
    with stylable_container(...):
        st.button("Test")

Pinging @LukasMasuch since he might know best about the internals of this.