tailwind-clj icon indicating copy to clipboard operation
tailwind-clj copied to clipboard

Rule ordering in generated css

Open mrmcc3 opened this issue 6 years ago • 2 comments

At the moment rules are sorted by class name before writing the css this is most likely a mistake. should investigate how tailwind orders css output

mrmcc3 avatar Jun 16 '19 04:06 mrmcc3

From my research it seems that the order of classes for one media query are not important, but it's important to order media query groups (to ensure correct precedence of CSS rules). So something like:

  1. default classes
  2. sm classes
  3. md classes

BTW, this looks like a great project, I was about to start implementing something very similar my self. Are you looking for contributors?

retro avatar Mar 17 '20 19:03 retro

Yep that matches my understanding of how the classes should be ordered. I think the current behaviour spits the media query groups out in order, the classes within each group are just sorted by name.

Since I wrote this there's been a fair bit of change in the tailwind space.

  • new releases of tailwindcss with new utilities.
  • plugins. https://tailwindcss-custom-forms.netlify.com/. would be nice to have something like this
  • tailwindUI. I think that uses a custom tailwind plugin

Anyway I'd be happy to accept contributions

mrmcc3 avatar Mar 17 '20 23:03 mrmcc3