scss setup

Project 4: Web Style Guide

Sections of this Guide:

  • How to approach this project includes detailed guidance to help you think about how to organize your code, project and files.

  • How to succeed at this project A final checklist to go over before submitting your project.

    How to Approach this Project

    For this fourth project, you will use the starter CSS found in resources/css/styles.css and convert it to Sass!

    Getting started

  • ❑  Download the project starter files.

    • ❑  Related resources: Web Style Guide Project Instructions

    • ❑  Open the resources/index.html file in your browser of choice. This will serve as the mockup

      for the project.

  • ❑  Set up a new GitHub repo and push the project files to it. Related video: Share Your Projects with GitHub
    Related video: Introduction to Git

  • ❑  Install Dart Sass if you haven’t done so already.
    Related video: Process Sass with Scout-App
    Related resources: Install Dart Sass CLI: Mac | Windows

  • ❑  Create your scss directory and styles.scss file.

    • ❑  Related video: Separate Your Stylesheet Into Partials

    • ❑  Create an scss folder inside of your project's root folder. All of your scss partial files,

      including sub-folders to organize them will go in here.

    • ❑  Create a styles.scss file inside of your newly created scss folder.

      Setting up your partials

Front End Techdegree

Create your partial sub-folders inside the scss directory. Related video: Breaking the Stylesheet Into Partials
Create a utilities folder inside of your scss folder.
Create a base folder inside of your scss folder.

Create a components folder inside of your scss folder. Create your partial files inside the partial sub-folders.

Related video: Breaking the Stylesheet Into Partials

The utilities folder:
Create an file inside of your folder.

_normalize.scss

Front End Techdegree

  • ❑  Create a

  • ❑  Create a

file inside of your folder. file inside of your folder.

_index.scss

_variables.scss

The base folder:

  • ❑  Create an file inside of your base folder.

  • ❑  Copy the
    folder, then rename it to .

  • ❑  Create a

    The components folder:

  • ❑  Create an

  • ❑  Create a

  • ❑  Create a

  • ❑  Create a

  • ❑  Create a

  • ❑  Create a

  • ❑  Create a

    Import your partial files

utilities

_mixins.scss

utilities

_index.scss

normalize.css

file from the folder and paste it into the base file inside of your base folder.

_typography.scss

_index.scss

file inside of your file inside of your

folder. folder.

folder. folder.

folder. folder.

folder.

file inside of your file inside of your

file inside of your file inside of your

file inside of your

Import the individual files in each partial folder via the _index.scss files. Related video: Finishing and Importing Our Partials

The utilities folder _index.scss:
Open the _index.scss file inside of your folder. Copy and paste the code below into the file:

utilities

resources/css/

components

_grid.scss

components

_navigation.scss

components

_buttons.scss

components

_forms.scss

components

_images.scss

components

_media-queries.scss

components

utilities

_index.scss

Front End Techdegree

/* ============================================= */ /* Utilities Imports */
/* ============================================= */

@import 'variables'; @import 'mixins';

The base folder _index.scss:
Open the _index.scss file inside of your base folder.
Copy and paste the code below into the _index.scss file:

/* ============================================= */ /* Base Imports */
/* ============================================= */

@import 'normalize'; @import 'typography';

The components folder _index.scss:
Open the _index.scss file inside of your Copy and paste the code below into the

folder. file:

components

_index.scss

/* ============================================= */ /* Components Imports */

/* ============================================= */

@import 'buttons'; @import 'forms'; @import 'navigation'; @import 'images';

@import 'grid';
@import 'media-queries';

Import your partials sub-folders index files

The scss folder styles.scss:
Open the styles.scss file inside of your scss folder.
Copy and paste the code below into the styles.scss file:

/* ============================================= */ /* Sub-Folder Imports */

/* ============================================= */

@import 'utilities/index'; @import 'base/index';

@import 'components/index';

Move the starter css to your scss partials

Open the resources/css/styles.css file.
Make note of the different code blocks separated by code comment headings, for example:

Front End Techdegree

/* /* /*

/* /* /*

/* /* /*

/* /*

============================================= */ Base styles */

============================================= */

============================================= */ Typography */

============================================= */

============================================= */ Grid System */

============================================= */

============================================= */ Navigation */

/* ============================================= */

Move the starter css to your scss partials (cont.)

Copy the CSS code from the resources/css/styles.css file into your scss partials.

  • ❑  Copy the code that is under _typography.scss partial file.

  • ❑  Copy the code that is under

  • ❑  Copy the code that is under

    file.

  • ❑  Copy the code that is under

  • ❑  Copy the code that is under

  • ❑  Copy the code that is under

  • ❑  Copy the code that is under

    partial file.

both the Base styles and Typography code comments to your

the the

the the the the

code comment to your code comment to your

Buttons code comment to you
Forms code comment to your
Images code comment to your
Media Queries code comment to your

partial file. partial

partial file. partial file.

partial file.

Grid System

_grid.scss

Navigation

_navigation.scss

r _buttons.scss

_forms.scss

_images.scss

_media-queries.scss

Start converting the starter CSS to Sass

Start creating your Sass variables.

  • ❑  Open your _variables.scss partial file.

  • ❑  Create at least 5 color variables.

  • ❑  Create at least 1 variable for the media query breakpoint.

  • ❑  Go through each of your scss partial files and replace the hard coded css values with your

    variables.

  • Related video: Declaring and Using Variables

  • Related video: Naming Variables

  • Related video: Color Variables

  • Related video: Font and Asset Variables

  • Related video: Media Queries and Breakpoint Variables


Comments

Popular posts from this blog

how to code a weather forecast web

What Build Tools Do JavaScript Developers Use?

WordPress Theme Development From Scratch - 3. Enqueuing CSS and JS to W...

how to use :focus

unit3.online registration form tricks: input field box align right and placeholder text right, but input text left.

how to screenshot a drop down menu on mac

Numbers in JavaScript introduction