-
I'm using this with 0.16 in Deno:
How do i accomplish the same with 1.0? |
Beta Was this translation helpful? Give feedback.
Answered by
sastan
Jan 10, 2023
Replies: 1 comment 3 replies
-
Almost the same: https://replit.com/@sastan/twind-css-example#index.js import { twind as setup, virtual, cx, stringify } from 'https://esm.sh/twind/@twind/[email protected]'
import presetTailwind from 'https://esm.sh/twind/@twind/[email protected]'
function normalize() {
return '.normalize{color:#fff}'
}
const tw = setup({
presets: [presetTailwind({ disablePreflight: true })],
theme: {
fontFamily: {
sans: ["Helvetica", "sans-serif"],
serif: ["Times", "serif"],
},
},
}, virtual());
export function twind(...classes) {
tw.clear();
return {
classNames: ['normalize', ...tw(cx(...classes)).split(' ')],
style: normalize() + stringify(tw.target)
}
}
console.log(twind(['underline'])) |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
tmikaeld
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Almost the same: https://replit.com/@sastan/twind-css-example#index.js