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

Building a library of mixins


As part of identifying patterns in our CSS, where we can identify code that can be turned into mixins, we might find that using a prebuilt library, such as LESS Elements or LESS Hat, doesn't always meet our requirements.

This is not necessarily an issue; it may be that the author of the library hasn't created the mixin the way we want it, as he was trying to satisfy another requirement. If existing mixins aren't available, we can always consider creating our own library of mixins as partials that can be included in future projects. We could even consider hosting mixins on GitHub (http://www.github.com), as has been done by others:

Tip

There are several popular code-sharing platforms available, which you can try—two good examples are Google Code (https://code.google.com/) and Bitbucket (https://bitbucket.org/).

The trick in creating mixins for libraries here is to stay several steps ahead of yourself and work out how you can convert similar blocks of code so that...