Compass 1.0 没有使用 Flexbox 的所有前缀 [英] Compass 1.0 doesn't use all prefixes for Flexbox

查看:31
本文介绍了Compass 1.0 没有使用 Flexbox 的所有前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Compass 1.0,当我使用 @include display-flex; 或任何其他与 flex 相关的属性时,我只得到

I use Compass 1.0 and when I do @include display-flex; or any other flex related property I get only

display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
flex-flow: row wrap;

等等.没有 -moz-o 前缀.知道为什么吗?

etc. No -moz or -o prefixes. Any idea why?

推荐答案

Opera 从不为 Flexbox 使用 -o- 前缀.它是在没有前缀的 Presto 引擎下引入的.直到后来,对 Flexbox 属性(以及其他一些属性)的支持才开始支持 -webkit- 前缀.

Opera has never used the -o- prefix for Flexbox. It was introduced under the Presto engine without prefixes. It wasn't until later that support for Flexbox properties (along with a few others) that the -webkit- prefix was also supported.

当前出现在 1.0 alphas 中的 Flexbox 模块发出当前 Flexbox 规范的属性.因此,您也不会看到 -moz- 前缀:Mozilla 引擎仅使用原始 Flexbox 规范的前缀(例如 display: -moz-box>).Mozilla 从 22.0 开始支持没有前缀的当前规范(尽管直到 28.0 才支持 flex-wrap).您也不会看到 -ms- 前缀,因为使用前缀的 IE 版本支持较早的 2012 年 3 月草案(例如 display: -ms-flexbox).

The Flexbox module that currently appears in the 1.0 alphas only emits the properties for the current Flexbox specification. Because of this, you won't be seeing the -moz- prefix either: the Mozilla engine only uses prefixes for the original Flexbox specification (eg. display: -moz-box). Mozilla supports the current specification without prefixes from 22.0 onwards (though support for flex-wrap didn't exist until 28.0). You also won't see the -ms-prefix because the IE versions that use prefixes support the older March 2012 draft (eg. display: -ms-flexbox).

现在,如果您对一组兼容 Compass 且涵盖您所有基础的 mixin 感兴趣,我已经写了一些:

Now, if you are interested in a set of mixins that are compatible with Compass that will cover all of your bases, I have written a few:

  • Compatible with Compass 1.0 (slightly older version that shows usage)
  • Compatible with Compass 0.12 (try it out on CodePen)

这篇关于Compass 1.0 没有使用 Flexbox 的所有前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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