You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace escaped quotes within class names during SSR (b212b52f)
Rewrites HTML entity & when self-referenced groups are used with (p)react (782f93df) 🙏🏽 @rschristian!
feat: preserve classes created by explicit tw calls during SSR (fe88051d)
Previously inline and extract cleared the tw instance before parsing the html assuming that all classes are available via class attributes. That led to missing styles from injectGlobal or explicit tw calls.
This change introduces a snaphot method on tw and sheet instances which allows to preserve the classes that are created by explicit tw calls.
import{tw,stringify}from'twind'functionrender(){// remember global classesconstrestore=tw.snapshot()// generated htmlconsthtml=renderApp()// create CSSconstcss=stringify(tw.target)// restore global classesrestore()// inject as last element into the headreturnhtml.replace('</head>',`<style data-twind>${css}</style></head>`)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
[email protected]
Patch Changes
fix: replace escaped quotes within class names during SSR (
b212b52f
)Rewrites HTML entity & when self-referenced groups are used with (p)react (
782f93df
) 🙏🏽 @rschristian!feat: preserve classes created by explicit
tw
calls during SSR (fe88051d
)Previously
inline
andextract
cleared thetw
instance before parsing the html assuming that all classes are available viaclass
attributes. That led to missing styles frominjectGlobal
or explicittw
calls.This change introduces a
snaphot
method ontw
and sheet instances which allows to preserve the classes that are created by explicittw
calls.Default Mode (nothing changed here)
Library Mode
fix: gradients with arbitrary color stop positions (Gradients with arbitrary color stop position #296) (
77954405
)@twind/[email protected]
Patch Changes
&
) will be treated as selector and each underscore (_
) will be replace by a space (`) ([
811965f`](811965f))This discussion was created from the release v1.0.0-next.38.
Beta Was this translation helpful? Give feedback.
All reactions