Absolute takes the element out of the flow while relative maintains it in the flow.
• this name works with Grid and Flexbox
• this convention matches justify-items and justify-self, which makes sense
to your point I still confuse it with align-content sometimes.
It's also not zero based which I always forget.
const plugin = require('tailwindcss/plugin')
const aliasFlexboxAlignment = plugin(function({ addUtilities }) {
addUtilities({
'.cross-axis-baseline': { 'align-items': 'baseline' },
'.cross-axis-center': { 'align-items': 'center' },
'.cross-axis-end': { 'align-items': 'flex-end' },
'.cross-axis-start': { 'align-items': 'flex-start' },
'.cross-axis-stretch': { 'align-items': 'stretch' },
'.main-axis-around': { 'justify-content': 'space-around' },
'.main-axis-between': { 'justify-content': 'space-between' },
'.main-axis-center': { 'justify-content': 'center' },
'.main-axis-end': { 'justify-content': 'flex-end' },
'.main-axis-evenly': { 'justify-content': 'space-evenly' },
'.main-axis-normal': { 'justify-content': 'normal' },
'.main-axis-start': { 'justify-content': 'flex-start' },
})
})I also like Tailwind because it’s so self-documenting. Even if Tailwind’s development were to stop, tomorrow, and all of the style sheets were lost globally, I would know what everything is meant to be.
I think it’s much easier to understand what
<input class=”input input--email input--valid”>
is supposed to be compared to <input class=”bg-white focus:outline-none focus:shadow-outline border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal”>Secondly though, and why this opinion is frankly stupid, is that I can just put this in my CSS code before it’s built through Vite:
input { @apply bg-white focus:outline-none focus:shadow-outline border border-gray-300 rounded-lg py-2 px-4 block w-full appearance-none leading-normal; }
And then lo and behold, I’ll do you one better:
<input type=“text”> </input> is now fully styled, with Tailwind only.
Strange you would be worried about accidental overrides with class selectors but then go ahead to target styles with tag selectors. Is that not objectively worse?
Btw, targeting input[type=”text”] means now you cannot apply those styles to a regular <span> or <div> using a class, which is sometimes useful, especially in very large projects.
I am still not at all convinced Tailwind is even slightly useful. It feels like shoehorning HTML4 <color>, <font> etc. into HTML5 classes.
All in all, your arguments come off as ad hoc rationalizations for a personal preference, not as substantial examples of Tailwind’s superiority over more traditional CSS approaches.
Sure you can change that. But that covers the flex default behavior.