SASS / SCSS
Beginner
1 min read
Setting Up SASS in a Project
Example
// ── Project setup steps & file structure ─────────────────────────────────────
// Terminal: install Dart SASS as a dev dependency
// npm install --save-dev sass
// package.json scripts section
// {
// "scripts": {
// "sass:build" : "sass src/scss/main.scss dist/css/main.css --style=compressed",
// "sass:watch" : "sass --watch src/scss:dist/css"
// }
// }
// Recommended directory layout
// my-project/
// ├── src/
// │ └── scss/
// │ ├── main.scss ← entry point (imports everything)
// │ ├── _variables.scss ← design tokens
// │ ├── _mixins.scss ← reusable blocks
// │ ├── _base.scss ← resets / global styles
// │ └── components/
// │ ├── _buttons.scss
// │ └── _cards.scss
// └── dist/
// └── css/
// └── main.css ← compiled output (do NOT edit by hand)
// src/scss/main.scss — entry point
@use 'variables';
@use 'mixins';
@use 'base';
@use 'components/buttons';
@use 'components/cards';
Related Resources
SASS / SCSS Reference
Complete tag & property list
SASS / SCSS How-To Guides
Step-by-step practical guides
SASS / SCSS Exercises
Practice what you've learned
More in SASS / SCSS