Conversation
The attribute-based dark mode toggling doesn't seem to work for all components. In particular, the card components doesn't enter dark mode.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the demo site to support Flowbite 4, migrating from hardcoded Tailwind color classes to semantic design tokens and updating the dark mode implementation from data-theme attributes to CSS classes.
Key changes:
- Migrated all color references to semantic tokens (e.g.,
text-gray-900→text-heading,text-blue-600→text-brand) - Updated dark mode to use CSS class-based approach (
.dark) instead of data-theme attributes - Improved code formatting with multi-line HTML attributes for better readability
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
demo/app/views/pages/index.html.erb |
Updated hero section and feature cards to use semantic color tokens; changed button style from alternative to secondary; improved HTML formatting |
demo/app/views/layouts/application.html.erb |
Updated navigation and footer styling to semantic tokens; changed theme toggle from data-theme to CSS class-based approach; improved HTML formatting |
demo/app/assets/tailwind/application.css |
Added Inter font import; reordered theme loading; updated dark mode custom variant; changed footer link colors to semantic tokens |
app/components/flowbite/card/card.html.erb |
Updated card content text color to use text-body semantic token |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <script> | ||
| function setTheme(theme) { | ||
| document.documentElement.setAttribute('data-theme', theme); | ||
| if (theme == "dark") { |
There was a problem hiding this comment.
Use strict equality operator (===) instead of loose equality (==) when comparing strings. This prevents unexpected type coercion issues and is a JavaScript best practice.
Suggested change
| if (theme == "dark") { | |
| if (theme === "dark") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.