Table of Contents
Sass Boilerplate
This is a Sass boilerplate that can be used to initialize any basic Sass project
What this boilerplate contains
- Font-Awesome and Animate CSS is built in !
- 7-1 Folder Architecture
- Global Reset
- Gitignore Included
- Media Query Manager
- JavaScript Babel Compilation
- Development scripts : compile, serve and watch
- Production scripts : compile, prefix and compress.
How to use this boilerplate
Simply clone this repo in your local system, and you will get all the files & folders setup.
- Go to package.json and change any settings that you wish.
- run
npm installto install the dependencies - run
npm startto start the development server- will compile sass, concat vendors, compile js and run live server & watch
- run
npm run buildto build all the files for production- will compile, prefix and compress sass and vendors , and also compile js
Explanation
- You can simple remove anything that you don't wish to add in your project.
Font Awesome & Animate CSS
- They are already included in the HTML and you can use them out of the box
Folder Structure
- ./Public - contains files for production
- ./src - contains files you will be working on (vendors, sass, js)
- Sass uses 7-1 folder architecture
Node Packages
-
For Development
babel:watch- watchessrc/main.jsand compiles topublic/js/script.jssass:watch- watchessrc/main.scssand compiles topublic/css/style.cssconcat- concatenates allsrc/vendor/*into onepublic/src/vendors.cssserve- serves the public folderstart- runs all the above parallelly.
-
For Production
babel- compilessrc/main.jstopublic/js/script.jssass- compilessrc/main.scsstopublic/css/style.cssprefix- adds prefixes topublic/css/style.css&public/css/vendors.csscompress- compresses bothpublic/css/styles.css&public/css/vendors.cssbuild- runs all the above sequentially (also concatenates vendors)
Media Query Manager
-
It is written in
src/scss/abstracts/mixins, therefor is a mixin and can be included in any file where you want to add media query. -
Sizes premade are
- big-desktop : 1800px
- tab-land : 1200px
- tab-port : 900px
- phone : 600px
- phone-small : 450px
- phone-vsmall : 390px
-
Code to use it is
@include respond(device-name) { //device name will be replaced with device you wish
font-size: 8px;
}Hope it helps, Keep Coding ! 😊