Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 1.04 KB

import-tailwind.md

File metadata and controls

11 lines (6 loc) · 1.04 KB

Difference between @tailwind and @import tailwind/

While contributing in the nodejs.org repository, the imported css file styles were not getting applied. It was covered in the Tailwind Docs here.

The solution was to import the directives, from the node_modules.

@ovflowd explained the difference as:

@tailwind hooks directly into PostCSS engine, as @tailwind is a custom PostCSS plugin, this usually has faster loading and building of CSS and has some optimizations. But for us at least the performance impact isn't noticeable. The regular import also imports the whole Tailwind styles instead of invoking Tailwind's plugin to simply add what we need (it prescans the codebase); The Tailwind PostCSS plugin will still do transformations and afterwards remove what we don't use (with regular imports).

TIL - October 4th 2023.