What's your approach to CSS?

https://www.reddit.com/r/web_design/comments/1j4yx8x/whats_your_approach_to_css/

created by -ThatGingerKid- on 06/03/2025 at 16:07 UTC

22 upvotes, 28 top-level comments (showing 25)

Do you use a framework? Do you create the CSS fully bespoke for every website? Have you more or less built your own "framework," and just iterate on your own work? Something else?

Comments

Comment by cakelly789 at 06/03/2025 at 16:18 UTC

29 upvotes, 1 direct replies

I have a starter template I have built over the years which covers a lot of sections with some bland default starter styling. I have a few classes that I can use for columns and hover states and such. I use SCSS and have a bunch of variables used throughout my template that are all in one file that I can quickly change out, like column gutters, border radius, brand colors etc. It is fairly barebones but gives me a great head start on new sites. This took quite a few years to get down right.

Comment by legendarydrew at 06/03/2025 at 16:22 UTC

14 upvotes, 1 direct replies

Depending on the project, I would either use SCSS or vanilla CSS, although I have become sold on CSS variables. I generally build bespoke stylesheets.

Comment by Fidodo at 06/03/2025 at 18:32 UTC

13 upvotes, 2 direct replies

CSS modules. We use scss, but minimally. With the features of modern CSS I'm curious if we can get away with not even using scss.

Maybe I'm just old, but compared to the CSS of the past, modern CSS is great and I don't feel the need for any framework. Just learn flexbox and grid.

Modules are mandatory for me though. It keeps your styles encapsulated and prevents specificity hell and encourages flat classes.

Comment by HollyShitBrah at 06/03/2025 at 16:17 UTC

6 upvotes, 1 direct replies

sass + postcss I basically build my own library

Comment by Joyride0 at 06/03/2025 at 18:06 UTC

4 upvotes, 1 direct replies

I tend to start with a stylesheet for something I've done that's similar to what I want to do. I'm pretty early in this though and rather than reusing components, I often rewrite the code and build them a slightly better way. Clearer code. Less code, that sort of thing.

Comment by jtiala at 06/03/2025 at 19:12 UTC

4 upvotes, 0 direct replies

CSS Modules. Lots of custom properties (=variables): design tokens, color palette, etc. PostCSS with a couple of plugins: always autoprefixer, usually postcss-nesting and postcss-custom-media, postcss-mixins if needed.

The odd case I’m not working with React and a custom component library, Tailwind serves me good.

Comment by dillonlara115 at 06/03/2025 at 16:29 UTC

3 upvotes, 0 direct replies

Depends on the project. A framework can save a lot of time, depending on your needs. I used to use Bootstrap but found it to be bloated over the years for most of what I was working on.

I love using scss/postcss when I can, as well.

Tailwind or something like DaisyUI, which is built on top of Tailwind, is a great option as it has some classes built to eliminate typing every Tailwind CSS utility class just to style a button. Typically, I don't think it's worth the time and effort to reinvent the wheel, so a framework will handle quite a bit of what you would need structural CSS for out of the box(grids and containers).

Comment by One-Diver-2902 at 06/03/2025 at 16:13 UTC

2 upvotes, 0 direct replies

If I'm working with others, I would probably use something that everyone is familiar with. If I'm working alone then it's done my way custom with no framework.

Comment by GroundedWren at 06/03/2025 at 16:56 UTC

2 upvotes, 0 direct replies

I have a css reset I drag around with me, but I mostly write wholly new vanilla css for every new site.

Comment by themaincop at 06/03/2025 at 21:35 UTC

2 upvotes, 0 direct replies

Tailwind, probably shadcn if i'm not working with a designer (or maybe shadcn even if I'm working with a designer since it's so extensible)

Comment by martinbean at 07/03/2025 at 11:55 UTC

2 upvotes, 0 direct replies

As I mainly work on “app”-style websites (so admin panels and the like) I still use Bootstrap. It comes with the components I need: navbars, cards, tables, tabs, etc. I’ll use the Sass-based version and then customised the variables to make it match the branding for whatever project I’m working on and make it look less “Bootstrap-y”.

I know Tailwind seems to be all the rage these days but I just can’t be arsed creating my own components for things like buttons, form fields; or installing “plugins” that add those just to end up with a site or app that looks “Tailwind-y”. And I’m definitely not paying for access to other “components” through Tailwind UI.

Comment by jayfactor at 06/03/2025 at 16:57 UTC

10 upvotes, 3 direct replies

