CSS框架自动处理供应商前缀? [英] CSS Framework that automatically handles vendor prefixes?

查看:83
本文介绍了CSS框架自动处理供应商前缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过Blueprint,Less和SCSS,他们都没有做我想要的。我发现这很难相信,因为处理供应商前缀是编写CSS最令人沮丧的部分,所以它似乎是第一个问题任何人写的CSS框架应该解决。

I've looked at Blueprint, Less, and SCSS and none of them appear to do what I want. I find this difficult to believe because handling vendor prefixes is the most frustrating part of writing CSS, so it would appear to be to be the first problem anyone who writes a CSS framework ought to address.

我想知道,是否有一个框架(或rails gem),我可以使用,它允许我写 border-radius:5px 我假设它将创建一个具有所有正确的供应商前缀的规则?

I want to know, is there a framework (or rails gem) that I can use, that allows me to write border-radius:5px and then let's me assume that it will create a rule with all the proper vendor prefixes?

感谢

推荐答案

LESS Mixin - 基本上你写一次,从那里,你应用它与一条线。像这样:

You can actually do this quite easily with a LESS Mixin - basically you write it once and from there on out you apply it with one line. Like this:

// Border Radius
.border-radius(@radius: 5px) {
  -webkit-border-radius: @radius;
     -moz-border-radius: @radius;
          border-radius: @radius;
}

然后你可以这样做,一个需要一个边界半径: / p>

Then you symply do this one-liner where you need a border radius:

.classname {
  .border-radius(5px);
}

如果您还没有准备好LESS, Prefixr - 它会为您生成浏览器前缀(然后您必须将代码粘贴回您的文件中)。

If you are not ready for LESS, then you could just process your code through Prefixr - it generates the browser prefixes for you (then you have to copy paste the code back into your file).

这篇关于CSS框架自动处理供应商前缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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