<html> <head> <title>Less Operations</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <h1>Example using Operations</h1> <p class="myclass">LESS enables customizable, manageable and reusable style sheet for web site.</p> </body> </html>
接下創(chuàng)建一個(gè)文件 style.less.
@fontSize: 10px; .myclass { font-size: @fontSize * 2; color:green; }
lessc style.less style.css
.myclass { font-size: 20px; color: green; }