Skip to content

This project demonstrates how to use **SASS** (Syntactically Awesome Stylesheets) to write cleaner and more powerful CSS, and how to compile it for browser use.

Notifications You must be signed in to change notification settings

learnwithfair/sass-project

Repository files navigation

SASS Workflow Guide

Youtube Facebook Instagram LinkedIn

Thanks for visiting my GitHub account!

This project demonstrates how to use SASS (Syntactically Awesome Stylesheets) to write cleaner and more powerful CSS, and how to compile it for browser use.


📁 Folder Structure

project-folder/
├── index.html
├── src/scss
│   └── main.scss
└── css/dist
    └── main.css (Generated after compiling)

🚀 How SASS Works – Step-by-Step

✅ Step 1: Create a SASS File

Write your styles in a file named main.scss using SASS syntax.

Example:

$primary-color: #3498db;

body {
  background-color: $primary-color;

  h1 {
    font-size: 2em;
    color: white;
  }
}

✅ Step 2: Compile SASS to CSS

Since browsers only understand CSS, we must compile the .scss file into a .css file.

Using Live Sass Compiler in VS Code:

  1. Install the Live Sass Compiler extension.
  2. Open your .scss file in VS Code.
  3. Click the “Watch Sass” button at the bottom.
  4. This will generate a compiled CSS file (main.css) in your project.

Example of generated CSS:

body {
  background-color: #3498db;
}

body h1 {
  font-size: 2em;
  color: white;
}

✅ Step 3: Link CSS File in HTML

Include the compiled main.css file in your HTML:

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="css/main.css" />
  </head>
  <body>
    <h1>Hello, SASS!</h1>
  </body>
</html>

📌 Notes

  • Do not link .scss directly in your HTML – it must be compiled to .css first.
  • Keep your SASS files organized in a separate scss/ folder.
  • Customize the output path in Live Sass settings if needed.

✅ Requirements


✅ SASS Settings

  • use the following code in your vscode settings.json
   // liveSass setup
  "liveSassCompile.settings.formats": [
    {
      "format": "compressed",
      "extensionName": ".css",
      "savePath": "/dist"
    }
  ],
  "liveSassCompile.settings.generateMap": true,

Happy styling with SASS! 🎨

Follow Me

github facebook instagram twitter YouTube

About

This project demonstrates how to use **SASS** (Syntactically Awesome Stylesheets) to write cleaner and more powerful CSS, and how to compile it for browser use.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published