2017 © Pedro Peláez
 

library css-lib

Library for reading / writing css

image

10usb/css-lib

Library for reading / writing css

  • Saturday, August 19, 2017
  • by 10usb
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

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., (*1)

The path to construct is stack based, therefore it is easily implemented in recursive procedures. For example traversing a DOM structure., (*2)

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., (*3)

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

The Versions

19/08 2017

dev-master

9999999-dev

Library for reading / writing css

  Sources   Download

The Requires

  • php >=7.0

 

14/08 2017

1.0.2

1.0.2.0

Library for reading / writing css

  Sources   Download

The Requires

  • php >=7.0

 

12/08 2017

1.0.1

1.0.1.0

Library for reading / writing css

  Sources   Download

The Requires

  • php >=7.0

 

17/07 2017

1.0.0

1.0.0.0

Library for reading / writing css

  Sources   Download

The Requires

  • php >=7.0