JuGid / Poox

Create css files with PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poox

codecov

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)

Installation

To install Poox, just get it from composer : composer require jugid/poox

Guide

Setup

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']);

Create a style (or more)

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();
        [...]
    }
}

Run Poox

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

Roadmap

  • Finish methods for all properties
  • Multiple namespace styles
  • Syntactic sugar

License

Do what you want with Poox.

About

Create css files with PHP


Languages

Language:PHP 98.5%Language:CSS 1.1%Language:Twig 0.4%