lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
650 stars 356 forks source link

Fix white flash when using dark mode #392

Closed Sohn123 closed 1 year ago

Sohn123 commented 1 year ago

Description

There is a white flash when using the theme in dark mode, when you switch between pages. This is, because the theme class gets applied on the event DOMContentLoaded. This is after the first contentful paint. I moved the theme class from the body to the root node, so we can apply the styling before the first contentful paint.

Issue Number:


Checklist

Yes, I included all necessary artefacts, including:


Testing Checklist

Yes, I ensured that all of the following scenarios were tested:


Notify the following users

netlify[bot] commented 1 year ago

Deploy Preview for anatole-demo ready!

Name Link
Latest commit 25fdc9ed243e39cb119ee3d6fc7bc239796c3840
Latest deploy log https://app.netlify.com/sites/anatole-demo/deploys/634b28392d6c89000889575a
Deploy Preview https://deploy-preview-392--anatole-demo.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 site settings.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    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