6-SCSS and Gulp
Key Objectives
To modularize our CSS with SCSS (Sassy CSS) files.
To use gulp to pipe SCSS into our
main.cssfile.To set up gulp to watch for changes in our SCSS files and to then update/change the
main.cssfile.
Video
Overview
In this module, we set up more ways to make development cleaner. The problem that we're trying to solve is this: Using a single CSS file by itself becomes unwieldy and difficult to code. We want to be able to compartmentalize CSS for the navbar and function differently than CSS in the footer or about section. SCSS lets us do that. Gulp is there to merge all of our code into one file that the browser will read.
Notes/Tips
If this doesn't work for you at first, try copying and pasting our current
gulpfile.jsfrom the sample code into your individual project. If you do this, be sure to still read and understand the Gulpfile to the best of your ability.SCSS is a superset of CSS. This means that it is built on top of CSS, so the CSS work that you've already been doing is highly useful.
Once you start working with SCSS, you won't want to go back. Again, it's a small amount of work to get set up, but in the end, it is a humongous time saver.
Steps
Watch the instructional video.
Get a feel for the files in the example repo. Play around with some of the code and see what happens. Experiment.
Your major objective in your own application:
Set up SCSS with a small change in your application. Feel free to even replicate our change in the navbar, just to ensure it's working.
When you successfully make a change, go ahead and add, commit, and push the code.
Take a quick look at the SCSS docs. Use these for future reference.
Please kindly take a minute to update the LMS and tell us that you've completed the first group of modules.
Go on to the next module.
Here's the final code.
gulpfile.js_navbar.scss
Last updated