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

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Kürzlich hochgeladen (20)

AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 

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 }