cjmarkham / css-compiler
Silex 的 CSS 编译器
dev-master
2013-05-10 19:03 UTC
Requires
- silex/silex: ~1.0
This package is not auto-updated.
Last update: 2024-09-23 13:59:16 UTC
README
为 silex 编写的 css 编译器
注册
在 composer.json 中添加以下依赖项
"cjmarkham/css-compiler": "dev-master"
然后进行注册
$app->register(new CssCompiler\CompilerServiceProvider());
选项
compiler.shorten_hex- 缩短十六进制值。默认falsecompiler.short_values- 缩短值。例如,将margin:10px 0 10px 0缩短为margin:10px 0。默认truecompiler.remove_empty- 删除空规则。默认falsecompiler.remove_units- 删除不必要的单位。例如,将0px缩短为0。默认truecompiler.rgb_to_hex- 将 rgb 值转换为十六进制值。默认falsecompiler.input_dir- 包含您的 CSS 的目录。必需compiler.output_path- 保存编译后的 CSS 的路径。默认compiler.input_dir / compiled.css
使用方法
$app->register(new CssCompiler\CompilerServiceProvider(), array(
'compiler.shorten_hex' => true,
'compiler.rgb_to_hex' => true,
'compiler.remove_empty' => true,
'compiler.input_dir' => __DIR__ . '/css',
'compiler.output_path' => __DIR__ . '/css/compiled.css'
));
$app['compiler']->compile();