Exploring mixins

When writing code, how many times have you written a similar code, but for different projects? Ever wondered if you could, with a little change in the writing style, convert to using prebuilt blocks of CSS that you can drop in a project at a moment's notice?

Sure, you could start to create your own library of code—this would work perfectly well. However, it suffers from at least one potential drawback: you will very likely have to manually modify any stored code to fit the needs of a new project. While this will work, you might find yourself expending more time updating code than if it had been written from scratch!

What if I said you could still maintain a code library, but you don't have to keep modifying each block of library ...

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.