DEV Community

Discussion on: Using Tailwind with Vuejs

Collapse
 
equinusocio profile image
Mattia Astorino • Edited

Here a test using vue-cli 3 and enabling the extract css (instead to inline it). A 412kb css were loaded just using one apply on a button. This is the first fail because i'm applying a bunch of classes in my component, i don't need the full bundle. The component class is inside the bundle.

.btn {
  @apply .font-bold .py-2 .px-4 .rounded .bg-red .text-white;
}
Enter fullscreen mode Exit fullscreen mode


Even with a lazy loaded component it include the 400kb css "core" bundle beside the component css (where the above class and @apply is used). The bundle contains all the class combinations, media queries, selector hacks, and so on, even if don't need them in my component. So another fail:


Disabling the extract css feature, it keeps working, inlining the component style and a "normalize/core style". no .css bundle were loaded. This is a "meh" because it's better than the extracted css:

Collapse
 
finallynero profile image
Nero Adaware

Awesome stuff here, very informative.