question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change background and text color

See original GitHub issue

Problem

Users would like the ability to change the background color and text color of their apps.

Solution

Allow users through a simple API to change background and text color without having to pass a<style> block into st.markdown with unsafe_allow_html=True or some similar process.

Additional context

Here is a forum topic requesting this feature.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:68
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

24reactions
pietzcommented, Nov 4, 2019

+1 from me, although I’m more interested in changing the pink accent color to something else.

One aspect to think about should be global (app wide) changes vs. local (element wide) changes. Personally, global changes are all I need for now so the app can be adjusted for our company CI. In the future though, we might want even more control.

Next point on the menu should be the level of control. A predefined list of styling adjustments is probably enough for now but power users might be interested in editing the CSS directly. This detailed level of control could lead to something like Themes. Somebody was looking for essentially a dark theme of Streamlit but we all know that a dark theme involves more adjustments than just changing the background and font color.

Elements I would like to style/adjust right now:

  • Background Color (Sidebar & Main)
  • Font Color
  • Font
  • Accent Color
3reactions
HaythamGcommented, Apr 19, 2020

I’ve been trying to adjust the background of my application with limited success using pngs and css keyframes to slide them.

Currently I can edit the HTML in index.html add in the relevant divs from the link below (st.markdown(unsafe_allow_html=True), does not work in this case to display them correctly). Then add in a style sheet using st.markdown() to create a moving background shown below as well.

(Using this template for CSS & HTML)

image

Due to the JavaScript (i assume) in index.html, it causes the widgets to be behind the divs, therefore not allowing me to interact with them.

but how to add this code <‘(Using this template for CSS & HTML)’> in your app streamlit

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change Text and Background Color in CSS
To change the background color of the inline text, go to the <head> section. Simply add the appropriate CSS selector and define the...
Read more >
CSS Text - W3Schools
The color property is used to set the color of the text. The color is specified by: ... Look at CSS Color Values...
Read more >
Change the look of text in Pages on iPhone - Apple Support
Add a background color to text · Select the text you want to change—or tap a text box or shape—then tap the Format...
Read more >
Reverse Text Color Based on Background Color ... - CSS-Tricks
If you were looking for more of an accessibility-based “change the text color to make sure it has enough contrast” thing, Sass can...
Read more >
Change HTML Background Color or Font Color - BitDegree
HTML Color: Text or Background ; background. By using the simple color property, you will change the color of the ; text.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found