Skip to content

Commit

Permalink
Fixed interference of social plugin and auto dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 19, 2024
1 parent cc78979 commit 66d4500
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions material/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ def on_config(self, config):
if "palette" in theme:
palette = theme["palette"]

# Use first palette, if multiple are defined
# Find first palette that includes primary color definition
if isinstance(palette, list):
palette = palette[0]
for p in palette:
if "primary" in p and p["primary"]:
palette = p
break

# Set colors according to palette
if "primary" in palette and palette["primary"]:
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/social/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,12 @@ def on_config(self, config):
if "palette" in theme:
palette = theme["palette"]

# Use first palette, if multiple are defined
# Find first palette that includes primary color definition
if isinstance(palette, list):
palette = palette[0]
for p in palette:
if "primary" in p and p["primary"]:
palette = p
break

# Set colors according to palette
if "primary" in palette and palette["primary"]:
Expand Down

0 comments on commit 66d4500

Please sign in to comment.