SlideShare a Scribd company logo
1 of 14
.less – Best CSS way




An Introduction to less CSS framework

                 By

           Jaydev Gajera
WHAT is CSS?

   Are you joking?
We all know that Cascading Style Sheets (CSS) is a style sheet
 language used to describe the presentation semantics (that is,
 the look and formatting) of a document written in a markup
 language. i.e. HTML
Good CSS looks like this:
Good CSS looks like this:




               Redundant code
Multiple Classes

CSS looks good:              Markup not so much:
.Less can help here
What is less ?

   less is a dynamic stylesheet language.
   Less is available at lesscss.org
   It can be applied by
           Variables
           Mixins
           Nested Rules
           Functions & Operations
Variables
Variables allow you to specify widely used values in a single place, and then
re-use them throughout the style sheet, making global changes as easy as
changing one line of code.
Mixins
Mixins allow you to embed all the properties of a class into another class by
simply including the class name as one of its properties. It’s just like variables, but
for whole classes. Mixins can also behave like functions, and take arguments, as
seen in the example below.
Nested Rules
Rather than constructing long selector names to specify inheritance, in Less you can
simply nest selectors inside other selectors. This makes inheritance clear and style
sheets shorter.
Functions & Operations
Operations let you add, subtract, divide and multiply property values and colors,
giving you the power to create complex relationships between properties.
Operations should only be performed within parentheses in order to ensure
compatibility with CSS.
Client-side usage
   Link your .less stylesheets with the rel set to “stylesheet/less”


<link rel="stylesheet/less" type="text/css" href="styles.less">


   Then download less.js from the top of the page, and include it in the
    <head> element of your page, like so:


<script src="less.js" type="text/javascript"></script>


   Make sure you include your stylesheets before the script.
Question : How to use with with windows?
Answer : Use Winless. Available at winless.org

Winless
   WinLess is a Windows GUI LESS compiler. WinLess is a must-have for the
    webdeveloper who uses Windows

Usage
   When you add a folder to WinLess (either via 'Add folder' or by dropping it
    on the folder pane), WinLess will start watching the LESS files in it.
   WinLess will automatically recompile a less file when it is changed.
   If you have a folder called 'less' and a folder called 'css' on the same level,
    add the parent folder. WinLess will then automatically use the css folder as
    output folder.
Thank you
Have a best .less !

More Related Content

What's hot

Introduction to Web Development - CSS
Introduction to Web Development - CSSIntroduction to Web Development - CSS
Introduction to Web Development - CSSSadhanaParameswaran
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorKelly Kellum
 
Web Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic CssWeb Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic CssAl-Mamun Sarkar
 
CSS Preprocessors
CSS PreprocessorsCSS Preprocessors
CSS PreprocessorsAlex Meijer
 

What's hot (7)

Introduction to Web Development - CSS
Introduction to Web Development - CSSIntroduction to Web Development - CSS
Introduction to Web Development - CSS
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and Color
 
Phases of matter
Phases of matterPhases of matter
Phases of matter
 
Web Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic CssWeb Design Course - Lecture 7 - Basic Css
Web Design Course - Lecture 7 - Basic Css
 
CSS Preprocessors
CSS PreprocessorsCSS Preprocessors
CSS Preprocessors
 
CSS
CSSCSS
CSS
 
An Introduction to CSS
An Introduction to CSSAn Introduction to CSS
An Introduction to CSS
 

Viewers also liked

Viewers also liked (7)

Football Alvaro Cardona
Football Alvaro CardonaFootball Alvaro Cardona
Football Alvaro Cardona
 
Los juguetes de oliver
Los juguetes de oliverLos juguetes de oliver
Los juguetes de oliver
 
Football
FootballFootball
Football
 
Field lab assignment part ii
Field lab assignment part iiField lab assignment part ii
Field lab assignment part ii
 
Autism
Autism Autism
Autism
 
Nk company profile
Nk company profileNk company profile
Nk company profile
 
NUI_jaydev
NUI_jaydevNUI_jaydev
NUI_jaydev
 

Similar to Less - an Introduction

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)Folio3 Software
 
LESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionLESS(CSS Pre Processor) introduction
LESS(CSS Pre Processor) introductionrushi7567
 
Less(CSS Pre Processor) Introduction
Less(CSS Pre Processor) IntroductionLess(CSS Pre Processor) Introduction
Less(CSS Pre Processor) Introductionrushi7567
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Binu Paul
 
CSS Training in Bangalore
CSS Training in BangaloreCSS Training in Bangalore
CSS Training in Bangalorerajkamal560066
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqDignitasDigital1
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdfwubiederebe1
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsQA TrainingHub
 
Customizing the look and-feel of DSpace
Customizing the look and-feel of DSpaceCustomizing the look and-feel of DSpace
Customizing the look and-feel of DSpaceBharat Chaudhari
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetNeha Sharma
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LAJake Johnson
 

Similar to Less - an Introduction (20)

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)
 
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
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3Cordova training - Day 2 Introduction to CSS 3
Cordova training - Day 2 Introduction to CSS 3
 
CSS Training in Bangalore
CSS Training in BangaloreCSS Training in Bangalore
CSS Training in Bangalore
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
Css - Tutorial
Css - TutorialCss - Tutorial
Css - Tutorial
 
Sass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by ShafeeqSass:-Syntactically Awesome Stylesheet by Shafeeq
Sass:-Syntactically Awesome Stylesheet by Shafeeq
 
Sass
SassSass
Sass
 
Css siva
Css sivaCss siva
Css siva
 
Css siva
Css sivaCss siva
Css siva
 
Chapter 3 - CSS.pdf
Chapter 3 - CSS.pdfChapter 3 - CSS.pdf
Chapter 3 - CSS.pdf
 
Advanced sass
Advanced sassAdvanced sass
Advanced sass
 
Css training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentialsCss training tutorial css3 &amp; css4 essentials
Css training tutorial css3 &amp; css4 essentials
 
Customizing the look and-feel of DSpace
Customizing the look and-feel of DSpaceCustomizing the look and-feel of DSpace
Customizing the look and-feel of DSpace
 
Less
LessLess
Less
 
Css Systems
Css SystemsCss Systems
Css Systems
 
SASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome StylesheetSASS - Syntactically Awesome Stylesheet
SASS - Syntactically Awesome Stylesheet
 
Sass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LASass Essentials at Mobile Camp LA
Sass Essentials at Mobile Camp LA
 

Less - an Introduction

  • 1. .less – Best CSS way An Introduction to less CSS framework By Jaydev Gajera
  • 2. WHAT is CSS?  Are you joking? We all know that Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics (that is, the look and formatting) of a document written in a markup language. i.e. HTML
  • 3. Good CSS looks like this:
  • 4. Good CSS looks like this: Redundant code
  • 5. Multiple Classes CSS looks good: Markup not so much:
  • 7. What is less ?  less is a dynamic stylesheet language.  Less is available at lesscss.org  It can be applied by Variables Mixins Nested Rules Functions & Operations
  • 8. Variables Variables allow you to specify widely used values in a single place, and then re-use them throughout the style sheet, making global changes as easy as changing one line of code.
  • 9. Mixins Mixins allow you to embed all the properties of a class into another class by simply including the class name as one of its properties. It’s just like variables, but for whole classes. Mixins can also behave like functions, and take arguments, as seen in the example below.
  • 10. Nested Rules Rather than constructing long selector names to specify inheritance, in Less you can simply nest selectors inside other selectors. This makes inheritance clear and style sheets shorter.
  • 11. Functions & Operations Operations let you add, subtract, divide and multiply property values and colors, giving you the power to create complex relationships between properties. Operations should only be performed within parentheses in order to ensure compatibility with CSS.
  • 12. Client-side usage  Link your .less stylesheets with the rel set to “stylesheet/less” <link rel="stylesheet/less" type="text/css" href="styles.less">  Then download less.js from the top of the page, and include it in the <head> element of your page, like so: <script src="less.js" type="text/javascript"></script>  Make sure you include your stylesheets before the script.
  • 13. Question : How to use with with windows? Answer : Use Winless. Available at winless.org Winless  WinLess is a Windows GUI LESS compiler. WinLess is a must-have for the webdeveloper who uses Windows Usage  When you add a folder to WinLess (either via 'Add folder' or by dropping it on the folder pane), WinLess will start watching the LESS files in it.  WinLess will automatically recompile a less file when it is changed.  If you have a folder called 'less' and a folder called 'css' on the same level, add the parent folder. WinLess will then automatically use the css folder as output folder.
  • 14. Thank you Have a best .less !