Arrays with Less

The answer to the question is “Yes, you can create and work with arrays in Less”. An array (in CSS and thus Less realm it’s usually referred to as “List”) is defined with just the same code as in your Q: @badge-colors: blue #7FB3D4, gray #767676, green #8CC079, red #b35d5d; See “List Functions” for functions … Read more

Font awesome not working in Firefox

Custom web fonts via CDN (or any cross-domain font request) doesn’t work in Firefox or Internet Explorer (correctly so, by spec) though they do work (incorrectly so) in Webkit-based browsers. You can fix this by adding headers to your page. Apache <FilesMatch “.(eot|ttf|otf|woff)”> Header set Access-Control-Allow-Origin “*” </FilesMatch> Nginx if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){ add_header Access-Control-Allow-Origin … Read more

Less and Bootstrap: how to use a span3 (or spanX [any number]) class as a mixin?

New Answer (requires LESS 1.4.0) What you actually desire is something known as extending in LESS and SASS terminology. For example, you want an HTML element (just an example)… <div class=”myclass”></div> …to fully behave as if it had a span3 class from bootstrap added to it, but without actually adding that class in the HTML. … Read more

Prefixing all selectors for twitter bootstrap in less

To avoid the problems mentioned in periklis’s answer: create your own prefixed-bootstrap.less that re-compiles the compiled bootstrap.css in : .bootstrap { @import (less) ‘dist/css/bootstrap.css’; @import (less) ‘dist/css/bootstrap-theme.css’; /* optional */ } No need for sed commands then. The observations mentioned in Lars Nielsen’s answer are of course still valid.

Dynamically changing less variables

Marvin, I wrote a function that does exactly what you’re looking for, last night. I have created a fork on Github; https://github.com/hbi99/less.js/commit/6508fe89a6210ae3cd8fffb8e998334644e7dcdc Take a look at it. Since this is a recent addition, I’d like to hear your comments on the addition. This solution fits my needs perfectly and I think it will do the … Read more