Download the PHP package thewind1984/css-optimizator without Composer
On this page you can find all versions of the php package thewind1984/css-optimizator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thewind1984/css-optimizator
More information about thewind1984/css-optimizator
Files in thewind1984/css-optimizator
Package css-optimizator
Short Description Interface accepts css files and folders / single templates files, then combines provided css files into one, compares it with provided templates, removes unused selectors and minifies final file
License MIT
Homepage http://dignatiev.ru/portfolio/55/css-optimizator
Informations about the package css-optimizator
CSS optimizator
Interface accepts css files and folders / single templates files, then combines provided css files into one, compares it with provided templates, removes unused selectors and minifies final file.
It supports twig templates also, because {% %}
, {{ }}
and {# #}
will be deleted before check.
Features
- Chains of CSS selectors like >, ~
- Pseudo-classes (with optional sub-selectors)
- Multiple selectors separated with , (comma)
TODO
- Parsing of chains of CSS selectors with + separator
.class + .subclass
- Parsing of selectors, which are implemented with quatro brackets
audio[controls]
[id*="xxx"]
,[class^="yyy"]
,[attr$="zzz"]
- Implementation convertion to xPath for pseudo-classes
nth-child
- Combining of duplicated selectors
body {margin; 0;} body {color: #000;}
=>body {margin: 0; color: #000;}
- Unification / optimization the rules inside selector
margin: 0; margin-bottom: 10px;
=>margin: 0 0 10px;
Installation through Composer
composer require thewind1984/css-optimizator
Usage
require_once './vendor/autoload.php';
$cssOptimizator = new \CssOptimizator\CssOptimize\CssOptimize();
$cssOptimizator->addCssFile('path/to/assets/file.css');
$cssOptimizator->addSourceFile('path/to/templates/page.html');
$cssOptimizator->optimize()->minify()->saveContent('path/to/assets/file.min.css');
All versions of css-optimizator with dependencies
ext-dom Version *
ext-xml Version *
ext-simplexml Version *
ext-mbstring Version *
symfony/finder Version ^4.2