使用CSS3计算的主动编译 [英] Less Aggressive Compilation with CSS3 calc

查看:118
本文介绍了使用CSS3计算的主动编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Less编译器( OrangeBits dotless 1.3.0.5 )积极地翻译

The Less compilers that I'm using (OrangeBits and dotless 1.3.0.5) are aggressively translating

body { width: calc(100% - 250px - 1.5em); }

into

body { width: calc(-151.5%); }

这显然是不希望的。我想知道是否有一种方法来通知Less编译器在编译期间基本上忽略该属性。我已经搜索了Less文档和两个编译器的文档,我找不到任何东西。

Which is obviously not desired. I'm wondering if there is a way to signal to the Less compiler to essentially ignore the attribute during compilation. I've searched through the Less documentation and both compilers' documentation and I could not find anything.

少或少编译器支持这个?

Does Less or a Less compiler support this?

如果没有,是否有一个CSS扩展程序?

If not, is there a CSS extender that does?

推荐答案

/ p>

do this..

body { width: calc(~"100% - 250px - 1.5em"); }

在less.js 1.4.0中,我们将有一个strictMaths选项,在括号内,因此calc将工作开箱即用。这是一个选项,因为它是一个重大的突变。默认情况下,1.4.0的早期beta版本已启用此选项。发布版本默认为关闭。

In less.js 1.4.0 we will have a strictMaths option which requires all less calculations to be within brackets, so the calc will work "out-of-the-box". This is an option since it is a major breaking change. Early betas of 1.4.0 had this option on by default. The release version has it off by default.

这篇关于使用CSS3计算的主动编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