简体   繁体   中英

LESS in Visual Studio 2015

I have downloaded and imported the font-awesome in my MVC project. I am using the .less files for styling.

I have a different less file for styles which runs fine but for some reason the font-awesome less file is not working, it gives the following error:

variable @fa-font-size-base is undefined on line 6 in file 'core.less':
  [5]:   display: inline-block;
  [6]:   font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
       -----------------------------^
  [7]:   font-size: inherit; // can't have font-size inherit on line above, so need to override

I am not importing any file in the other less files, but seems like font-awesome has a bunch of imports. Can anyone help?

I ran into a very similar error which brought me here.

In my case, the problem was that I was using an out-date version of the dotless compiler ( http://www.dotlesscss.org/ )

We had been using an older version of Font Awesome and after upgrading it would no longer compile to CSS due to that missing variable. The newest version (as of this posting) had corrected whatever was causing the compilation failure. After upgrading the version of dotless we used, the problem went away.

Even if you're not using dotless, might be worth determining which .less compiler you are using to see if a newer version is available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM