SlideShare a Scribd company logo
1 of 22
{LESS}
PRESENTED BY JEFF STAGG
Jeff Stagg
 Web developer since 2008
 Focus on .Net / C# / Javascript / HTML
 Defender of Web Standards
What is LESS?
 LESS compiles to CSS
@red: #f00;
@green: #0f0;
@blue: #00f;
@radius-size: 10px;
.round-borders(@color) {
-webkit-border-radius: @radius-size;
-moz-border-radius: @radius-size;
border-radius: @radius-size;
border: 5px solid @color;
}
.rounded {
&.red {
.round-borders(@red);
}
&.green {
.round-borders(@green);
}
&.blue {
.round-borders(@blue);
}
}
section>div {
display: inline-block;
width: 100px;
padding: 5px;
margin-left: 20px;
}
.rounded.red {
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
border: 5px solid #ff0000;
}
.rounded.green {
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
border: 5px solid #00ff00;
}
.rounded.blue {
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
border: 5px solid #0000ff;
}
section>div {
display: inline-block;
width: 100px;
padding: 5px;
margin-left: 20px;
}
Why LESS?
 CSS sucks
 LESS lets us make CSS components
 DRY pattern
Variables
Variables
 LESS lets us use variables in our code
 Assign variables by using ‘@variable: value’
 http://codepen.io/jeffstagg/pen/EaqeqZ?editors=110
String Variables
 We can store strings as values in variables
 Useful for image URLs
 @imageBaseUrl: ‘/Images/min/’
 http://codepen.io/jeffstagg/pen/zxgmow?editors=110
Variable Scope
 Variables have scope local to their current function
 http://codepen.io/jeffstagg/pen/ZYgqQO?editors=110
 http://codepen.io/jeffstagg/pen/emqPvg?editors=110
Nesting
Nesting Functions
 Organize your CSS
 Makes your code modular
 http://codepen.io/jeffstagg/pen/jEgvvo?editors=110
Mixins
What are Mixins?
 Functions reusable throughout your styles
 Follows DRY principals
Importing Mixins
 Mixins can be imported from files in your project
 @import ‘mixins’;
 https://gist.github.com/jeffstagg/cc6b9ca896a6bd34923d
Functions Support Arguments
 Arguments / Parameters can be passed into functions
 .function(@parameter) { color: @parameter; }
 http://codepen.io/jeffstagg/pen/bNXxLm?editors=110
Namespaces
Namespaces
 Mixins and Functions can be defined in Namespaces
 #namespace { .function(@color) { color: @color; } }
 http://codepen.io/jeffstagg/pen/qEeQbg?editors=110
Compiling LESS
Compiling LESS
 Client-Side (Javascript)
 Server-Side (Gulp/Grunt, Web Essentials, DotLESS, Koala)
Less.js
 LESS can be compiled client-side by using less.js
 https://gist.github.com/jeffstagg/2d4a87ee3d9d2c1559e2
Gulp
 NodeJS task runners like Grunt or Gulp can compile LESS server-side
 https://gist.github.com/jeffstagg/2585aee8899b75ed4eb4
Web Essentials for Visual Studio
 Web Essentials extension can compile LESS in real-time
 https://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7-
9df7-0f2a504ca361
Other Tools
 DotLESS
 Koala

More Related Content

Viewers also liked

Emily Kenney finalize engagement orgcom plus bib
Emily Kenney finalize engagement orgcom plus bibEmily Kenney finalize engagement orgcom plus bib
Emily Kenney finalize engagement orgcom plus bibEmily Kenney
 
Final HSTD394.21 Emily Kenney
Final HSTD394.21 Emily KenneyFinal HSTD394.21 Emily Kenney
Final HSTD394.21 Emily KenneyEmily Kenney
 
Overview - The APM Practice
Overview - The APM PracticeOverview - The APM Practice
Overview - The APM PracticeMichael Sydor
 
SFPUC and DataSplice Mobile for Maximo
SFPUC and DataSplice Mobile for MaximoSFPUC and DataSplice Mobile for Maximo
SFPUC and DataSplice Mobile for MaximoDataSplice
 
Akhir perang dunia 2
Akhir perang dunia 2Akhir perang dunia 2
Akhir perang dunia 2willisgita
 
SAINS BAHAN BUANGAN TAHUN 6
SAINS BAHAN BUANGAN TAHUN 6SAINS BAHAN BUANGAN TAHUN 6
SAINS BAHAN BUANGAN TAHUN 6ZAINALZH
 

Viewers also liked (8)

Ante proyecto 181115
Ante proyecto 181115Ante proyecto 181115
Ante proyecto 181115
 
Emily Kenney finalize engagement orgcom plus bib
Emily Kenney finalize engagement orgcom plus bibEmily Kenney finalize engagement orgcom plus bib
Emily Kenney finalize engagement orgcom plus bib
 
Final HSTD394.21 Emily Kenney
Final HSTD394.21 Emily KenneyFinal HSTD394.21 Emily Kenney
Final HSTD394.21 Emily Kenney
 
Overview - The APM Practice
Overview - The APM PracticeOverview - The APM Practice
Overview - The APM Practice
 
SFPUC and DataSplice Mobile for Maximo
SFPUC and DataSplice Mobile for MaximoSFPUC and DataSplice Mobile for Maximo
SFPUC and DataSplice Mobile for Maximo
 
Akhir perang dunia 2
Akhir perang dunia 2Akhir perang dunia 2
Akhir perang dunia 2
 
LT-4150_4-15_HR
LT-4150_4-15_HRLT-4150_4-15_HR
LT-4150_4-15_HR
 
