- do not replace window and document for deno bundles (
5fd4bb08
)
-
create dedicated worker and deno bundles, and downgrade module to es2019 (fixes #426) (
02ea227a
) -
bump @twind/core peerDependency to latest (
a26657cf
) -
enable typedoc for subpath exports (
984eb515
)
- do not use
process.env.NODE_ENV
to detect production environment — instead use import condition (e9d8dccf
)
-
update vite, vitest, sveltekit, and typescript (
5183718b
) -
add worker condition to published package (fixes #418) (
5183718b
)
- Updated dependencies [
8eb316c6
]:- @twind/[email protected]
- Updated dependencies [
0ba8cca0
,0ba8cca0
,0ba8cca0
]:- @twind/[email protected]
-
introduce new @twind/core package to prevent issue with existing code that imports from CDNs without a version (
4cab9d2f
) -
Updated dependencies [
4cab9d2f
,4cab9d2f
]:- @twind/[email protected]
-
big documentation update (
a63ca2cb
) -
Updated dependencies [
fe891f9c
,a63ca2cb
,e2c17a2e
,d481948b
,a61e0d1d
,e6acbea2
,2ac8e695
,0705e419
]:
- Updated dependencies [
774e2bb4
,a3b1bcba
,0e2aa5c4
,9b5e3297
,0a63948e
,b2b7e40d
,bdc0a7a1
,f74163ba
]:
- Updated dependencies [
08c66ee8
]:
- Updated dependencies [
28cbaef5
,43d61076
,80ce410a
,39b45125
,2f8f69d2
,9fc5baec
,aaad7e44
,ae979d12
,fc9b0c27
,346efc4e
,8bbc2a42
,8dfd105b
]:
-
server side generated styles are resumed in the browser (
b223e5bb
)Server side generated styles now include resume data that allows twind in the browser to know which styles are already included in the stylesheet. This change significantly reduces the time to interactive, supports hashed classes, and prevents missing classes that have been generated by
css
orstyle
and are not yet registered.Resuming styles is enabled by default for
setup
(Shim Mode).import { setup } from '@twind/core' import config from './twind.config' // styles are resumed! setup(config)
If you want to used the
dom
sheet during development or if you currently pass a sheet as the second argument, please switch to the newgetSheet(useDOMSheet?: boolean, disableResume?: boolean)
function. This function returns aSheet
for the current environment —virtual
on server, eitherdom
orcssom
in browsers.import { setup, getSheet } from '@twind/core' import config from './twind.config' setup(config, getSheet(process.env.NODE_ENV != 'production'))
If you want to use resuming styles with Library Mode you need to adjust your code to use
getSheet
:import { twind, getSheet } from '@twind/core' import config from './twind.config' export const tw = twind(config, getSheet(process.env.NODE_ENV != 'production'))
To generate server side styles use either
inline
orextract
:import { inline, extract } from '@twind/core' // 1. using inline const html = inline(renderApp()) // 2. using extract const { html, css } = extract(renderApp()) // add the css to the head using <style data-twind>{css}</style>
The signature of
virtual(includeResumeData?: boolean)
has changed as well. This is technically a breaking change, but I doubt anybody has used the previous possiblevirtual([])
.
- Updated dependencies [
916e7fb9
]:
- Updated dependencies [
57405812
]:
- Updated dependencies [
39001d2a
]:
-
fix: ensure sources are included in sourcemap (
bbbbd88e
)
- switch to process.env.NODE_ENV and typeof document; these seam to work reliable (
e82b1630
)
- use
import.meta.env.DEV
andimport.meta.env.SSR
instead$app/env
(6c2f9cc5
)
-
enable hash only if prod — align with other framework integration (
bbedb766
) -
Updated dependencies [
18f0caff
,a415d389
,1800dec7
,90da3bbc
]:
-
follow sveltkit hooks convention for importing; use dom sheet during development and hash class names in production (#252)
-
Updated dependencies [
0478b45f
,83a0195d
,8a4e6ddb
,3c0e3f72
]:
- BREAKING:
tw
accepts only a single string argument (usecx
for more feature) this reduces the bundle size for the shim mode by 0.25kb (#251)
-
inline
can accept an options object with aminify
to minify the resulting CSS before injecting it (#251) -
Updated dependencies [
877152d1
,059f8564
,b9d64777
,f1c1d08f
,efa7bbc0
]:
-
BREAKING: rename
inject
toinline
(762c5153
)
- perf: optimize observe to only handle changes on element with class attribute (
88eeb077
)
- Updated dependencies [
1f578c9e
]:
-
add inject(html) helper to simplify extracting CSS and injecting it into the head element (#247)
-
Updated dependencies [
d3728a92
]: