SlideShare une entreprise Scribd logo
1  sur  18
Introducing
Sass, Grunt, Node modules
Priyanka Sethi
Sass is Syntactically Awesome
Stylesheet.
Sass is an extension of CSS that adds
power and elegance to the basic
language. - CSS WITH SUPERPOWERS
It allows you to use variables, nested
rules, mixins, inline imports and more,
all with fully CSS-compatible syntax.
Sass helps keep large style sheets well-
organized.
Features
Fully css-compatible.
Language extensions such as
variables, nesting and
mixins.
Well formatted, customizable
output.
Many useful functions for
manipulating colors and
other values.
Advanced features like control
directives for libraries.
Syntax- There are two syntaxes, we will be
focussing on SCSS,
Sassy CSS - It is an extension of the syntax of CSS,
which means every valid CSS stylesheet is a valid SCSS
file with the same meaning.
http://sass-lang.com/guide
CSS Extensions
Variables
$font-stack: Helvetica,
sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
Import
@import 'reset';
body {
font: 100% Helvetica, sans-
serif;
background-color: #efefef;
}
Mixins
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
border-radius: $radius;
}
.box { @include border-radius(10px); }
Extend/Inheritence
.message {
border: 1px solid #ccc;
padding: 10px;
color: #333;
}
.success {
@extend .message;
border-color: green;
}
.error {
@extend .message;
border-color: red;
}
Nesting
ul {
margin: 0;
padding: 0;
list-style: none;
li {
display: inline-block;
a {
display: block;
padding: 6px 12px;
text-decoration: none;
}
}
}
Ruby- Ruby uses Gems to manage its
various packages of code like Sass.
Sass is Ruby gem.
gem install sass
This will install Sass and dependencies.
Grunt - The JavaScript Task Runner.
Which basically means automation,
the less work you have to do when
performing repetitive tasks like
minification, compilation, unit
testing, linting etc.
After you’ve configured it through a
Gruntfile, a task runner can do most
of that mundane work with zero
effort.
Sample Gruntfile.js
http://gruntjs.com/sample-gruntfile
Plugins
http://gruntjs.com/plugins
grunt-contrib-uglify
Minify javascript files with UglifyJS
Run this task with the grunt uglify command.
https://www.npmjs.com/package/grunt-contrib-uglify
grunt-contrib-sass
Compile Sass to CSS
Run this task with the grunt sass command
https://www.npmjs.com/package/grunt-contrib-sass
grunt-contrib-cssmin
Minify CSS
Run this task with the grunt cssmin command.
https://www.npmjs.com/package/grunt-contrib-cssmin
grunt-contrib-watch
Run predefined tasks whenever watched file patterns are
added, changed or deleted.
Run this task with the grunt watch command.
https://www.npmjs.com/package/grunt-contrib-watch
Node.js - npm
npm is Node Package Manager.
Npm provides command line utility
to install Node.js packages, do
version management and
dependency management of Node.js
packages.
Installing modules using npm
npm install npm -g
Node comes with npm installed, but npm gets updated more frequently then
Node. So just to make sure, you have latest version.
npm install -g grunt-cli
The grunt command line interface. -g is for globally, we will have access to the
grunt command anywhere on your system.
Goals for next
presentation
1. How to implement all these in a project.
2. Explaining grunt, npm and sass with live example.
3. Code structure for english and arabic, how to make
things more dynamic.

Contenu connexe

Tendances

Tendances (20)

The Advantages of Using SASS and Gulp
The Advantages of Using SASS and GulpThe Advantages of Using SASS and Gulp
The Advantages of Using SASS and Gulp
 
Compass VS Less
Compass VS LessCompass VS Less
Compass VS Less
 
Introduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme developmentIntroduction to using Grunt & Bower with WordPress theme development
Introduction to using Grunt & Bower with WordPress theme development
 
WordPress Bootcamp Quiz
WordPress Bootcamp QuizWordPress Bootcamp Quiz
WordPress Bootcamp Quiz
 
Next.js in production by Jasdeep Lalli
Next.js in production by Jasdeep Lalli Next.js in production by Jasdeep Lalli
Next.js in production by Jasdeep Lalli
 
Universal React apps in Next.js
Universal React apps in Next.jsUniversal React apps in Next.js
Universal React apps in Next.js
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Postgres Open
Postgres OpenPostgres Open
Postgres Open
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
 
How to Contribute Code to MySQL?
How to Contribute Code to MySQL?How to Contribute Code to MySQL?
How to Contribute Code to MySQL?
 
DotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + reactDotNet MVC and webpack + Babel + react
DotNet MVC and webpack + Babel + react
 
Adobe Source 2016 - Styleguides and AEM
Adobe Source 2016 - Styleguides and AEMAdobe Source 2016 - Styleguides and AEM
Adobe Source 2016 - Styleguides and AEM
 
An Introduction to hapi.js
An Introduction to hapi.jsAn Introduction to hapi.js
An Introduction to hapi.js
 
MySQL for Beginners - part 1
MySQL for Beginners - part 1MySQL for Beginners - part 1
MySQL for Beginners - part 1
 
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
Nuxt로 사내서비스 구현하면서 얻은 경험 공유Nuxt로 사내서비스 구현하면서 얻은 경험 공유
Nuxt로 사내서비스 구현하면서 얻은 경험 공유
 
Sass installation
Sass installationSass installation
Sass installation
 
Webpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ StepsWebpack & React Performance in 16+ Steps
Webpack & React Performance in 16+ Steps
 
Building an API in Node with HapiJS
Building an API in Node with HapiJSBuilding an API in Node with HapiJS
Building an API in Node with HapiJS
 
Getting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress DevelopmentGetting Started With Grunt for WordPress Development
Getting Started With Grunt for WordPress Development
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 

En vedette

Designing for experiences in education barcamp
Designing for experiences in education barcampDesigning for experiences in education barcamp
Designing for experiences in education barcamp
Jasmeet Sethi
 
Task Automatisierung mit Grunt.js
Task Automatisierung mit Grunt.jsTask Automatisierung mit Grunt.js
Task Automatisierung mit Grunt.js
3rfan
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
Jon Dean
 
Professional Front End Development
Professional Front End DevelopmentProfessional Front End Development
Professional Front End Development
nelsonmenezes
 

En vedette (20)

Designing for experiences in education barcamp
Designing for experiences in education barcampDesigning for experiences in education barcamp
Designing for experiences in education barcamp
 
State of the Sass - The Mixin (November 2016)
State of the Sass - The Mixin (November 2016)State of the Sass - The Mixin (November 2016)
State of the Sass - The Mixin (November 2016)
 
Introduction to node.js, npm and grunt
Introduction to node.js, npm and gruntIntroduction to node.js, npm and grunt
Introduction to node.js, npm and grunt
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
Improve PowerShell reporting using SharePoint lists for results
Improve PowerShell reporting using SharePoint lists for resultsImprove PowerShell reporting using SharePoint lists for results
Improve PowerShell reporting using SharePoint lists for results
 
Sassy! Stylesheets with SCSS by Kathryn Rotondo
Sassy! Stylesheets with SCSS by Kathryn RotondoSassy! Stylesheets with SCSS by Kathryn Rotondo
Sassy! Stylesheets with SCSS by Kathryn Rotondo
 
Task Automatisierung mit Grunt.js
Task Automatisierung mit Grunt.jsTask Automatisierung mit Grunt.js
Task Automatisierung mit Grunt.js
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015
 
SASS - CSS with Superpower
SASS - CSS with SuperpowerSASS - CSS with Superpower
SASS - CSS with Superpower
 
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas TexasImproving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
Improving Workflows With Grunt.js - Big D Design 2014 - Dallas Texas
 
Introduction to SASS
Introduction to SASSIntroduction to SASS
Introduction to SASS
 
Grunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerGrunt - The JavaScript Task Runner
Grunt - The JavaScript Task Runner
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!
 
Professional Front End Development
Professional Front End DevelopmentProfessional Front End Development
Professional Front End Development
 
Sassy Stylesheets with SCSS
Sassy Stylesheets with SCSSSassy Stylesheets with SCSS
Sassy Stylesheets with SCSS
 
Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1Front-end development introduction (HTML, CSS). Part 1
Front-end development introduction (HTML, CSS). Part 1
 

