Comment by chrismorgan

Comment by chrismorgan 14 hours ago

3 replies

Congratulations! Your regular class is now drowned by all the noise, and looks like a mistake. It will probably attract a red squiggly at some point and be culled by an aggressive linter.

rustc 13 hours ago

Why would a linter randomly remove a class name from your markup?

  • chrismorgan 12 hours ago

    I think it’s plausible, though probably not quite intentional at any point.

    The first step is a rule that all class must be valid Tailwind names. Honestly this would be useful, because people make mistakes, Tailwind’s names are often obtuse, and without this it’s hard to realise when you’ve got mistakes, because there’s so much noise. If you think a CSS checker should complain about unknown CSS property names or values, it stands to reason in this brave Tailwind world that the class attribute should receive the same treatment.

    Then the second step is making that rule autofixable, by removing invalid values. This is the sort of thing that shouldn’t happen, but easily could.

Vinnl 13 hours ago

Honestly I almost never do, because in practice it's really not necessary that often. But when I do, I just put it in front, then it's easy to find. It's never happened to me that it got marked as an error or culled by an aggressive linter, so I feel like those might be straw men?