Earlier quoted context omitted.
TailwindCSS can be abused to resemble inline styles, but part of TailwindCSS is the fact that you have some sort of design system you can quickly set up and build upon. For example, I could define a color called "primary" and use it anywhere without caring what the actual color is. Furthermore, styled buttons are such a common occurrence that TailwindCSS encourages users to extract common CSS patterns into component…
Extracting components? You mean like writing CSS classes? I'm so glad Tailwind is here to reinvent the wheel for us.
Show HN: Tailwind.run – An Online Playground for Tailwind CSS
81–90 of 97 posts
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#82Earlier quoted context omitted.
Inline styles (AFAIK) cannot be made responsive, are a pain to override given their high precedence, and do not provide any constraints—Tailwind is a design system too. From a size perspective, compression takes care of the repetition pretty well. Utility classes allow for better reuse, meaning the overall page often is, in fact, lighter. Nowadays most pages are put together using some kind of components anyway, so c…
Even if compression is the solution for most users, I would love to have a generator on the web site where I can click on "blue" and "orange" (because that's my color scheme and my site will never use teal), not click on "forms", "buttons" and "hover", and I get a quasi-minimal version of the CSS file. My smallish sites don't use build pipelines and post-generators and so on, I'd just like a reasonably-sized CSS file…
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#83Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#84Taiwind is nice. For those interested in Functional CSS, I've made a Scss/Sass framework too, with different approach. https://github.com/meerita/utilcss here is the article related http://minid.net/2019/04/07/the-css-utilitarian-methodology/ Once you start using funcional CSS, you don't want to go back.
One question about this approach: If I understand correctly, if I have some text that is bold, and later I want to change it into italic, I have to go into templates, locate all instances of the text and rename all the classes from font-weight--bold to font-style--italic? Seems like "quick to build, but hard to maintain" approach?
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#85Taiwind is nice. For those interested in Functional CSS, I've made a Scss/Sass framework too, with different approach. https://github.com/meerita/utilcss here is the article related http://minid.net/2019/04/07/the-css-utilitarian-methodology/ Once you start using funcional CSS, you don't want to go back.
> We have been programming CSS for a long time wrong. Have we though? I firmly disagree with the premise. I agree that like anything else, css can be abused and misused, and the example cited of Newspapers fits the narrative perfectly. I've worked at a major regional Newspaper in the past and their website was one of the worst sites I've seen. The lead developer at that time (10 years ago) switched to using a functio…
HTML is faster, by default, as I state in the article. It's the first document and it's the first one processed. If you have a CSS file of 10kb gziped your chances will be huge in comparison with the averaga ~160kb of some projects.
The problem with inline-css (how the modern js framework are handling) is that clashes with the responsive world and cannot be preprocessed so easily as other projects.
Besides the file size factor, give a check to the other points in the arguments: amount of rules slows the loading speed, rendering and painting, etc.
You're sticking to CSS, we also stick too :)
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#86Taiwind is nice. For those interested in Functional CSS, I've made a Scss/Sass framework too, with different approach. https://github.com/meerita/utilcss here is the article related http://minid.net/2019/04/07/the-css-utilitarian-methodology/ Once you start using funcional CSS, you don't want to go back.
One question about this approach: If I understand correctly, if I have some text that is bold, and later I want to change it into italic, I have to go into templates, locate all instances of the text and rename all the classes from font-weight--bold to font-style--italic? Seems like "quick to build, but hard to maintain" approach?
This doesn't stop you to code small and repetitive components like "buttons". There's an article where you can see how it works.
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#87Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#88Earlier quoted context omitted.
One question about this approach: If I understand correctly, if I have some text that is bold, and later I want to change it into italic, I have to go into templates, locate all instances of the text and rename all the classes from font-weight--bold to font-style--italic? Seems like "quick to build, but hard to maintain" approach?
Before I answer, do you want to change a particular module, particular text or you want to change site-wide things?
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#89Earlier quoted context omitted.
The first thought everyone has when seeing it is what you described, including myself. I suggest trying it out & reading more about it. It's the only way utility CSS frameworks like this seem to click. In my opinion, Tailwind works best when being used to create template components. In your button case you would just modify your reusable button component or the reusable base button component if you have multiple butt…
You get all of those benefits without any of the downsides by using any other modern styling solution, for example scoped styles and scss. The arguments against this solution far outweigh the arguments for it. You're free to disagree, of course.
Using utility classes to build a UI is much more like building something with SwiftUI, where no one seems to argue about this silly "separation of concerns" thing we talk about on the web.
Re: Show HN: Tailwind.run – An Online Playground for Tailwind CSS
#90Earlier quoted context omitted.
You get all of those benefits without any of the downsides by using any other modern styling solution, for example scoped styles and scss. The arguments against this solution far outweigh the arguments for it. You're free to disagree, of course.
Scoped styles and SCSS do not prevent you from having to come up with unnecessary names for things like utilities do. That's the main benefit in my opinion. Wasting brain cycles to name arbitrary wrapper divs that only exist to be a target for layout styles things like ".image-card-content-wrapper" is a completely unnecessary step in the UI development process. Using utility classes to build a UI is much more like bu…
I'm still not convinced — using only utility classes has very clear downsides, while using what's reasonably one of the most common approaches in the industry right now avoids those downsides while also providing additional benefits.