- This Readme is to help me remember how to setup my SCSS environment.
Install Sass with Ruby:
gem install sass
To compile your SCSS into CSS you need to let your Sass know where you are writing your code and give it a place to precompile the CSS into another file.
sass input.scss output.css
Link your new CSS file in your HTML.
<link href="output.css" rel="stylesheet">
- You can name your files whatever you'd like. The output css file should now contain all your pain CSS.
sass --watch /(inputfoldername:/(outputfoldername)
This command tells your Sass to recompile your .scss
file to CSS when the file is saved.
- Create a new
folder
in your directory for your.scss
files. It is best practice to name itscss
. - Move the
.scss
file into your new folder. - Create a new CSS folder and run the watch command for those folders.
sass --watch /(inputfoldername:/(outputfoldername)
- Remember to change the
<link>
tag in your HTML file.
- Create a new folder inside your
scss
folder calledpartials
. - Next make a new file
_newfile.scss
or_colors.scss
for example, inside thepartials
folder. - Import the partials with
@import
at the top of your main SCSS file.
@import 'partials/main-styles,
'partials/colors',
'partials/variables,
'partials/mixins,
'partials/helpers;