Mixins in Less can not only contain properties, but also selectors. This recipe will show you how to leverage selectors inside mixins.
For this recipe, you will have to create a coloredlinks.less
file and an index.html
file, which load the Less file and less.js
compiler with the following code in the head
section:
<link rel="stylesheet/less" type="text/css" href="coloredlinks.less"> <script src="less.js" type="text/javascript"></script>