Skip to content

Commit

Permalink
Typo :) (#364)
Browse files Browse the repository at this point in the history
Co-authored-by: Sascha Tandel <514405+sastan@users.noreply.github.com>
  • Loading branch information
renhiyama and sastan committed Aug 4, 2022
1 parent b2b7e40 commit 319eba2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/twind/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Used for static HTML processing (usually to provide SSR support for your javascr
3. return the HTML string with the final element classes

```js
import { setup, tw, consume, stringify } from 'twind'
import { setup, consume, stringify, tw } from 'twind'

// can be in a different file — but should be called at least once
setup({
Expand All @@ -205,15 +205,18 @@ setup({
function render() {
const html = renderApp()

// clear all styles
tw.clear()
// remember global classes
const restore = tw.snapshot()

// generated markup
const markup = comsume(html, tw)
const markup = consume(html)

// create CSS
const css = stringify(tw.target)

// restore global classes
restore()

// inject as last element into the head
return markup.replace('</head>', `<style data-twind>${css}</style></head>`)
}
Expand Down

0 comments on commit 319eba2

Please sign in to comment.