Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-tooltip-portaled-theme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

fix(Tooltip): Theme portaled tooltips in the style presets so surface colors resolve correctly (e.g. fixes a light tooltip in dark mode with Skeleton)
5 changes: 5 additions & 0 deletions .changeset/skeleton-light-dark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat(skeleton): Resolve surface colors via `light-dark()` so the Skeleton presets follow `color-scheme` (the `.dark` toggle, or `prefers-color-scheme` when unpinned), and fix the surface scale collapsing to a single shade — surfaces now graduate from 100 (lightest) to 300 (darkest) in both light and dark
5 changes: 5 additions & 0 deletions .changeset/sweet-snakes-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'layerchart': patch
---

feat: Support Skeleton 5 (skeleton-5.css)
6 changes: 6 additions & 0 deletions docs/src/routes/docs/getting-started/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ or with a single `.css` import, Layerchart [provides](https://github.com/techniq

/* v4 */
@import 'layerchart/skeleton-4.css';

/* v5 */
@import 'layerchart/skeleton-5.css';
```
::

Expand Down Expand Up @@ -217,6 +220,9 @@ Starter [project repos](https://github.com/techniq/layerchart/tree/next/examples
- v4:
:button{label="Source" href="https://github.com/techniq/layerchart/tree/docs-v2/examples/skeleton-4" size="sm" icon="lucide:github"}
:button{label="Open in StackBlitz" href="https://stackblitz.com/github/techniq/layerchart/tree/docs-v2/examples/skeleton-4" size="sm" icon="simple-icons:stackblitz"}
- v5:
:button{label="Source" href="https://github.com/techniq/layerchart/tree/docs-v2/examples/skeleton-5" size="sm" icon="lucide:github"}
:button{label="Open in StackBlitz" href="https://stackblitz.com/github/techniq/layerchart/tree/docs-v2/examples/skeleton-5" size="sm" icon="simple-icons:stackblitz"}
::

::tab{label="Svelte UX" icon="custom-brands:svelteux"}
Expand Down
13 changes: 9 additions & 4 deletions examples/daisyui-5/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { ModeWatcher, theme, setTheme } from 'mode-watcher';
import { ModeWatcher, mode, setMode, setTheme } from 'mode-watcher';

import favicon from '$lib/assets/favicon.svg';
import '../app.css';
Expand All @@ -17,11 +17,16 @@
<div class="pb-4 text-right">
<input
type="checkbox"
checked={theme.current === 'dark'}
checked={mode.current === 'dark'}
class="toggle"
onchange={(e) => {
// @ts-expect-error
setTheme(e.target.checked ? 'dark' : 'light');
// daisyUI switches its palette (and `color-scheme`) via `data-theme`, so keep it in
// sync with mode-watcher's light/dark mode. Setting both means mode-watcher's inline
// `color-scheme` and daisyUI's agree, so `light-dark()` (e.g. LayerChart's Tooltip)
// resolves correctly. mode-watcher persists both and sets them pre-paint (no flash).
const theme = e.currentTarget.checked ? 'dark' : 'light';
setMode(theme); // `.dark` class + inline `color-scheme` (drives `light-dark()`)
setTheme(theme); // daisyUI `data-theme` (drives its palette)
}}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions examples/skeleton-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/vite": "^4.3.0",
"layerchart": "workspace:*",
"mode-watcher": "^1.1.0",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.8.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/skeleton-4/src/app.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en" data-theme="cerberus">
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down
31 changes: 0 additions & 31 deletions examples/skeleton-4/src/lib/components/Lightswitch.svelte

This file was deleted.

21 changes: 17 additions & 4 deletions examples/skeleton-4/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts">
import '../app.css';
import Lightswitch from '$lib/components/Lightswitch.svelte';
import { Switch } from '@skeletonlabs/skeleton-svelte';
import { ModeWatcher, mode, setMode } from 'mode-watcher';

import favicon from '$lib/assets/favicon.svg';
import '../app.css';

let { children } = $props();
</script>
Expand All @@ -10,9 +12,20 @@
<link rel="icon" href={favicon} />
</svelte:head>

<ModeWatcher defaultTheme="cerberus" />

<main class="p-4">
<div class="pb-4 text-right">
<Lightswitch />
<Switch
checked={mode.current === 'dark'}
onCheckedChange={(e) => setMode(e.checked ? 'dark' : 'light')}
>
<Switch.Control>
<Switch.Thumb />
</Switch.Control>
<Switch.HiddenInput />
</Switch>
</div>
{@render children()}

{@render children?.()}
</main>
23 changes: 23 additions & 0 deletions examples/skeleton-5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions examples/skeleton-5/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
9 changes: 9 additions & 0 deletions examples/skeleton-5/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lock
bun.lockb

# Miscellaneous
/static/
16 changes: 16 additions & 0 deletions examples/skeleton-5/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
],
"tailwindStylesheet": "./src/app.css"
}
38 changes: 38 additions & 0 deletions examples/skeleton-5/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# sv

Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```sh
# create a new project in the current directory
npx sv create

# create a new project in my-app
npx sv create my-app
```

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```sh
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```sh
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
34 changes: 34 additions & 0 deletions examples/skeleton-5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "skeleton4",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check ."
},
"devDependencies": {
"@skeletonlabs/skeleton": "^5.0.0",
"@skeletonlabs/skeleton-svelte": "^5.0.0",
"@sveltejs/adapter-auto": "^7.0.1",
"@sveltejs/kit": "^2.62.0",
"@sveltejs/vite-plugin-svelte": "^7.1.2",
"@tailwindcss/vite": "^4.3.0",
"layerchart": "workspace:*",
"mode-watcher": "^1.1.0",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.8.0",
"svelte": "^5.56.1",
"svelte-check": "^4.5.0",
"tailwindcss": "^4.3.0",
"typescript": "^6.0.3",
"vite": "^8.0.16"
}
}
Loading
Loading