Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am using bootstrap template in my angularjs project which is served by Grunt. Everything else is working fine, but the Components of bootstrap template which are using LESS are not getting rendered on page when I use ui-router for routing.

How to do it while using ui-router?

share|improve this question
    
Please provide some code sample using less, jsbin etc. – Aditya Singh 22 hours ago
    
What type of code sample do you require? – Rushabh Soni 22 hours ago
    
when I am using template page in my index.html I am getting proper result. But when I am using <div ui-view=""></div> for routing purpose. It is not working. – Rushabh Soni 22 hours ago

You can use grunt-contrib-less package to integrate less integration using Grunt. An example configuration could be: 1. Add the package via npm

npm install --save-dev grunt-contrib-less
  1. Load the package in your gruntfile.js:

    grunt.loadNpmTasks('grunt-contrib-less');

  2. Add the config for less:

less: {
  development: {
    options: {
      paths: ['assets/css']
    },
    files: {
      'path/to/result.css': 'path/to/source.less'
    }
  }
}
share|improve this answer
    
What exactly will this do? Will this convert .less files into .css or something else? – Rushabh Soni 22 hours ago
    
Yes. It is use to compile less to css. For more reference check this: github.com/gruntjs/grunt-contrib-less – Aditya Singh 22 hours ago
    
My .less file is calling a opacity function opacity() which is defined in another file. How should I use this? – Rushabh Soni 21 hours ago
    
This solution didn't work for me. – Rushabh Soni 20 hours ago
    
I am getting output for normal html page. But when I am using ui-router CSS is not showing up. – Rushabh Soni 19 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.