Sass

Projected Time

Prerequisites

Motivation

Sass is an industry standard used by companies such as Vox, NBC Universal, and Toyota. Learning how to use Sass will give you exposure, practice, and the know-how to jump into a Sass stack. Sass is packed with super features that make creating, maintaining, and updating CSS a simplified and elegant process.

Objectives

Participants will be able to:

Specific Things to Learn

Materials

Lesson

How to use Sass:

Common Mistakes / Misconceptions

Independent Practice

Activity 1 - How to set up SaaS

Activity 2 - Roll your sleeves up and learn Sass with Code Academy

Activity 3 - Put your new skills to work

Steps on linking:

  1. cd to your Static directory (/recipe-page/static), and mkdir SCSS, cd SCSS, and then touch main.scss main.css (any name you want)
  2. VS Code . to open those files
  3. http://css2sass.herokuapp.com/ Use this website to convert your original CSS code (from styles.css) into SCSS (make sure it’s SCSS form and not SASS!)
  4. Copy the SCSS code that is converted and paste it into your “main.scss”
  5. Cmd S to save (main.scss)
  6. Go to Terminal, type in “sass main.scss main.css” (this will link them)
  7. After this, you can open main.css and it should have converted the code there
  8. Go to your index.html (in VS Code) and delete the original CSS link and change it with this:
  9. Cmd S to save (index.html)
  10. Go to your webpage and refresh. It’ll look the same, but now go ahead and add new SCSS features (as extra practice, try to recreate your SCSS code from scratch)

NOTE VERY IMPORTANT!!!: whenever you make changes to the main.scss, remember to go back to the terminal and type in “sass main.scss main.css” to update everything

Tip: for future reference, it is best practice to make individual .scss files for variables, nesting, mixins, etc. and then using @import to import them into your primary (main.scss). It will keep all your code organized and easy to find.

Challenge

After exchanging CSS for Sass in Independent Practice, Activity 4, include advanced mixins to revamp your stylesheet.

Check for Understanding

Add two to three partials, mixins, and file imports to stylesheets and show another apprentice the before and after.