Tailwind till I die.

Comment by iBN3qk at 06/03/2025 at 18:38 UTC

2 upvotes, 0 direct replies

I'm like Bob Ross.

Happy little divs.

Comment by bunny-hill-menace at 06/03/2025 at 17:07 UTC

1 upvotes, 0 direct replies

CSS variables integrated with JavaScript is a game changer. I’ve used tons of frameworks and I end up spending so much time overwriting everything.

As others have mentioned, I have a ton of mixins, variables, layouts, grids, forms, et al, that I use as starting points.

Comment by BekuBlue at 06/03/2025 at 17:16 UTC*

1 upvotes, 0 direct replies

I just use CSS without any styling library. Any modern web framework gives you global and scoped styling, which is all I need.

There are some global CSS files that I use from my starter template every time, something like the CSS reset stays the same but the CSS variables change from project to project. If I need anything project specific I add it. Styling made on specific components or pages stays scoped to just that component or page.

I made a small guide on writing modern and scalable CSS here: https://webdev.bryanhogan.com/[1][2]

1: https://webdev.bryanhogan.com/

2: https://webdev.bryanhogan.com/

Comment by debwesign at 06/03/2025 at 18:32 UTC

1 upvotes, 0 direct replies

SCSS for convenience; it easily compiles to one minified file & let's me do shorthand for some class names. I usually only use vanilla CSS variables, but SCSS mixins are really handy.

I write BEM-style CSS. It is kinda strict, but it keeps your code very organized & reusable.

I don't reuse much code across projects. I think this is a "me" thing; reusing code is great. I just don't find CSS to be all that reusable outside of like three responsive classes.

Comment by Miragecraft at 06/03/2025 at 22:25 UTC

1 upvotes, 0 direct replies

I built my own framework for fun and to have something mapped exactly to my preferences and tailored for my own developer experience rather than chasing loading speed and file size.

Comment by application_layer at 06/03/2025 at 22:37 UTC

1 upvotes, 0 direct replies

I have two approaches.

1. I use Tailwind most of the time, especially if I am working with a framework like Laravel

2. I start with a custom starter SCSS file for projects that need a fully custom touch.

Comment by azangru at 06/03/2025 at 22:39 UTC

1 upvotes, 0 direct replies

Fully bespoke.

Comment by Kaimaniiii at 07/03/2025 at 00:10 UTC

1 upvotes, 0 direct replies

I use CUBE CSS methodology and tailwind css

Comment by fishdude42069 at 07/03/2025 at 02:04 UTC

1 upvotes, 0 direct replies

sass one hundred percent, i can do scss and css just fine if i need to, but if i had the option i would never go back from sass

Comment by learncomputeracademy at 07/03/2025 at 02:48 UTC

1 upvotes, 0 direct replies

We don’t create fully bespoke CSS for every website from scratch. That’d be a time sink! Instead, We strike a balance.

For unique elements (like custom buttons or layouts), We write tailored CSS to fit the design, ensuring flexibility without reinventing the wheel.

Comment by sectorfour at 07/03/2025 at 04:47 UTC

1 upvotes, 0 direct replies

I work for a giant fortune 100 globomegacorp these days and a lot of our shit is locked down to a particular platform that really only allows authoring via drag and drop components. We also use a certain marketing automation software and for our eblasts I mostly use inline styles for that shitty outlook compatibility supplemented with some more traditional css for email clients that can handle it.

Aside from that I do admin a couple of our remaining Wordpress based sites that I built the templates for. For those I used a basic bootstrap boilerplate and built up from there. And then I tied an onion to my belt, which was the style at the time.

Comment by ___LOOPDAED___ at 07/03/2025 at 10:25 UTC

1 upvotes, 0 direct replies

Just organized scss files separated into different groups and files.

Add your favorite scss reset and helper classes that you can throw around everywhere. Make sure to style stuff so it's scoped.

Hardest part is naming stuff.

If a react project I use styled components.

Comment by ohlawdhecodin at 07/03/2025 at 10:31 UTC

1 upvotes, 0 direct replies

Have you more or less built **your own** "framework," and just iterate on **your own work**?

This.

As a slolo-freelancer I can choose the appeoach I like the most. So I use vanilla CSS only and over time I've built a minimal set of "utility" classes that let me build layouts in minutes. Also, switching elemtns/components around becomes dumb-easy.

If I had to work in a team, this solution wouldn't be ideal and I'd probably stick to whatever the team wants.