Similaire à Introducing grunt, npm and sass

Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
Chris Lee
 

Similaire à Introducing grunt, npm and sass (20)

Bliblidotcom - SASS Introduction
Bliblidotcom - SASS IntroductionBliblidotcom - SASS Introduction
Bliblidotcom - SASS Introduction
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)Syntactically awesome stylesheets (Sass)
Syntactically awesome stylesheets (Sass)
 
Less(CSS Pre Processor) Introduction
Less(CSS Pre Processor) IntroductionLess(CSS Pre Processor) Introduction
Less(CSS Pre Processor) Introduction
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introduction
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Sass: Introduction
Sass: IntroductionSass: Introduction
Sass: Introduction
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan
 
Fasten RWD Development with Sass
Fasten RWD Development with SassFasten RWD Development with Sass
Fasten RWD Development with Sass
 
CSS3
CSS3CSS3
CSS3
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
css-tools
css-toolscss-tools
css-tools
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
SPS Oslo - Stop your SharePoint CSS becoming a di-sass-ter today!
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Introducing grunt, npm and sass

  • 1. Introducing Sass, Grunt, Node modules Priyanka Sethi
  • 2. Sass is Syntactically Awesome Stylesheet. Sass is an extension of CSS that adds power and elegance to the basic language. - CSS WITH SUPERPOWERS It allows you to use variables, nested rules, mixins, inline imports and more, all with fully CSS-compatible syntax. Sass helps keep large style sheets well- organized.
  • 3. Features Fully css-compatible. Language extensions such as variables, nesting and mixins. Well formatted, customizable output. Many useful functions for manipulating colors and other values. Advanced features like control directives for libraries.
  • 4. Syntax- There are two syntaxes, we will be focussing on SCSS, Sassy CSS - It is an extension of the syntax of CSS, which means every valid CSS stylesheet is a valid SCSS file with the same meaning. http://sass-lang.com/guide
  • 5. CSS Extensions Variables $font-stack: Helvetica, sans-serif; $primary-color: #333; body { font: 100% $font-stack; color: $primary-color; } Import @import 'reset'; body { font: 100% Helvetica, sans- serif; background-color: #efefef; }
  • 6. Mixins @mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius; } .box { @include border-radius(10px); }
  • 7. Extend/Inheritence .message { border: 1px solid #ccc; padding: 10px; color: #333; } .success { @extend .message; border-color: green; } .error { @extend .message; border-color: red; }
  • 8. Nesting ul { margin: 0; padding: 0; list-style: none; li { display: inline-block; a { display: block; padding: 6px 12px; text-decoration: none; } } }
  • 9. Ruby- Ruby uses Gems to manage its various packages of code like Sass. Sass is Ruby gem. gem install sass This will install Sass and dependencies.
  • 10. Grunt - The JavaScript Task Runner. Which basically means automation, the less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting etc. After you’ve configured it through a Gruntfile, a task runner can do most of that mundane work with zero effort.
  • 12. grunt-contrib-uglify Minify javascript files with UglifyJS Run this task with the grunt uglify command. https://www.npmjs.com/package/grunt-contrib-uglify
  • 13. grunt-contrib-sass Compile Sass to CSS Run this task with the grunt sass command https://www.npmjs.com/package/grunt-contrib-sass
  • 14. grunt-contrib-cssmin Minify CSS Run this task with the grunt cssmin command. https://www.npmjs.com/package/grunt-contrib-cssmin
  • 15. grunt-contrib-watch Run predefined tasks whenever watched file patterns are added, changed or deleted. Run this task with the grunt watch command. https://www.npmjs.com/package/grunt-contrib-watch
  • 16. Node.js - npm npm is Node Package Manager. Npm provides command line utility to install Node.js packages, do version management and dependency management of Node.js packages.
  • 17. Installing modules using npm npm install npm -g Node comes with npm installed, but npm gets updated more frequently then Node. So just to make sure, you have latest version. npm install -g grunt-cli The grunt command line interface. -g is for globally, we will have access to the grunt command anywhere on your system.
  • 18. Goals for next presentation 1. How to implement all these in a project. 2. Explaining grunt, npm and sass with live example. 3. Code structure for english and arabic, how to make things more dynamic.