我应该包括“无前缀"吗?我网站上的插件 [英] Should I include "prefix-free" plugin in my website

查看:31
本文介绍了我应该包括“无前缀"吗?我网站上的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无前缀 是 Lea Verou 的一个很酷的插件.它帮助开发人员编写没有前缀的 CSS3 选择器.我想知道是否值得将它包含在我的网站中.

Prefix-free is a cool plugin by Lea Verou. It helps the developer to write CSS3 selectors with no prefix. I wonder if it is worthy to include it in my site.

我有一个使用 CSS3 的网站,我想知道加载一个在页面加载后更改 CSS 的 JS 文件是否会降低页面的渲染速度并影响客户端性能?

I have a website with some CSS3 and I want to know if loading a JS file that changes the CSS after page loads may decrease my pages' render speed and affect the client side performance?

推荐答案

当然,执行 Javascript 改变您的 CSS 会降低您网站的性能,无论是在 javascript 执行时间还是(重新)渲染方面 -您网站的速度.

Of course will the execution of a Javascript altering you CSS decrease the performance of your Site, both in terms of javascript-execution time and (re-)rendering-speed of you site.

让 javascript 检查和更改所有 CSS 的成本非常高.我更喜欢像 SASSLESS 允许您编写无前缀的 CSS 并在将其交付给客户端之前生成相应的带前缀的 CSS.当然,这有需要传输更大 css 文件的缺点,但这仍然是我更喜欢的解决方案.

It is very costly to let javascript examine and alter all your CSS. I prefer such preprocessors like SASS or LESS which let you write prefix-free CSS and produce the according prefixed CSS before delivering it to the client. Of course this has the drawback of having bigger css-files to transfer, but still this is the solution I prefer.

您不需要为自己编写必要的 mixin,基本上有无数的扩展,它们将为您完成工作并提供现成的 mixin.

You don't need to write the necessary mixins for yourself, there are basically countless extensions, that will do the work for you and provide ready-to-use mixins.

就在我的脑海里:为了更少,可以使用 http://lessprefixer.com/ - 对于 Sass http://compass-style.org/

Just out of the top of my head: for less, one could use http://lessprefixer.com/ - for Sass http://compass-style.org/

这篇关于我应该包括“无前缀"吗?我网站上的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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