SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
{ CSS Preprocessing }
With LESS & Sass
By: Brady Sammons
bradysammons.com | brady@brightroll.com | @soulrider911
{ Terms }
{Preprocessing}
Preprocessing is a method of extending the feature set of CSS by first writing the
style sheets in a preprocessed language, then compiling the code to pure CSS syntax
that we are all use to.
{ Compile }
A compiler is a computer program(s) that transforms source code written in a
programming language (the source language) into another computer language (the
target language).
{ Sass }
Syntactically Awesome Stylesheets - Sass is an extension of CSS, adding nested rules,
variables, mixins, operators, selector inheritance, and more. It’s translated to well-
formatted, standard CSS using the command line tool or a web-framework plugin. Sass is
based in Ruby
Designed by Hampton Catlin developed by Nathan Weizenbaum – 2007
{ LESS }
Write less do more - Less language provides the following mechanisms: variables, nesting,
mixins, operators and functions; then converted into standard css via javascript or an
application. Less is based in javascript.
Designed by Alexis Sellier 2009, was influenced by SASS.
{ How Does it Work? }
{ The Machine }
LESS / SASS Metalanguage Document Ruby / JS Output CSS
MR. COMPILER
{ Who Cares? }
{ A Few Reasons Why }
• It Saves time
• This is what CSS should have been to begin with
• Makes your CSS less repetitive (DRY)
• Easier to maintain
• Easier to read
• Make your websites look better
• More fun to code
• Extendable - Compass, LessHat
{ Possible Deterrents }
• Change of workflow
• Another syntax to learn
• Rely’s upon a compiler software
• Harder to debug
• Less documentation that CSS alone
• Don’t know how to set it up
{ Differences }
@ LESS VS $ Sass
{ Example }
Sass $
$ltgreen: #79c777;
#header {
	 Font-Size: 1.1em;
	 h2 {
	 	 color: $ltgreen;
	 }
}
LESS @
@ltgreen: #79c777;
#header {
	 Font-Size: 1.1em;
	 h2 {
	 	 color: @ltgreen;
	 }
}
#header {
	 Font-Size: 1.1em;
}
#header h2 {
	 color: #79c777;
}
CSS (compiled)
{ Comparison }
SASS ($)LESS (@)
Operators
#header{
width: (@headerW - 50) * 2;
}
#header{
width: ($headerW - 50) * 2;
}
Frameworks
Language Base
LESSHat, LESS ELEMENTS
Javascript (originally Ruby)
COMPASS
Ruby
Functions lighten(#ff0000, 10%);
Saturate(#ff0000, 20%);
lighten(#ff0000, 10%);
Saturate(#ff0000, 20%);
Mixins
@mixin {
width: 50%;
: ;
}
{
width: 50%;
: ;
}
Parametric Mixins
( px){
: ;
: ;
: ;
}
( px){
: ;
: ;
: ;
}
Variables @plainRed: #ff0000;
: #bce7f3;
$plainRed: #ff0000;
: #bce7f3;
{ Compiling Apps }
LESS SASSBOTH
Less.app Codekit
Fire.app
Scout
Livereload
{ Some Live Code }
{ Game On }

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

CSS preprocessing - Sass vs Less by Brady Sammons

  • 1. { CSS Preprocessing } With LESS & Sass By: Brady Sammons bradysammons.com | brady@brightroll.com | @soulrider911
  • 3. {Preprocessing} Preprocessing is a method of extending the feature set of CSS by first writing the style sheets in a preprocessed language, then compiling the code to pure CSS syntax that we are all use to.
  • 4. { Compile } A compiler is a computer program(s) that transforms source code written in a programming language (the source language) into another computer language (the target language).
  • 5. { Sass } Syntactically Awesome Stylesheets - Sass is an extension of CSS, adding nested rules, variables, mixins, operators, selector inheritance, and more. It’s translated to well- formatted, standard CSS using the command line tool or a web-framework plugin. Sass is based in Ruby Designed by Hampton Catlin developed by Nathan Weizenbaum – 2007
  • 6. { LESS } Write less do more - Less language provides the following mechanisms: variables, nesting, mixins, operators and functions; then converted into standard css via javascript or an application. Less is based in javascript. Designed by Alexis Sellier 2009, was influenced by SASS.
  • 7. { How Does it Work? }
  • 8. { The Machine } LESS / SASS Metalanguage Document Ruby / JS Output CSS MR. COMPILER
  • 10. { A Few Reasons Why } • It Saves time • This is what CSS should have been to begin with • Makes your CSS less repetitive (DRY) • Easier to maintain • Easier to read • Make your websites look better • More fun to code • Extendable - Compass, LessHat
  • 11. { Possible Deterrents } • Change of workflow • Another syntax to learn • Rely’s upon a compiler software • Harder to debug • Less documentation that CSS alone • Don’t know how to set it up
  • 12. { Differences } @ LESS VS $ Sass
  • 13. { Example } Sass $ $ltgreen: #79c777; #header { Font-Size: 1.1em; h2 { color: $ltgreen; } } LESS @ @ltgreen: #79c777; #header { Font-Size: 1.1em; h2 { color: @ltgreen; } } #header { Font-Size: 1.1em; } #header h2 { color: #79c777; } CSS (compiled)
  • 14. { Comparison } SASS ($)LESS (@) Operators #header{ width: (@headerW - 50) * 2; } #header{ width: ($headerW - 50) * 2; } Frameworks Language Base LESSHat, LESS ELEMENTS Javascript (originally Ruby) COMPASS Ruby Functions lighten(#ff0000, 10%); Saturate(#ff0000, 20%); lighten(#ff0000, 10%); Saturate(#ff0000, 20%); Mixins @mixin { width: 50%; : ; } { width: 50%; : ; } Parametric Mixins ( px){ : ; : ; : ; } ( px){ : ; : ; : ; } Variables @plainRed: #ff0000; : #bce7f3; $plainRed: #ff0000; : #bce7f3;
  • 15. { Compiling Apps } LESS SASSBOTH Less.app Codekit Fire.app Scout Livereload
  • 16. { Some Live Code }