<html> <head> <title>Less Importing</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <h1>Example using Importing</h1> <p class="myclass">LESS enables customizable, manageable and reusable style sheet for web site.</p> <p class="myclass1">It allows reusing CSS code and writing LESS code with same semantics.</p> <p class="myclass2">LESS supports creating cleaner, cross-browser friendly CSS faster and easier.</p> </body> </html>
.myclass{ color: #FF8000; } .myclass1{ color: #5882FA; }
@import "h/"; .myclass2 { color: #FF0000; }
這將從路徑 h/ 匯入 myfile.less 到 style.less 檔案
lessc style.less style.css
.myclass { color: #FF8000; } .myclass1 { color: #5882FA; } .myclass2 { color: #FF0000; }