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.

  1. create assets/styles/home.less file home specific styles. notice file can @import "importer.less" reuse default styles
  2. 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'                 }]         } }); 
  3. now should able use <link rel="stylesheet" href="/styles/homepage.css">


Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -