Integrate twobj and frontend frameworks
import { globalStyles, tw, theme, wrap } from "twobj"
const style = tw`block text-black`
const hocus = wrap`focus: hover:`
const value = theme`colors.blue.500`
console.log(globalStyles)
Apply component style by tw
prop.
function ComponentA(props) {
return <div tw="bg-black text-white ..." {...props} />
}
Add type definitions to your code.
Example for emotion
, change your tsconfig.json
:
{
"compilerOptions": {
"types": ["@emotion/react/types/css-prop", "babel-plugin-twobj/types/emotion"]
}
}