Skip to content

Commit 18c244d

Browse files
authored
fix: solid-styled (#1776)
1 parent ca23578 commit 18c244d

4 files changed

Lines changed: 22 additions & 56 deletions

File tree

examples/pnpm-lock.yaml

Lines changed: 15 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/with-solid-styled/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { defineConfig } from "@solidjs/start/config";
22
import type { PluginOption } from "vite";
3-
import solidStyled from "vite-plugin-solid-styled";
3+
import solidStyled from "unplugin-solid-styled";
44

55
export default defineConfig({
66
vite: {
77
plugins: [
8-
solidStyled({
8+
solidStyled.vite({
99
filter: {
1010
include: "src/**/*.tsx",
1111
exclude: "node_modules/**/*.{ts,js}"

examples/with-solid-styled/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"@solidjs/router": "^0.15.0",
1212
"@solidjs/start": "^1.0.11",
1313
"solid-js": "^1.9.2",
14-
"solid-styled": "^0.11.1",
14+
"solid-styled": "^0.12.0",
1515
"vinxi": "^0.4.3",
16-
"vite-plugin-solid-styled": "^0.11.1"
16+
"unplugin-solid-styled": "^0.12.0"
1717
},
1818
"overrides": {
1919
"vite": "5.4.10"

examples/with-solid-styled/src/app.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { Router } from "@solidjs/router";
33
import { FileRoutes } from "@solidjs/start/router";
44
import { Suspense } from "solid-js";
55

6-
import { useAssets } from "solid-js/web";
7-
8-
import { StyleRegistry, css, renderSheets, type StyleData } from "solid-styled";
6+
import { StyleRegistry, css } from "solid-styled";
97

108
function GlobalStyles() {
119
css`
@@ -56,14 +54,11 @@ function GlobalStyles() {
5654
}
5755

5856
export default function App() {
59-
const sheets: StyleData[] = [];
60-
useAssets(() => renderSheets(sheets));
61-
6257
return (
6358
<Router
64-
root={props => (
59+
root={(props) => (
6560
<MetaProvider>
66-
<StyleRegistry styles={sheets}>
61+
<StyleRegistry auto>
6762
<GlobalStyles />
6863
<a href="/">Index</a>
6964
<a href="/about">About</a>

0 commit comments

Comments
 (0)