Skip to content

Commit

Permalink
Dark colors
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudmiribel committed Oct 31, 2024
1 parent 8715ffc commit 3108030
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/streamlit_extras/metric_cards/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import streamlit as st

from streamlit_extras import extra

from streamlit_extras.theme import st_theme

@extra
def style_metric_cards(
Expand All @@ -24,6 +24,13 @@ def style_metric_cards(
box_shadow (bool, optional): Whether a box shadow is applied. Defaults to True.
"""

theme = st_theme()

# When dark mode, convert background and border to be dark
if theme.get("base") == "dark":
background_color = "#1B1C24"
border_color = "#292D34"

box_shadow_str = (
"box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;"
if box_shadow
Expand Down

0 comments on commit 3108030

Please sign in to comment.