Skip to content

keep dark mode inside the (site.enable_darkmode) conditional #3233

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jvgemert
Copy link

@jvgemert jvgemert commented Jul 8, 2025

Hi,
I noticed some weird behavior when I turned dark mode off (some of the text seemed to disappear, it became white :) )

I traced it to: {% if site.enable_darkmode %} in head.liquid
where some darkmode features are place before the if statement.

When putting it inside the if statement then the weird behavior was solved; see the pull request here :)

Cheers,
Jan

Copy link

netlify bot commented Jul 8, 2025

Deploy Preview for relaxed-lollipop-b6bc17 ready!

Name Link
🔨 Latest commit 11e4cc2
🔍 Latest deploy log https://app.netlify.com/projects/relaxed-lollipop-b6bc17/deploys/686d92c57a0f6000088c28e8
😎 Deploy Preview https://deploy-preview-3233--relaxed-lollipop-b6bc17.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@george-gca
Copy link
Collaborator

Just missing the prettier complaints.

@jvgemert
Copy link
Author

Just missing the prettier complaints.

Yes! But, I don't know exactly what the goal of that "prettier" action is (?). I thought it was a linter or something, or is it the intention that it fails so that the humans make their code prettier themselves? :).

(ie: any tips on how I can fix those complaints? :) )

@george-gca
Copy link
Collaborator

Yes, it is a linter, but I couldn't make it change the code automatically with every PR. This is a limitation (rather security feature) of the GitHub actions itself, since it would involve an action in our repo make changes in your code. Probably a better idea would be to create a pre-commit script, but that wouldn't run if someone make changes using only GitHub web interface.

Currently what the action does is try to validate the code, and if it fails, it creates a zip with an HTML inside pointing the needed changes to make the code compliant. You can check this file inside the failed action. For more on this, check our FAQ.

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.

2 participants