# CSS Frameworks and Sass

> How CSS variables, Sass, Bootstrap and Tailwind save you from writing the same styles twice. What each one adds, and what it costs.

**Course:** [HTML, CSS and JavaScript](https://learn.benibix.com/learn/development-web)  
**Time:** 13 min

**After this lesson you can:**

- Set and reuse a CSS custom property
- Say what Sass adds and how it becomes CSS
- Tell Bootstrap's style from Tailwind's

## What each CSS tool saves you from writing

Plain CSS repeats itself fast. The same brand colour may appear 40 times in one file. Four tools cut that down. CSS custom properties store a value once. Sass adds extra features and turns into plain CSS. Bootstrap and Tailwind are CSS frameworks, ready-made sets of styles you use by class name.

A custom property, often called a CSS variable, is a name that starts with two dashes. You set --brand: #2a6df4 once, usually on :root, and use it with var(--brand) anywhere. Change the one line and every use changes. It also works live in the browser, so a dark theme can swap a few values.

Sass is a language that is turned into plain CSS before the browser sees it. Its files end in .scss. It lets you nest rules inside each other, split styles across many files, and write mixins, which are reusable chunks of styles. Browsers never read Sass itself. A build step turns it into a .css file.

Custom properties now do part of what Sass was used for. Plain CSS has started to allow nesting too. Sass is still common in older and larger projects. Many new projects use custom properties and plain CSS, and skip the extra step.

Bootstrap is a set of ready parts: buttons, menus, cards and forms, each with its own class. Its layout grid has 12 columns, so a box with class col-6 takes half the row. It first came out in 2011. Sites built with it are quick to make, and they often look alike.

Tailwind CSS takes another route. Each class does one small job: p-4 adds padding, text-lg makes text larger, flex turns on Flexbox. You build the look in the HTML from dozens of these. A build step then keeps only the classes you used, so the final CSS file stays small.

People often think a framework means you no longer need to learn CSS. But each Bootstrap class and each Tailwind class is plain CSS inside. When a layout breaks, you fix it with the same box model and the same scoring rules as before.

```css
:root {
  --brand: #2a6df4;
  --space: 1rem;
}

.button {
  background: var(--brand);
  padding: var(--space);
}
```
Set the brand colour once. Every rule that uses var(--brand) follows when it changes.

![Three panels. Custom properties: one line on :root sets --brand, and arrows carry it to a button, a link and a heading. Sass: a styles.scss file goes through a compile arrow and comes out as styles.css. Framework: classes such as btn, row and col-6 dropped into the HTML give a styled button and a two-column row.](https://learn.benibix.com/diagrams/dev5-css-tools.svg)

### Example: Emma rebrands a site in one line

Emma's client changes its brand colour from green to blue. The old CSS used the green code in 63 places.

She moves it into one custom property, --brand, and points all 63 rules at var(--brand). Next time the colour changes, she edits one line.

**Words in this lesson:** [CSS Custom Properties](https://learn.benibix.com/term/development/css-custom-properties), [Sass](https://learn.benibix.com/term/development/sass), [CSS Framework](https://learn.benibix.com/term/development/css-framework), [Bootstrap](https://learn.benibix.com/term/development/bootstrap), [Tailwind CSS](https://learn.benibix.com/term/development/tailwind-css)

**Question:** Does a browser read Sass files directly?

**Answer:** No, a build step turns Sass into plain CSS first. Browsers only read CSS. A Sass file is built into a .css file before the page uses it, so the browser never sees the nesting or the mixins.

---

Source: https://learn.benibix.com/learn/development-web/css-frameworks-and-sass
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
