oliverdavies.uk/source/_daily_emails/2024-07-09.md

1.1 KiB

title date permalink tags cta snippet
You can do utility-first CSS with Sass 2024-07-09 daily/2024/07/09/you-can-do-utility-first-css-with-sass
software-development
css
tailwind-css
sass
~ You can do utility-first CSS with Sass, if you want.

Yesterday, I said that I'm working on a Sass project with no utility or atomic styles.

But, the two aren't mutually exclusive.

You can do both.

You can write your own utility classes, like flex, font-bold or text-red in Sass or plain CSS.

You can use a framework like Tailwind CSS, but you don't need to.

In some projects, with existing stylesheets and usually other frameworks, you can't add anothe full framework without having unintended consequences.

Usually, if I want to introduce utility classes to an existing project, I start by writing my own that are inspired by a framework such as Tailwind CSS and maybe refactor to the framework later once the concept has been introduced and the codebase is able to work with it.