5
Kage
5y

What do y'all think of Tailwind CSS?
https://tailwindcss.com

Comments
  • 4
    Gassy. Ew.
  • 2
    I haven't tried it, although my coworker is all for it.
    I'm not sure what to think about it and I'd love to hear what you guys think about it.
  • 5
    Makes your HTML look gross. Why is underline a class? It's just inline styling in disguise.

    Useless.
  • 1
    📍
  • 2
    @AlgoRythm Inline styles has terribly high specificity
  • 3
    @ScriptCoded Class styles have terribly low specificity. What's your point?
  • 2
    @AlgoRythm Overriding things can get quite tricky
  • 3
    @ScriptCoded The need to do so almost guarantees poor code.
  • 2
    @AlgoRythm Why would that be? Would you keep max one class per element instead? Never make components?
  • 3
    @ScriptCoded Classes define a style which is as self-contained as reasonable. I usually Max out at three or four classes per item. For example, I have items like "unselectable action" and I will define it as such:

    .unselectable{

    user-select: none;

    -all-the-prefixed-shit: none;

    }

    button.action{

    background: blue;

    /* other styles to completely define this button */

    }

    Any specific items such as font size or underline should be either specified inline or by ID, if they are not part of the typical style. If you find yourself underlining quite a lot of buttons, that's probably a class of it's own, and it should be treated as such. It should extend the action button.

    button.action, button.action-underlined{

    /* (Styles for button.action) */

    }

    button.action-underlined{

    text-decoration: underline;

    }

    Usually I would apply more than just one style. I would not typically just make a action-underlined class. This serves only for example. I am more likely to make a button.action-emphasized class and apply a few additional styles.
  • 3
    @ScriptCoded I have used ! important once. And it was dealing with someone else's code.
  • 3
    CSS Cascades for a reason. Define your styles for buttons, then modify that style for specific classes of button.

    Turning CSS into inline styling is a bastardization of the technology.
  • 5
    Tailwind is awesome, when used correctly.

    Setting classes directly onto elements is NOT the endgame. It's meant to be able to test and prototype as if you'd write normal css styles inline. In the end you'd be using these classes in container/wrapper classes, which get compiled down to plain css.

    It can bring some overhead CSS though, so be sure to use another tool to minify and strip out unused classes.
  • 3
    I hate the syntax. I would choose Bulma over it any day.
  • 2
    Check out https://mesh.versustune.de/
    100kb pure css framework, very close to completion.
  • 4
    @ainsclark hard to trust a css framework that doesn't have their own site together.
  • 3
    @AlgoRythm What you're saying actually makes sense. However, it's quite the opposite of how I've learned to do things. I would probably have quite a bit of a struggle with doing it that way, but as with anything it's probably just the learning curve. I won't refractor our whole code base to try it out rn, but I'll try it sometime ;)
  • 2
    @Kage like I said. It's close to completion.
Add Comment