如何将简写 CSS 转换为普通 CSS?

发布于 2024-09-13 09:45:30 字数 259 浏览 5 评论 0原文

有没有什么工具可以自动将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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半衬遮猫 2024-09-20 09:45:30

您可以在 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/

陪你搞怪i 2024-09-20 09:45:30

相反,您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文