Add skeleton-5.css#888
Conversation
Updated CSS variables for surface colors and content colors in dark mode.
🦋 Changeset detectedLatest commit: 6effaad The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Bundle Size AnalysisUse-Case ScenariosCore (7 changed)
Base (agnostic) (4 changed)
Base (layer-specific) (3 changed)
Cartesian charts (27 changed)
Geo (3 changed)
Hierarchy (4 changed)
Graph / network (4 changed)
Worst case (1 changed)
Understanding this report
|
| --color-surface-content: light-dark( | ||
| var(--typo-base--color-light), | ||
| var(--typo-base--color-dark) | ||
| ); |
There was a problem hiding this comment.
haven't typically used light-dark() for light/default color and typically just set to light mode by default.
shouldn't technically matter and has descent browser support (2 years+, Safari 17.5+)
There was a problem hiding this comment.
The problem is that Tailwind uses prefers-color-scheme by default which makes picking one break the other. And Skeleton 5 does not have one variable for color anymore, it has to be explicitly light or dark.
There was a problem hiding this comment.
yeah, I think Skeleton hasn't had a single variable for color since at least 3.x (the main reason we use html.dark to swap variables, unlike the other integrations like shadcn-svelte, daisy-ui, etc which are much simplier).
Using light-dark() will make font color work, but in that vein we'd probably want to do the same for the surface colors (as if you're not using <html class="dark"> you could get --typo-base--color-dark for text in dark mode but also the light surface-* colors.
https://www.skeleton.dev/docs/svelte/guides/mode
Will take a little experimentation to make sure prefers-color-scheme and html.dark works if we go down this path. I've always preferred using html.dark since typically a user with light/dark modes for their site also have an explicit toggle (see also: https://www.skeleton.dev/docs/svelte/guides/cookbook/light-switch).
Regardless, we can iterate on this. Also the integration styles (skeleton-5.css, etc) are provided to streamline setup but also are more a reference if you handle things differently (such as using another strategy like <html data-mode="dark">)
|
also if you could add a changeset ( |
Related to #887. I have updated
--color-surface-contentto match the new version.Note that I also changed
--color-surface-100as the text is barely readable in dark mode with its default configuration. That may just be something I have to do on my own end though and could be excised from this PR.Not included are the docs or additional example repos.
Before

After
