Identifying patterns in your CSS

Identifying patterns in your CSS is all about asking yourself one question: how can I reduce code?

There are a number of ways of doing this; the exact process will depend on the nature of the site being converted. There are some general questions that you can ask yourself though, to help with the conversion process:

  • Does your site use any CSS3 styles? If it does, consider using a prebuilt Less library, which we can import in our Less style sheet.
  • Does your CSS code contain any statements, such as links to image elements? If it does, you might want to consider using string variables and interpolation to better manage the links, particularly if they need to be updated in the future.
  • How many variables does your site ...

Get Learning Less.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.