Skip to content
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

Use CSS to detect preferred color scheme when JS is disabled #308

Merged

Conversation

kdkasad
Copy link
Contributor

@kdkasad kdkasad commented Mar 18, 2021

If the site's theme is set to auto, CSS media queries will be used to set the dark theme based on the user's browser preferences when JavaScript is disabled. No change happens if JavaScript is enabled.

Only applies if the user has disabled JS and the 'theme' configuration
parameter is set to 'auto' or is unset.
@sonarcloud
Copy link

sonarcloud bot commented Mar 18, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@adityatelange adityatelange merged commit e01b521 into adityatelange:master Mar 19, 2021
@adityatelange adityatelange added the enhancement New feature or improvement label Mar 27, 2021
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this pull request Feb 21, 2023
… theme (adityatelange#308)

- Makes auto theme work when JS is disabled
- Only applies if the 'theme' configuration parameter is set to 'auto' or is unset.
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants