0

I am relatively new to programming and markup languages.

Is there a way to add classes in less from an external css file?

/* this is in a single less file */
.foo {
     color: blue;
}

    h1 {
        .foo;   /* works just fine and turns my h1 html tag blue*/
    }


    /* now if want to add (for examlpe) a bootstrap class in my less file like so*/

    @import "bootstrap.css"; /*it is in the same folder as my less file */

    h1 {
       .text-danger; /*throws an error */
    }

This should make my h1 tag red, as I imported the bootstrap.css file. Now I tried this with creating my own css file and import that to my less file and do the same thing but it doesn't work either.

What am i doing wrong?

Adam8899
  • 231
  • 1
  • 2
  • 7
  • See [http://lesscss.org/features/#import-atrules-feature-import-options](http://lesscss.org/features/#import-atrules-feature-import-options). – seven-phases-max Mar 26 '19 at 18:06
  • 1
    Duplicate of [import .css file into .less file](https://stackoverflow.com/questions/11196915/import-css-file-into-less-file) – seven-phases-max Mar 26 '19 at 18:07

0 Answers0