如何将简写 CSS 转换为普通 CSS?
有没有什么工具可以自动将CSS简写转为普通CSS?我需要这个,因为我想使用 SmartSprites ,它不能很好地使用速记。
最好还有一个执行相反操作的工具,因此在精灵计算之后,我可以尽可能缩小CSS...
也欢迎任何其他自动精灵解决方案,基本上我正在寻找一些可以集成到的命令行工具构建过程,以便开发人员仍然可以在原始 CSS 代码上进行开发。
Is there any tool which can automatically convert shorthand css to longhand? I need this cause I want to use SmartSprites which does not work well with shorthand.
And prefably also a tool which does the reverse, so after the sprite computation i can minify the css as much as possible...
Also any other solutions for automatic spiriting is welcome, basically im looking for some command line tools which can be integrated into the build process so that the developers still develop on the raw css code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 Opera 上使用 Dragonfly。 Dragonfly 类似于 Firefox 和 Chrome 上的 Firebug,但由 Opera 开发。 Dragonfly 中有一个功能可以让你改变速记,反之亦然。检查 opera.com/dragonfly/documentation/
You can use Dragonfly on Opera. Dragonfly is like Firebug on Firefox and Chrome but developed by Opera. There is a function in Dragonfly which let you alter the shorthand and vica versa. Check opera.com/dragonfly/documentation/
相反,您可以使用 CSS 优化器,例如 csstidy。我怀疑它会将简写转换为非简写。
为什么不禁止开发人员使用简写并在构建过程中使用 csstidy 呢?
如果您不喜欢这个想法,您可以编写一个小脚本来进行速记转换,这比相反的方法要容易得多。它基本上归结为字符串替换。
For the reverse, you can use a CSS optimiser like csstidy. I doubt it will convert shorthands to non-shorthands though.
Why not forbid the use of shorthands by developers and use csstidy in the build process?
If you don't like that idea, you could write a small script to do the shorthand conversion, which is significantly easier than the other way around. It basically comes down to string replacement.