Poox is a library to generate CSS files with PHP classes. The name is the concatenation of POO (Programmation Orientée Objet) and CSS (sounds as X in French)
To install Poox, just get it from composer :
composer require jugid/poox
build.php
<?php
require __DIR__ . '/../../vendor/autoload.php';
use Poox\Poox;
use Poox\PooxVariables;
// Optional : Add your variables
$variables = new PooxVariables();
$variables->add('poox-green', '#a0c918');
$poox = new Poox($variables);
$poox->generate('/myClasses', '/assets', ['The\Namespaces\Of\PooxStyles']);
Define the style() : void
function and use the builder to create a hierarchical CSS.
Body.php
<?php
namespace Poox\Tests\Css;
use Poox\Node\PooxNodeType;
use Poox\PooxStyle;
class Body extends PooxStyle {
public function style() : void {
$builder = $this->createBuilder();
[...]
}
}
This command will generate a file named build.css
in the defined directory or separated files if inSeparateFiles()
is passed to Poox in your build.php
php build.php
- Finish methods for all properties
- Multiple namespace styles
- Syntactic sugar
Do what you want with Poox.