Skip to content

Conversation

@shahar1
Copy link
Contributor

@shahar1 shahar1 commented Jan 3, 2026

Copilot Summary

This pull request updates the dark mode initialization logic in landing-pages/site/assets/js/dark-mode.js to improve how the theme is stored and how the initialization is triggered. The most important changes are grouped below:

Theme storage update:

  • Changed the local storage key for the theme from 'td-color-theme' to 'theme', simplifying and standardizing the key used to store the user's theme preference.

Initialization improvements:

  • Refactored the initialization code to use an explicit init function, which is now called either immediately or after the DOMContentLoaded event, depending on the document's readiness. This ensures the theme is applied consistently and avoids potential race conditions. [1] [2]

@potiuk
Copy link
Member

potiuk commented Jan 3, 2026

static check issues :)

@shahar1
Copy link
Contributor Author

shahar1 commented Jan 3, 2026

static check issues :)

Aware of that, there are also other issues as well. Drafting until finalization.

@shahar1 shahar1 marked this pull request as draft January 3, 2026 16:36
@shahar1 shahar1 force-pushed the fix-ui-fouc branch 2 times, most recently from ba38a04 to e5b6e98 Compare January 3, 2026 17:40
@shahar1 shahar1 changed the title Fix FOUC issues and dark mode button Fix dark mode button Jan 3, 2026
@shahar1 shahar1 marked this pull request as ready for review January 3, 2026 17:40
@shahar1 shahar1 marked this pull request as draft January 3, 2026 17:43
@shahar1 shahar1 marked this pull request as ready for review January 3, 2026 17:49
@shahar1 shahar1 merged commit 40da956 into main Jan 3, 2026
2 checks passed
@shahar1 shahar1 deleted the fix-ui-fouc branch January 3, 2026 17:53
@potiuk
Copy link
Member

potiuk commented Jan 3, 2026

Nice!

@shahar1
Copy link
Contributor Author

shahar1 commented Jan 3, 2026

Nice!

Unfortunately it didn't help that much, created an issue for that (see #1373).

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