有没有一个版本的YUI Compressor正确处理媒体查询? [英] Is there a version of YUI Compressor that deals correctly with media queries?
问题描述
YUI Compressor有一个已知的错误,其中一些媒体查询,包括那些用于向iOS和Android设备提供样式(例如 @media screen和(max-device-width:480px){... }
)在压缩时被破坏,因为和
和开始大括号之间的空格被删除。
YUI Compressor has a known bug where some media queries, including those used to serve styles to iOS and Android devices (e.g. @media screen and (max-device-width: 480px) {...}
), are broken when compressed, because the space between the and
and the opening brace is removed.
- http://yuilibrary.com/projects/yuicompressor/ticket/2527991
可从首页(2.4.2)下载的最新版本仍有此问题。
The latest version available for download from the homepage (2.4.2) still has this issue.
- http://yuilibrary.com/downloads/#yuicompressor
此问题是否有更新版本?
Is there an updated version available where this issue is fixed?
推荐答案
是的 - 这个问题已修复在2.4.4,可以从YUI Compressor的git项目下载:
Yes — this issue is fixed in 2.4.4, which is downloadable from YUI Compressor’s git project:
- https://github.com/yui/yuicompressor/archives/yuicompressor-33
此版本似乎有效,至少在Mac OS X 10.6.4上。
This version seems to work, at least on Mac OS X 10.6.4.
说明:
- 从上述页面下载压缩的来源,然后解压缩。
- 在终端中,切换到解压缩的源文件夹。
- 键入
ant
这将创建一个名为build
的文件夹,并将构建的jar文件放入其中。生成的jar文件名为yuicompressor-2.4.5pre.jar
- 切换到构建文件夹,并运行
- 可选地,将jar文件移动到
usr / local / bin //
- 可选地,将jar文件移动到
- 也可以在
.profile
文件中创建别名更容易运行,例如alias yuic =java -jar /usr/local/bin/yuicompressor-2.4.5pre.jar
- Download the zipped source from the page above, and unzip it.
- In the Terminal, change into the unzipped source folder.
- Type
ant
and hit return. This will create a folder calledbuild
, and put the built jar file in it. The built jar file is calledyuicompressor-2.4.5pre.jar
- Change into the build folder, and run
chmod +x yuicompressor-2.4.5pre.jar
to make the jar file executable. - Optionally, move the jar file into
/usr/local/bin/
- Optionally, create an alias in your
.profile
file to make it easier to run, e.g.alias yuic="java -jar /usr/local/bin/yuicompressor-2.4.5pre.jar"
这篇关于有没有一个版本的YUI Compressor正确处理媒体查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!