貌似挺实用。
https://raw.github.com/cloudhead/less.js/master/dist/less-1.3.3.min.js 下载js
style.less
@c: red;
#header {
color: @c;
}
h2 {
color: @c;
}
demo.html
<link rel="stylesheet/less" href="style.less">
<script src="less.js" type="text/javascript"></script>
</head>
<body>
<div id="header">test</div>
</body>
跟less 类似的还有 sass