CSSTidy 破坏字体
CSSTidy breaking font-face
我在使用 CSSTidy 破坏我的字体声明时遇到一些问题,但不确定问题出在哪里。本来我是服务器端压缩的,也试过运行通过一个online utility来测试。它们都有相同的输出,只包含第一个声明。
我还应该指出原始 CSS(输入)工作正常,只是试图压缩它。
输入:
@font-face {
font-family: 'FuturaBT-Light';
src: url('26A674_0_0.eot');
src: url('26A674_0_0.eot?#iefix') format('embedded-opentype'),
url('26A674_0_0.woff') format('woff'),
url('26A674_0_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Book';
src: url('26A674_1_0.eot');
src: url('26A674_1_0.eot?#iefix') format('embedded-opentype'),
url('26A674_1_0.woff') format('woff'),
url('26A674_1_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Medium';
src: url('26A674_2_0.eot');
src: url('26A674_2_0.eot?#iefix') format('embedded-opentype'),
url('26A674_2_0.woff') format('woff'),
url('26A674_2_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Bold';
src: url('26A674_3_0.eot');
src: url('26A674_3_0.eot?#iefix') format('embedded-opentype'),
url('26A674_3_0.woff') format('woff'),
url('26A674_3_0.ttf') format('truetype');
}
输出:
@font-face
{
font-family:FuturaBT-Bold;
src:url(26A674_3_0.eot?#iefix) format(embedded-opentype), url(26A674_3_0.woff) format(woff), url(26A674_3_0.ttf) format(truetype);
}
看起来 CSSTidy 正在使用 CSS 级别 2.1 规范,其中不包括 src
属性。我建议使用另一种压缩工具,例如 clean-css node module, or for an online compression tool try https://csscompressor.net/
我在使用 CSSTidy 破坏我的字体声明时遇到一些问题,但不确定问题出在哪里。本来我是服务器端压缩的,也试过运行通过一个online utility来测试。它们都有相同的输出,只包含第一个声明。
我还应该指出原始 CSS(输入)工作正常,只是试图压缩它。
输入:
@font-face {
font-family: 'FuturaBT-Light';
src: url('26A674_0_0.eot');
src: url('26A674_0_0.eot?#iefix') format('embedded-opentype'),
url('26A674_0_0.woff') format('woff'),
url('26A674_0_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Book';
src: url('26A674_1_0.eot');
src: url('26A674_1_0.eot?#iefix') format('embedded-opentype'),
url('26A674_1_0.woff') format('woff'),
url('26A674_1_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Medium';
src: url('26A674_2_0.eot');
src: url('26A674_2_0.eot?#iefix') format('embedded-opentype'),
url('26A674_2_0.woff') format('woff'),
url('26A674_2_0.ttf') format('truetype');
}
@font-face {
font-family: 'FuturaBT-Bold';
src: url('26A674_3_0.eot');
src: url('26A674_3_0.eot?#iefix') format('embedded-opentype'),
url('26A674_3_0.woff') format('woff'),
url('26A674_3_0.ttf') format('truetype');
}
输出:
@font-face
{
font-family:FuturaBT-Bold;
src:url(26A674_3_0.eot?#iefix) format(embedded-opentype), url(26A674_3_0.woff) format(woff), url(26A674_3_0.ttf) format(truetype);
}
看起来 CSSTidy 正在使用 CSS 级别 2.1 规范,其中不包括 src
属性。我建议使用另一种压缩工具,例如 clean-css node module, or for an online compression tool try https://csscompressor.net/