krypton/styles

A style class in PHP

0.0.1-alpha 2023-06-01 18:15 UTC

This package is auto-updated.

Last update: 2025-06-29 02:23:42 UTC


README

The PHP Styles Class allows you to print styles.

How to install?

composer require krypton/styles

How to use?

A simple example ...

<?php

use Krypton\Styles\Styles;

$css = [
    [
      'names' => [
        '.red'
      ],
      'attrs' => [
        'color' => '#F00'
      ]
    ],
    [
      'names' => [
        '.blue'
      ],
      'attrs' => [
        'color' => '#F0F'
      ]
    ],
    [
      'names' => [
        '.grey'
      ],
      'attrs' => [
        'color' => '#999'
      ]
    ],
    [
      'names' => [
        '.green'
      ],
      'attrs' => [
        'color' => '#0F0'
      ]
    ]
];

$styles = new Styles($css);
echo $styles->render();

License

This class is provided under GPL license http://www.gnu.org/licenses/gpl.html