问题
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