Skip to content

Fix faulty css in example #7971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Fix faulty css in example #7971

merged 1 commit into from
Feb 6, 2025

Conversation

DeNelo
Copy link
Contributor

@DeNelo DeNelo commented Feb 6, 2025

The example showing how to add custom colors was missing a selector.

The example showing how to add custom colors was missing a selector.
@squidfunk
Copy link
Owner

Thanks!

@squidfunk squidfunk merged commit bffafcc into squidfunk:master Feb 6, 2025
@iBug
Copy link
Contributor

iBug commented Feb 6, 2025

Doesn't seem necessary to me. The theme is already using :root selector so any custom settings also using the same selector should override the theme's variables, assuming custom CSS is always loaded after theme's defaults.

@squidfunk
Copy link
Owner

Unfortunately, it's necessary due to issues with specificity. I haven't found another way to restructure the CSS to support CSS variable customization and different color schemes at the same time, but if there is, I'm all yours!

@iBug
Copy link
Contributor

iBug commented Feb 6, 2025

Ah, got it. The point here is, elements have [data-md-color-primary=whatever] which has the same specificity as :root, and consequently (as a "direct match" selector) overrides those inherited from :root.

@DeNelo DeNelo deleted the patch-1 branch February 6, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants