我无法使用@import。我有一个style.less文件看起来像这样至今:LESS导入不起作用
/*
* Screen-Cuts.Com Styles
*
*/
/* Mixins
======================================== */
@import "grid.less";
/* Main Page Styles
======================================== */
body {
}
header {
h1 {
font-family: 'Exo', san-serif;
margin: 0 auto;
font-size: 2.25em
}
nav[role="navigation"] {
font-family: 'Lato', sans-serif;
font-size: 1.25em;
ul {
list-style: none;
li {
float: left;
}
}
}
}
当我编译更少的代码,但是,@import似乎没有工作,我没有得到任何编译错误。下面是输出:
/*
* Screen-Cuts.Com Styles
*
*/
/* Variables
======================================== */
/* Mixins
======================================== */
/* Main Page Styles
======================================== */
header h1 {
font-family: 'Exo', san-serif;
margin: 0 auto;
font-size: 2.25em;
}
header nav[role="navigation"] {
font-family: 'Lato', sans-serif;
font-size: 1.25em;
}
header nav[role="navigation"] ul {
list-style: none;
}
header nav[role="navigation"] ul li {
float: left;
}
而且,当我尝试使用grid.less定义的混入,我得到一个编译时错误说,混入没有定义。有人可以帮我从这里出去吗?我敢肯定,我正在犯一个愚蠢的错误,但我已经环顾四周,一直无法找到线索。
@ Ethan - 你应该注意你的解决方案作为答案,然后“接受”它。 – ScottS 2012-07-26 14:15:17
@ ScottS - 会做。谢谢! – fraxture 2012-07-28 00:08:24
@ Ethan - 呃,你做到了一半。你把你的解决方案作为答案,但你没有点击左边的复选标记来“接受”它。 – ScottS 2012-07-28 10:56:31