You are previewing Instant LESS CSS Preprocessor How-to.
O'Reilly logo
Instant LESS CSS Preprocessor How-to

Book Description

Practical, handson recipes to write more efficient CSS, with the help of the LESS CSS Preprocessor library

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results.

  • Use mixins, functions, and variables to dynamically auto-generate styles, based on minimal existing values

  • Use the power of LESS to produce style sheets dynamically, or incorporate precompiled versions into your code

  • Learn how to use existing mixin libraries, or to create your own that you can reuse in future projects

In Detail

CSS styling has been a key part of developing for the Internet since the early 1990s, but unlike JavaScript, has suffered from the inability to produce dynamic styles using functions, operators, and variables. LESS brings the power of all three and more to your CSS, allowing you to engage a more efficient, modular style of working, and making it easier to maintain your CSS styling in your projects.

Instant LESS CSS Preprocessor How-To is a practical, hands-on guide that provides you with a number of clear step-by-step exercises to help you take advantage of the power of LESS, and give you a good grounding in writing and compiling CSS style sheets using the LESS Preprocessor language.

This book looks at how you can incorporate LESS into your web pages, and either produce style sheets dynamically, or pre-compile them before including the final article into your site’s pages.

You will also learn how you can use the power of mixins, functions, and variables to help produce style sheets, and reduce the amount of code you need to write in your style sheets. We will also take a look at how you can incorporate a more modular style to your development workflow, which will help with making style sheets more manageable and easier to update in the future. We will also take a look at how you can build up libraries of reusable code that you can incorporate into your future projects.

You will learn everything you need to know to start using LESS to help produce more efficient style sheets in your site’s pages, and adopt a more modular development workflow, which will make it easier to maintain your sites in the future.

Table of Contents

  1. Instant LESS CSS Preprocessor How-to
    1. Instant LESS CSS Preprocessor How-to
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
    6. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    7. 1. Instant LESS CSS Preprocessor How-to
      1. Installing LESS (Must know)
        1. How to do it...
        2. How it works...
        3. There's more...
      2. Precompiling LESS client side (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
          1. SimpLESS
          2. LESS Parser
          3. Crunch!
          4. Other alternatives
      3. Precompiling LESS server side (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      4. Compiling back to LESS from CSS (Should know)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      5. Autorefreshing styles using watchr (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      6. Using LESS variables (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      7. Using mixins in LESS (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
      8. Parametric mixins in LESS (Must know)
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more...
          1. Default values and multiple parameters
          2. Using all arguments at once
          3. Parametric mixins without parameters
      9. Pattern-matching in LESS (Must know)
        1. Getting ready
        2. How to do it…
        3. How it works...
        4. There's more…
      10. Using JavaScript evaluation in LESS (Should know)
        1. Getting ready
        2. How to do it…
        3. How it works…
      11. Importing files and escaping code in LESS (Must know)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
      12. Using JavaScript operators in LESS (Should know)
        1. How to do it…
        2. How it works…
      13. Creating colors with operators in LESS (Should know)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
      14. Creating colors with functions (Should know)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
      15. Grouping/nesting styles in LESS (Should know)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
      16. Scoping in LESS (Should know)
        1. Getting ready
        2. How to do it…
        3. How it works…
      17. Creating Polaroid effects using LESS (Become an expert)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
      18. Using LESS with other libraries (Become an expert)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
      19. Using pre-built mixin libraries (Become an expert)
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…