在我的 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 {`