SAINS BAHAN BUANGAN TAHUN 6
SAINS BAHAN BUANGAN TAHUN 6SAINS BAHAN BUANGAN TAHUN 6
SAINS BAHAN BUANGAN TAHUN 6
 

Similar to {LESS} Overview

CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingJames Cryer
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
設計與程式的溝通之道
設計與程式的溝通之道設計與程式的溝通之道
設計與程式的溝通之道Even Wu
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageKatsunori Tanaka
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsKaelig Deloumeau-Prigent
 
The Basics of CSS3
The Basics of CSS3The Basics of CSS3
The Basics of CSS3joshsurovey
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsSanjoy Kr. Paul
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESSjsmith92
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Alexandra Lo Cascio
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesDinu Suman
 

Similar to {LESS} Overview (20)

CSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y tryingCSS Preprocessors: LESS is more or look SASS-y trying
CSS Preprocessors: LESS is more or look SASS-y trying
 
Css frameworks
Css frameworksCss frameworks
Css frameworks
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
設計與程式的溝通之道
設計與程式的溝通之道設計與程式的溝通之道
設計與程式的溝通之道
 
Less css
Less cssLess css
Less css
 
Sass compass
Sass compassSass compass
Sass compass
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
Why less?
Why less?Why less?
Why less?
 
CSS Extenders
CSS ExtendersCSS Extenders
CSS Extenders
 
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive NewsMobile-first OOCSS, Sass & Compass at BBC Responsive News
Mobile-first OOCSS, Sass & Compass at BBC Responsive News
 
The Basics of CSS3
The Basics of CSS3The Basics of CSS3
The Basics of CSS3
 
CSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and ConsCSS Less framework overview, Pros and Cons
CSS Less framework overview, Pros and Cons
 
Web Design Redux
Web Design ReduxWeb Design Redux
Web Design Redux
 
SVG introduction
SVG   introductionSVG   introduction
SVG introduction
 
Css3
Css3Css3
Css3
 
Doing more with LESS
Doing more with LESSDoing more with LESS
Doing more with LESS
 
Css3
Css3Css3
Css3
 
Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?Web Design Trends 2010 - What Is CSS3 All About?
Web Design Trends 2010 - What Is CSS3 All About?
 
Software programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS filesSoftware programming tools for creating/managing CSS files
Software programming tools for creating/managing CSS files
 

Recently uploaded

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 WoodJuan lago vázquez
 
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 FresherRemote DBA Services
 
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 connectorsNanddeep Nachan
 
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 RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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 2024The Digital Insurer
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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 WorkerThousandEyes
 
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...Drew Madelung
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Recently uploaded (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 
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
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
+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...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

{LESS} Overview

  • 2. Jeff Stagg  Web developer since 2008  Focus on .Net / C# / Javascript / HTML  Defender of Web Standards
  • 3. What is LESS?  LESS compiles to CSS @red: #f00; @green: #0f0; @blue: #00f; @radius-size: 10px; .round-borders(@color) { -webkit-border-radius: @radius-size; -moz-border-radius: @radius-size; border-radius: @radius-size; border: 5px solid @color; } .rounded { &.red { .round-borders(@red); } &.green { .round-borders(@green); } &.blue { .round-borders(@blue); } } section>div { display: inline-block; width: 100px; padding: 5px; margin-left: 20px; } .rounded.red { -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; border: 5px solid #ff0000; } .rounded.green { -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; border: 5px solid #00ff00; } .rounded.blue { -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; border: 5px solid #0000ff; } section>div { display: inline-block; width: 100px; padding: 5px; margin-left: 20px; }
  • 4. Why LESS?  CSS sucks  LESS lets us make CSS components  DRY pattern
  • 6. Variables  LESS lets us use variables in our code  Assign variables by using ‘@variable: value’  http://codepen.io/jeffstagg/pen/EaqeqZ?editors=110
  • 7. String Variables  We can store strings as values in variables  Useful for image URLs  @imageBaseUrl: ‘/Images/min/’  http://codepen.io/jeffstagg/pen/zxgmow?editors=110
  • 8. Variable Scope  Variables have scope local to their current function  http://codepen.io/jeffstagg/pen/ZYgqQO?editors=110  http://codepen.io/jeffstagg/pen/emqPvg?editors=110
  • 10. Nesting Functions  Organize your CSS  Makes your code modular  http://codepen.io/jeffstagg/pen/jEgvvo?editors=110
  • 12. What are Mixins?  Functions reusable throughout your styles  Follows DRY principals
  • 13. Importing Mixins  Mixins can be imported from files in your project  @import ‘mixins’;  https://gist.github.com/jeffstagg/cc6b9ca896a6bd34923d
  • 14. Functions Support Arguments  Arguments / Parameters can be passed into functions  .function(@parameter) { color: @parameter; }  http://codepen.io/jeffstagg/pen/bNXxLm?editors=110
  • 16. Namespaces  Mixins and Functions can be defined in Namespaces  #namespace { .function(@color) { color: @color; } }  http://codepen.io/jeffstagg/pen/qEeQbg?editors=110
  • 18. Compiling LESS  Client-Side (Javascript)  Server-Side (Gulp/Grunt, Web Essentials, DotLESS, Koala)
  • 19. Less.js  LESS can be compiled client-side by using less.js  https://gist.github.com/jeffstagg/2d4a87ee3d9d2c1559e2
  • 20. Gulp  NodeJS task runners like Grunt or Gulp can compile LESS server-side  https://gist.github.com/jeffstagg/2585aee8899b75ed4eb4
  • 21. Web Essentials for Visual Studio  Web Essentials extension can compile LESS in real-time  https://visualstudiogallery.msdn.microsoft.com/56633663-6799-41d7- 9df7-0f2a504ca361