I am using st.theme() and when running the code i did got
AttributeError: module ‘streamlit’ has no attribute ‘theme’.
Is there anyway to know the theme within code?
Thank you
I am using st.theme() and when running the code i did got
AttributeError: module ‘streamlit’ has no attribute ‘theme’.
Is there anyway to know the theme within code?
Thank you
You got this error because there are no attribute named st.theme(). Could you please share the link where people are referencing such a module? I wonder if it was a discussion about features that could be helpful. Such as this Check if the app is in dark mode or light mode at runtime
Anyway, you can take a look at Creating Custom Themes for Streamlit Apps and that would help you with your theme. Basically, you create a .streamlit folder and insert your config.toml file with the theme information.
I am using light theme for development and when dark theme is selected headers are still having light theme color. Is there anyway that i can fix it. For header am using st.title(“Title”) and in Dark theme it is gray as in light theme. Please suggest
Go to the config.toml file and create something like the solarized theme as shown in Creating Custom Themes for Streamlit Apps this will become your customized theme.
[theme]
primaryColor="#d33682"
backgroundColor="#002b36"
secondaryBackgroundColor="#586e75"
textColor="#fafafa"
font="sans serif"
At the development stage you can go back to the standard light theme, and then toggle back to your customized theme.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.