-
Notifications
You must be signed in to change notification settings - Fork 27
Avoid white flash on page reload in dark theme #8494
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
Conversation
📝 WalkthroughWalkthroughThe changes update the main view template to conditionally apply a dark background based on the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/views/main.scala.html (2)
9-12
: Ensure Correct Application of Dark Theme BackgroundThe conditional style blocks for handling the dark theme are correctly implemented. When
selectedTheme
is"auto"
, the media query is added to conditionally set the background to black based on the user's system preference, and when it is"dark"
, a direct style is applied. The use of@@media
is the appropriate way to escape the@
in the Play Framework template.Consider appending a semicolon after
background: black
(i.e.background: black;
) within the CSS block for consistency and to adhere to common CSS style guidelines.
14-16
: Consistent Formatting for Open Graph Meta TagsThe revised one-line expressions for the Open Graph meta tags improve readability by condensing the optional mappings. For uniformity, consider inserting a space after the lambda arrow (
=>
) throughout. For example, modifying@openGraphTitle.map { ogt =><meta ... }
to
@openGraphTitle.map { ogt => <meta ... }
will enhance consistency.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/views/main.scala.html
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: circleci_build
🔇 Additional comments (1)
app/views/main.scala.html (1)
17-17
: Validation of WKORG Instance CheckThe conditional check for
conf.Features.isWkorgInstance
remains intact, ensuring that additional meta tags (such as description and keywords) are only included when appropriate. This maintains the intended functionality of the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code looks good and testing in a chromium-based browser and firefox was also great 😊 thanks for fixing this! 🙏
Our dark theme is rendered dynamically with javascript.
That means that before javascript is initialized, there is a flash of white. This happens on every page reload.
Adding a pure css rule in the main html prevents that.
URL of deployed dev instance (used for testing):
Steps to test:
Issues: