【发布时间】:2013-11-01 12:53:16
【问题描述】:
在我的 Less 文件中,我包含了一些我想在 Less 中用于媒体查询的变量:
@mobile: ~"only screen and (max-width: 529px)";
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)";
@desktop: ~"only screen and (min-width: 950px) and (max-width: 1128px)";
@desktop-xl: ~"only screen and (min-width: 1129px)";
在我的 css 中,我会做这样的事情,例如:
@media @desktop{
.test{
font-size: 12px;
}
}
当我尝试使用预处理器对其进行解析时,它会编译,但是当我使用 LessPHP 进行解析时,会出现以下错误:
PHP Fatal error: Uncaught exception 'Exception' with message 'parse error: failed at `@media @desktop {`
【问题讨论】:
-
我在 LessPHP 0.4.0 中在线试用了它,它编译得很好。见这里:goo.gl/swv8rp
标签: css responsive-design less media-queries lessphp