Less - Variables
by jgalanlo
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/1.6.3/less.min.js"></script>
<div class="box-1">Caja de prueba</div>
CSS
@primary-color: #369;
body {
background: @primary-color;
padding: 30px;
}
JavaScript
/*
jsFiddle does not directly support Less so we need these bits of code to bring it here.
Twitter: @aaronlayton
Modified by meri
Updated by max
*/
// Step 1: Select the style element and change it to text/less
$('head style[type="text/css"]').attr('type','text/less');
// Step 2: Set development mode to see errors
less.env = 'development';
// Step 3: Tell Less to refresh the styles
less.refreshStyles();