#Does anyone know why my my tailwind styles aren't getting applied?

11 messages ยท Page 1 of 1 (latest)

fair marlin
tulip siren
#

What do you mean ? left part has a tailwind feel ๐Ÿค”

#

what makes you thinkthey're not applied?

fair marlin
#

i was following shadcn docs to build an shadcn + astro project. styles re appplied for shadcn components (which are react) but when i use in my .astro files, styles are. not applied (see bg-red-500 in the screenshot above which is not applied on the ui).

turns out i got installed both tailwind.config.js and tailwind.config.mjs.
astro cli automatically created the .js variant but shadcn cli autosuggested .mjs which i missed out

tulip siren
#

prefer .mjs ๐Ÿ‘

fair marlin
#

why tho?

tulip siren
#

There are a few things to know about shadcn ui: if you have some components that communicate together through context (eg. Accordion), you need to use them in react files because of the way astro works

tulip siren
# fair marlin why tho?

because mjs means we run js in an ESM context, not CJS. Since Astro is ESM only, it's better

fair marlin
#

thanks for these knowledge bits, apprecite that. houston_salute

tulip siren
#

You're welcome!

frank galleon