DEV Community

Discussion on: Lit web components: Tailwindcss styles at build time

Collapse
 
onmax profile image
Max

Wow, great article!!! I have been struggling with this quite a lot of times, and you gave me the solutions! Thank you.

Just I would like to mention few things:

  • In the content of the script build-styles, you use require('tailwindcss')(tailwindConfig). with a dot at the end. I had to remove it so it could work
  • I added cssnano as a plugin, so the dev server doesn't clompain about weird characters introduced by Tailwind
Collapse
 
michaelwarren1106 profile image
Michael Warren • Edited

good catch! i'll fix that.

cssnano and autoprefixer are both good postcss plugins. If you want to write plain css but want to write it with nested syntax, postcss-nested is another good one, etc. I didn't include much in the way of talking about specific plugins because postcss's own docs talks about plugins and their usage in more detail.

Glad you liked the article!