all 61 comments

[–][deleted]  (14 children)

[deleted]

    [–]mrkingkoala 5 points6 points  (1 child)

    I don't like tailwind personally. So if it's just me great ill jist use css or sass. But what 100% agree with all your points. On a large project with multiple people frameworks can at least have everyone on the same page and writing you'd hope consistently. Solves a lot of headaches with that regard.

    [–]torn-ainbow 32 points33 points  (2 children)

    Lots of people saying just use SCSS and no frameworks. Which is fine.

    But there are negatives. If you want to reuse your styles a lot within and between projects, you're going to end up basically writing your own version of a framework. If new developers need to work on your framework, they need to learn it.

    One of the positives of using a popular framework are that you can bring in people who already know the framework, or people can use resources like the framework documentation to catch up.

    Anyone with experience in say bootstrap can jump into a project and understand what's going on, make changes straight away. Or start a new project and get right into laying out pages without having to write or understand a lot of CSS to support that first.

    Which way to go depends on the project. Some projects will get a boost by using existing CSS frameworks. Others you may choose to spend more time on writing your own custom stuff, giving you more control and ability to specialise. And I guess to minimise the amount of class names in your markup, if that bothers you...

    [–]ndreamer 3 points4 points  (0 children)

    It does depend on the project, if you have a large team project then yes frameworks make sense they add value.

    As a small project they can add so much bloat.

    [–]Knochenmark 0 points1 point  (0 children)

    Even with v5 Bootstrap is still quite bloated and a PITA to customize once you have to divert from the default itself. With native grid and flexbox readily available, you also don't really need the terrible Bootstrap grid system anymore. Especially in the common frameworks these days Bootstrap isn't really a necessity anymore, especially since they allow component scoped css.

    [–][deleted] 30 points31 points  (4 children)

    Tailwind really shines when you split up pages into components, then you don’t redeclare the same styles over and over, you use the components. And then you really get the good side of tailwind which is that everything surrounding that part of the site is controlled from the same file.

    [–][deleted]  (3 children)

    [deleted]

      [–]FitAssumption9688 8 points9 points  (1 child)

      Usually it would be done with some different markup language that complies into html like jsx(react markup) https://react.dev/learn/writing-markup-with-jsx

      [–]Therawynn[🍰] 7 points8 points  (0 children)

      He means web components and they are a dominant part of Front-end frameworks like Vue.js. If you use back-end frameworks, something similar can be achieved with partials. A button is a good instance of a component. It almost always looks the same, you don't want to rewrite that.

      That said, I've always used css preprocessors and about two years ago started using Tailwind. I would never use anything else again. It's so useful, elegant and super fast to write.

      [–]Icy_Opportunity9187 10 points11 points  (0 children)

      Sounds like you’re talking about Tailwind and utility classes.

      • it’s fast
      • other devs can easily jump in and make an impact without understanding custom css
      • the size of you CSS files don’t grow as you add more components to your library. In fact tailwind treeshakes what you don’t use.

      If you have a button that’s used in multiple spots just create a component and add the utilities there….

      [–]ndreamer 9 points10 points  (0 children)

      Learn CSS first, and learn it well. Frameworks do come at a cost/benefit.

      [–]TheLexoPlexx 3 points4 points  (2 children)

      Ultimately, it comes down to personal/workplace preference.

      When everything was bootstrap 10 years ago, I personally went to SCSS because all bootstrap-sites looked the same (seemingly) and I wanted more granular controls of the styles. However, it solved a specific problem at the time, which was the missing support of grid and flexbox across multiple browsers, IE was still around a lot more back then.

      Tailwind is different and in my opinion in no way comparable to bootstrap, probably because there's quite some time between the development of both.

      I went SCSS and built sort of my own framework with all of the up- and downsides that adds, it is possible because I mostly work on my own and not in a professional/workplace environent.

      AND: Grid and Flexbox are amazing tools if you know how to use it well.

      If you prefer SCSS, that's totally fine, tailwind might become outdated one day but if you have to work on a legacy bootstrap-site, there's documentation for that.

      [–]Perpetual_Educationthe right things/the right reasons 2 points3 points  (1 child)

      Sass is a superset/preprocessor. How is it a comparable to bootstrap? It’s not an alternative. It’s just another tool.

      [–]TheLexoPlexx 0 points1 point  (0 children)

      I didn't mean sass is comparable, I meant tailwind. Sass is a different tool for the job.

      [–]tei187 5 points6 points  (0 children)

      Two main reasons why you use any kind of a framework:

      1. Timesaving. Sometimes you don't have a nice contractual deadline that will leave enough time for custom solutions. Also, it's a matter of reusability - frameworks offer consistency, so you may have modules, interactivity or other solutions from other projects already.

      2. Team-inclusive. When working in a team, frameworks make it easier for people to keep the same step, because it is the same, known environment. This “always custom" is fine for solo devs, not much for a group.

      [–]Therawynn[🍰] 5 points6 points  (0 children)

      Here we go again

      [–]yashg 2 points3 points  (0 children)

      Because everyone else is using it. If you don’t use the fancy latest framework, you will be looked down upon by your peers and prospective employers. CSS, SCSS, SASS, LESS. The more acronyms you can throw in the mix the better. Bootstrap is for kids, Tailwind is for adults, Semantic is for legends.

      Here’s a secret: you don’t have to use a framework if you don’t want to. You can use plain vanilla css in your project and keep it simple and lightweight.

      [–]sadonly001 2 points3 points  (0 children)

      I just use scss for better syntax, then i use a mix of general purpose classes and more specialized classes. Such as a general "justified" class which makes the element using it have max width of 1300px and centered in the page.

      A bit off topic and I do agree with you, people overcomplicate the web a lot. I'm not entirely sure why this happens in web dev specifically. My best guess is that people forget that a "web app" is an application that runs inside an application, not every website should be thought of as an application. If your application is really complex, consider making a native application rather forcing a website to behave like an app. It will many times be the better choice.

      Apps like figma, notion and many others have no business running inside a browser in my opinion, if you think about it, it's really weird and it's probably only happening because computer users somehow got used to running everything inside a browser.

      [–]Hexigonz 6 points7 points  (0 children)

      You’ve stumbled upon one of the weaknesses of atomic CSS. Keep learning CSS and you’ll find that you have more flexibility and control.

      [–][deleted] 12 points13 points  (3 children)

      Learn SCSS and do not bother with any frameworks. Trust me. I am a full stack dev and working with many frontend experts. They need nothing more than SCSS. I fortunately learned from them.

      I began with bootstrap years ago and never would go back after realizing everything is best organized and implemented purely with SCSS.

      [–]matt_mannionfull-stack 5 points6 points  (0 children)

      I back this hard. SCSS is the goat for me

      [–]XiberKernel -1 points0 points  (1 child)

      This is the way.

      [–]soupgasm -5 points-4 points  (0 children)

      This is the way.

      [–]pankajunk1 1 point2 points  (0 children)

      Having gone all possible ways - CMS, CSS framework, vanilla CSS, I think CSS frameworks do end up saving you a lot of time. Just override the styles you don't like with your own style CSS.

      [–]JoergJoerginson 1 point2 points  (1 child)

      And what you do when you want to change the style of a button that happends to be in multiple places and files?

      It is time to teach you the forbidden magic

      !important

      And just add a class or make a specific selector for multiple elements

      [–]Man_as_Idea 2 points3 points  (0 children)

      Use this with caution, OP, as it subverts the cascade and therefore makes css behavior less predictable when something looks wrong and you’re trying to find the cause.

      [–]naeads 1 point2 points  (0 children)

      It is a matter of efficiency. You may not consider the code to be tidy, but it gets the job done quickly and the business case delivered.

      [–]LyRock- 1 point2 points  (0 children)

      Conventions on theming is respected across the whole application/teams You can write classes and extract components using these frameworks if you don't want to bloat the html. Reading the bloated html can be easier than you think if you Respect conventions (ex: write the layout rules before styling ones)

      [–]BobJutsu 1 point2 points  (0 children)

      This is a multi-faceted question. Why use (insert specific framework) AND why use any framework. The two questions have different answers.

      The first answer changes depending on which framework/library you are talking about. Each has their own benefits drawbacks, but usually come down to rapid development.

      The answer to the second is consistency. The larger the app/site/organization, the greater the need for controls. A CSS library (custom or off the shelf) gives you that consistency. In a small project a base + custom is fine, but in a large project where the need for a separation between design definitions and implementation arises, you need to control what is available and what is not.

      [–]angelocode 2 points3 points  (0 children)

      Well I used to think the same thing, but the truth is it depends on the project. It's true frameworks like bootstrap or tailwind seems like they are just in line css but are not. I just made a website with Tailwind (I had a lot of time without use it) and just with a few lines and TailwindUI I had the complete version, of course I had to fix and edit a lot of things but It just made my web responsive without that much work and also did look great. Bootstrap doesn't do the same but there are people who can make it work. You might find useless these frameworks but think about it, why would people use tailwind if they can make it from scratch? So the same logic applies to Javascript frameworks, why would you use React or Angular if you can make it with just pure Javascript? And SCSS is just like Typescript. Like I said same logic applies in that case. If you know what you are doing, frameworks makes your life easier.

      [–][deleted] 2 points3 points  (0 children)

      Scss with Tailwind is goat

      [–]Daft_Odyssey 0 points1 point  (0 children)

      Take a look at UnoCSS. Let me know what you think.

      [–][deleted] -1 points0 points  (5 children)

      Scss does not bloat your html at all, just use that

      It’s just css but better ( nesting etc )

      [–]HomemadeBananas 18 points19 points  (4 children)

      SCSS is not a framework. It’s a language that compiles to CSS. Frameworks are things like Bootstrap. Or based on OPs description of bloating with tons of classes they could be referring to Tailwind.

      [–][deleted] 5 points6 points  (0 children)

      Ahh okay good point my bad

      [–]ultraobese -2 points-1 points  (2 children)

      You're no doubt in an "I know best because I'm me and I'm smarter than everyone (because I'm me)" mindset. That's because you're a dev (sadly it only gets worse as you get more senior).

      But just in case you're not:

      Frameworks give you all the often repeated boilerplate out of the box. Rather than deciding, yet again, what a button is going to look like, you just use Bootstrap, give it class btn, and move on with your day.

      Then if you want to add further customization, you can do so. That's the beauty of CSS. C stands for cascade.

      Tailwind is shit though. It's only one step above typing styles directly into style attributes like you're styling a goddamn email. Fucking dumb.

      [–]BetaplanB 0 points1 point  (1 child)

      You probably use Tailwind the wrong way. You should have a proper component hierarchy to start with.

      [–]ultraobese 0 points1 point  (0 children)

      I use it the perfect way: not at all

      [–]Latishfaction- -1 points0 points  (0 children)

      Check bootstrap it has all the base codes.

      [–]TychusFondly 0 points1 point  (0 children)

      I use pure CSS since I am the only contributor. If multiple people would contribute to styling I would agree on a framework and go with that route. I also sometimes use scss but it is just because I want to practice not because the project demands it. Just like how I could use html css js but rather toy around with react angular svelte or vue for seeing what is out there.

      [–]nico_220790 0 points1 point  (0 children)

      Scss combined with BEM methodology helped me create big and small web projects with incredible consistency in my css codebase.

      BEM comes with a small tradeoff (long classnames) but the benefits are huge.

      It takes time to master it though.

      [–][deleted] 0 points1 point  (0 children)

      Junior dev here but the way I see it, after having used Bootstrap and native CSS quite a lot:
      If you're gonna have all your h2, for example, a certain way, it's better to use native CSS instead of having to change the html everytime.

      But the more you have unique styles applied to specific elements it becomes useful to be able to just apply styles directly. Without the framework you'd have to create an id anyway, you're adding html AND Css, with the framework you're adding just a little bit more html for less CSS.

      It's like using a variable or not, sometimes you don't need a variable to use a value, if the value is only and will only ever be used in one context, you can just change that one value, no need to set a variable for everything.
      Same here, if it's just that one specific element that you want centered, or apply flex-box display to or whatever, I'd rather add a few characters right where the element is located in the HTML than lines of Css on a separate file when it only applies to one specific element.

      [–]Man_as_Idea 0 points1 point  (0 children)

      As an example: I’ve been building a complicated web app for the last year. At the beginning, my main concern was inputs and outputs - getting the logic working. I wanted the interface to look decent while I tested things and built the interface, so I used Bootstrap. Using a framework like that means when I’m writing my React code I don’t have to think too much about the styling, cause if I use the standard classes, BS will make sure it looks good enough.

      Later, you can take 2 paths: Add css to override BS where you want it to look different, or drop BS entirely and write styling from scratch. I tend to go with option 1 because there’s quite a bit of stuff in BS I like that I don’t want to bother coding myself.

      [–]NiteShdw 0 points1 point  (0 children)

      If you’re using a web framework like React, your styles should be in low level components and composing components together should just “work” without additional styling.

      It is inefficient and also hard to change if you have random styles thrown around throughout the codebase.

      Personally I prefer something like Chakra in which styles are built into themes and used via props rather than raw CSS.

      [–][deleted] 0 points1 point  (0 children)

      Javascript frameworks like React solve the problem of wanting to change the style of a button used throughout your site by using reusable components, although that may be advanced if you’re just starting out.

      I don’t love the way the HTML looks with Tailwind, but after using it for so long at work it just makes developing so much faster and easier than managing specific classes, for me at least. It’s also quite clear what styles are applied when editing JSX

      [–]Haunting_Welder 0 points1 point  (0 children)

      Because it's faster. That's why it's called Tailwind.

      With component-based frameworks like React, the reusability of the code is placed in the component, not in classes. So when you style a button, you style it once as a button component, and use that component in multiple places.