@typestyles/next 0.0.0-unstable.6fa3e9bf6d93 → 0.0.0-unstable.758a2602881c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -221,7 +221,7 @@ import { TypestylesStylesheet } from '@typestyles/next';
|
|
|
221
221
|
// app/page.tsx
|
|
222
222
|
import { styles } from 'typestyles';
|
|
223
223
|
|
|
224
|
-
const button = styles.
|
|
224
|
+
const button = styles.component('button', {
|
|
225
225
|
base: {
|
|
226
226
|
padding: '12px 24px',
|
|
227
227
|
backgroundColor: '#0066ff',
|
|
@@ -235,7 +235,7 @@ const button = styles.create('button', {
|
|
|
235
235
|
export default function Home() {
|
|
236
236
|
return (
|
|
237
237
|
<main>
|
|
238
|
-
<button className={button(
|
|
238
|
+
<button className={button()}>Click me</button>
|
|
239
239
|
</main>
|
|
240
240
|
);
|
|
241
241
|
}
|
|
@@ -262,7 +262,7 @@ export const spacing = tokens.create('space', {
|
|
|
262
262
|
import { styles } from 'typestyles';
|
|
263
263
|
import { colors, spacing } from './tokens';
|
|
264
264
|
|
|
265
|
-
const card = styles.
|
|
265
|
+
const card = styles.component('card', {
|
|
266
266
|
base: {
|
|
267
267
|
padding: spacing.md,
|
|
268
268
|
backgroundColor: colors.primary,
|
|
@@ -271,7 +271,7 @@ const card = styles.create('card', {
|
|
|
271
271
|
});
|
|
272
272
|
|
|
273
273
|
export default function Page() {
|
|
274
|
-
return <div className={card(
|
|
274
|
+
return <div className={card()}>Hello World</div>;
|
|
275
275
|
}
|
|
276
276
|
```
|
|
277
277
|
|
|
@@ -303,6 +303,14 @@ export default function RootLayout({ children }) {
|
|
|
303
303
|
}
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
+
## Fonts and local files
|
|
307
|
+
|
|
308
|
+
`global.fontFace()` registers `@font-face` like any other TypeStyles global. For **Next’s pre-build extraction** (`buildTypestylesForNext`), prefer fonts under **`public/fonts/`** and a root-relative `url('/fonts/…')` in `src` so Node does not need to resolve binary imports.
|
|
309
|
+
|
|
310
|
+
For **Vite**, you can use `import file from './font.woff2?url'` and `url(\`${file}\`) format('woff2')` so production CSS points at hashed assets.
|
|
311
|
+
|
|
312
|
+
See the **Fonts** guide in the TypeStyles docs (`docs/content/docs/fonts.md`, route `/docs/fonts` on the docs site).
|
|
313
|
+
|
|
306
314
|
## Troubleshooting
|
|
307
315
|
|
|
308
316
|
### Flash of Unstyled Content (FOUC)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typestyles/next",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.758a2602881c",
|
|
4
4
|
"description": "Next.js integration for typestyles SSR",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"react": "^18.0.0",
|
|
78
78
|
"react-dom": "^18.0.0",
|
|
79
79
|
"tsup": "^8.0.0",
|
|
80
|
-
"typestyles": "0.0.0-unstable.
|
|
80
|
+
"typestyles": "0.0.0-unstable.758a2602881c",
|
|
81
81
|
"typescript": "^5.4.0",
|
|
82
82
|
"webpack": "^5.97.1"
|
|
83
83
|
},
|