When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

26

Transcript of When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

Page 1: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)
Page 2: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

#mswebcamp

Page 3: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

When a Sasquatch and a Boar get together (or how to use SASS and Grunt)

Ricardo Castelhano (@riccastelhano)

Fullstack Dev / Technical Manager / Certified Scrum Master / Certified Zend Engineer

Page 4: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

</WEB

Prerequirements

Page 5: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

</WEB

Page 6: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

</WEB

Page 7: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

• “In one word: automation (…) a task runner can do most of that mundane work for you—and your team—with basically zero effort.”

• “The Grunt ecosystem is huge (…), you can use Grunt to automate just about anything(…)”

• “Like minification, compilation, unit testing, linting, ...” (just check Grunt Plugins Page)

(src: gruntjs.com)

Why?

Page 8: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

• Install Grunt Command Line Interfacenpm install –g grunt-cli

• Create package.jsonnpm init

• Create Gruntfile.js

• Install Grunt Task Runnernpm install grunt –-save-dev

• Install SASS and Watch Tasksnpm install grunt-contrib-sass –-save-devnpm install grunt-contrib-watch –-save-dev

demo

Page 9: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

package.json

demo

Page 10: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

Gruntfile.js

demo

Page 11: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

package.json

after package installation

demo

Page 12: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

GruntThe JavaScript Task Runner

Gruntfile.js

after config is done

demo

Page 13: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

</WEB

Page 14: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASSSyntactically Awesome Style Sheet

• “(…)stylesheets are getting larger, more complex, and harder to maintain(...)”

• “(…)Sass lets you use features that don't exist in CSS yet like variables, nesting, mixins, inheritance and other nifty goodies that make writing CSS fun again(…)”

(src: sass-lang.com)

Why?

Page 15: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS

Declaration

Variables

Syntactically Awesome Style Sheet

Usage

Page 16: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Nesting

Syntactically Awesome Style Sheet

Page 17: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Partials & Imports

Syntactically Awesome Style Sheet

Page 18: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Operators

Syntactically Awesome Style Sheet

Page 19: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Control Directives & Expressions

Syntactically Awesome Style Sheet

Page 20: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Mixins

Syntactically Awesome Style Sheet

Page 21: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Functions

Syntactically Awesome Style Sheet

Page 22: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASS Inheritance

Syntactically Awesome Style Sheet

Page 23: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

SASSSyntactically Awesome Style Sheet

demo

Demo files

https://github.com/RicCastelhano/sassquatch-boar-demo

Page 25: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)

Thank You@riccastelhano

http://www.ricardocastelhano.net

Page 26: When a Sassquatch and a Board get together (or how to use Grunt to chew Sass)