Global styles #51
-
Is there some elegant way to apply global styles, similar to Emotion's useEffect(() => {
document.body.parentElement!.className = tw`text-gray-100 break-words bg-gray-900`
}, []) Right now, I have this in my App component as a workaround. This doesn't remove styles on unmount, nor does it server render. Does the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Take look at setup preflight |
Beta Was this translation helpful? Give feedback.
-
Nice! For future reading, here's how I did it for my example: preflight: (preflight, { theme }) => ({
...preflight,
":root": {
backgroundColor: theme("colors.gray.900"),
color: theme("colors.gray.100"),
overflowWrap: "break-word",
},
}), Though I wonder if there's a way to use preflight: (preflight, { tw }) => ({
...preflight,
":root": tw`bg-gray-900 text-gray-100 break-word`,
}), |
Beta Was this translation helpful? Give feedback.
Take look at setup preflight