node.js - Sails.js: Page specific .less files -
i have "page specific" .less file in project need reference in particular view. reason cannot add importer.less
i having hard time making work.
for example, adding <link rel="stylesheet" href="/styles/homepage.css">
directly homepage.ejs
, browser returns 404 not found since homepage.less
not being compiled , copied on .tmp
directory.
thanks lot looking this.
- create
assets/styles/home.less
file home specific styles. notice file can @import "importer.less" reuse default styles than add home.less less task in
tasks/config/less.js
follows:grunt.config.set('less', { dev: { files: [{ expand: true, cwd: 'assets/styles/', src: ['importer.less','home.less'], dest: '.tmp/public/styles/', ext: '.css' }] } });
now should able use
<link rel="stylesheet" href="/styles/homepage.css">
Comments
Post a Comment