简体   繁体   English

在Visual Studio 2015中较少

[英]LESS in Visual Studio 2015

I have downloaded and imported the font-awesome in my MVC project. 我已经在我的MVC项目中下载并导入了真棒字体 I am using the .less files for styling. 我正在使用.less文件进行样式设置。

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. 我没有在其他较少的文件中导入任何文件,但似乎font-awesome具有大量导入。 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/ ) 就我而言,问题是我使用的是旧版本的无点编译器( 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. 我们使用的是Font Awesome的旧版本,升级后由于缺少该变量,它将不再编译为CSS。 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. 升级我们使用的dotless版本后,问题就消失了。

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. 即使您没有使用无点,也可能值得确定使用哪个.less编译器,以查看是否有较新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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