Upgrade to Pro — share decks privately, control downloads, hide ads and more …

An Introduction to LESS CSS

An Introduction to LESS CSS

A presentation by Mannie Schumpert (@mannieschumpert) on LESS CSS and how it can improve a designer or developer's workflow. Presented at the Charleston WordPress User Group (@wpchs)

More Decks by WordPress Charleston User Group

Other Decks in Design

Transcript

  1. Decrease how much CSS you have to write using: •

    Variables • Mixins • Functions and Operations Increase readability and organization of CSS using: • Imports • Nested Rules • Comments BENEFITS OF USING LESS
  2. The language • completely compatible with CSS WORKING WITH LESS

    LESS on a live site • client-side with less.js • server-side with node.js Local development with LESS • with the command-line • with CodeKit - for Mac • with SimpLESS - PC or Mac
  3. USING LESS TO INCREASE ORGANIZATION AND READABILITY • Imports style.less:

    @import ‘reset.less’; @import ‘main.less’; @import ‘forms.less’; @import ‘comments.less;’ @import ‘queries.less’; style.css
  4. USING LESS TO DECREASE HOW MUCH CODE YOU WRITE 1.Variables

    a.Set site-wide options like color • Ex. @primary, @accent, @bg 2.Mixins a.Insert classes into other selectors b.Easily re-use common style declarations • Ex. .dashed, .sans, .rounded 3.Parametric Mixins a.Death to vendor prefixes!! 4.Functions and Operations a.Color functions
  5. USING LESS TO DECREASE HOW MUCH CODE YOU WRITE 1.Variables

    a.Set site-wide options like color • Ex. @primary, @accent, @bg 2.Mixins a.Insert classes into other selectors b.Easily re-use common style declarations • Ex. .dashed, .sans, .rounded 3.Parametric Mixins a.Death to vendor prefixes!! 4.Functions and Operations a.Color functions
  6. OTHER FEATURES • Pattern matching and guard expressions • String

    interpolation • Escaping • JavaScript evaluation (which I haven’t used yet and hurt my brain just thinking about)