Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with Less themes in WordPress


Now that we have support for Less in place, let's move on and take a look at the options available to use Less styles in our themes, either within our own creations, or as part of prebuilt themes available for sale or download via the Internet.

Converting themes to use Less

We now have the basis for a Less style sheet, to which we can start to add our converted styles. Hold on, I hear you ask, "If we're converting a theme such as TwentyFourteen, where on earth do we start?"

It's a very good question. Within excess of 4200 lines in the current style sheet for this theme, it's easy to feel bewildered! However, all will begin to come clear if we follow two simple principles:

  • Less allows us to break down our style sheet into multiple files, which are compiled into one by Less. Make use of this; it will be a big help, as smaller files make for easier conversion!

  • Don't try to convert all of it in one go; do it bit by bit. Less is a superset of CSS, which means...