10usb/css-lib
Composer 安装命令:
composer require 10usb/css-lib
包简介
Library for reading / writing css
README 文档
README
This library allowes you parse a Cascading Style Sheets (CSS) document from which you can query property values given a path. The translation with of without inheritance of the values is up to you to decide. This gives you the freedom to create your own rules.
The path to construct is stack based, therefore it is easily implemented in recursive procedures. For example traversing a DOM structure.
As an extra this library supports is the ability to minify or reformat the contents by loading it and then respoduce with a new format.
Example
$document = new Document(); $parser = new Parser($document->addSegment('style.css')); // could be any name $parser->setSource(file_get_contents('style.css')); $parser->parse(); $path = new Path($document, new ExampleTranslator()); $path->push()->setTagName('html'); $path->push()->setTagName('body'); $path->push()->setTagName('section')->addClass('slides'); // prints the height value the section slide would get echo $path->getValue('height');
TODO's
- Support for At-Rules
- Default example kit for a HTML inliner
- Make a HTMLify formatter set
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-07-17