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

NEXT: Improved dark mode support #2359

Closed
3 tasks done
endigo9740 opened this issue Dec 26, 2023 · 2 comments
Closed
3 tasks done

NEXT: Improved dark mode support #2359

endigo9740 opened this issue Dec 26, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request feature request Request a feature or introduce and update to the project.
Milestone

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Dec 26, 2023

This will act as a hub to centralize for this information.

See Also

Maintainer Requests

The following requests are coming straight from the Skeleton team. These are highly likely be implemented:

  • Support both the OS and Class-based strategies from Tailwind
  • @AdrianGonz97 believes this technique may make it easier to author custom classes

Community Requests

The following requests have come from the community and are under consideration:

...

Bugs and Issues

Feedback

If you have additional updates or requests for this feature, please do so in the comments section below.

@endigo9740 endigo9740 added the enhancement New feature or request label Dec 26, 2023
@endigo9740 endigo9740 added this to the v3.0 (Next) milestone Dec 26, 2023
@endigo9740 endigo9740 mentioned this issue Jan 3, 2024
27 tasks
@endigo9740 endigo9740 added the feature request Request a feature or introduce and update to the project. label Jan 3, 2024
@endigo9740
Copy link
Contributor Author

endigo9740 commented Jan 26, 2024

@AdrianGonz97 I shared this on Discord, but to echo here for future reference:


So I've finally had a chance to sit down and look through the TW plugin's CSS compile scripts and I think I've found where our OS strategy dark mode bug is coming from. It seems you use a local Tailwind Config to determine the way the styles are processed:

https://github.com/skeletonlabs/skeleton/blob/next/packages/skeleton/scripts/compile-css-to-js.ts#L32

If I update both the doc site TW config AND this script TW config to remove the darkMode: class option, then all styles suddenly start working with the OS toggle. BUT, the two configs have to be in sync. If I try OS+Class or Class+OS things are out of sync and we get the weird style issues.

Here's what class-based generates:
image

Here's what OS-based generates:
image

So ideally we need some way for our plugin to capture the same darkMode setting the users are using in their local project's Tailwind Config and match it. It's the only way to ensure this will work IMO. Zero clue how we handle this though!

@endigo9740
Copy link
Contributor Author

With #2431 we can now consider this task done as well. Closing this out!

Per the Lightswitch feature - this will likely take the form of a guide rather than a single component, so I'm going to move that over to the Documentation ticket for now. The instructions for setting this up may differ framework to framework (especially meta frameworks like Astro) so we'll handle this in a dedicated section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request Request a feature or introduce and update to the project.
Projects
None yet
Development

No branches or pull requests

2 participants