PHP code example of avastechnology / demeter

1. Go to this page and download the library: Download avastechnology/demeter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

avastechnology / demeter example snippets


use AVASTech\Demeter\CSS\Parser;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/test.css'));

use AVASTech\Demeter\CSS\Parser;
use AVASTech\Demeter\CSS\Formats\Factory;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/compact.css'));

file_put_contents(
  __DIR__ . '/pretty.css',
  $styleSheet->render((new Factory())->compactStyleSheet())
);

use AVASTech\Demeter\CSS\Parser;
use AVASTech\Demeter\CSS\Formats\Factory;

$parser = new Parser();

$styleSheet = $parser->parse(file_get_contents(__DIR__ . '/pretty.css'));

file_put_contents(
  __DIR__ . '/compact.css',
  $styleSheet->render((new Factory())->compactStyleSheet())
);