Less, reference not working

僤鯓⒐⒋嵵緔 提交于 2019-12-11 17:26:08

问题


My understanding of reference is that it should only include the bits of the imported file it needs. Here it seems to be bringing in other parts?

Main file

.FadedGrid
{
    @import (reference)  './kendo.less';

    .k-grid-header th
    {
        background-color: @input-background-color;
    }
}

kendo.less file

@input-background-color: #000;

/* Nothing from here is used*/
@import "theme.less";

theme.less file

.UnrelatedRule
{
    background-color: #000;
}

output

.FadedGrid .UnrelatedRule {
  background-color: #000;
}
.FadedGrid .k-grid-header th {
  background-color: #000000;
}

Why is UnrelatedRule in there? NB It doesn't make a difference if I change it to

@import (reference) "theme.less";

来源:https://stackoverflow.com/questions/29429159/less-reference-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!