PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Oleg KronuS   CSS to LESS   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example file
Class: CSS to LESS
Convert CSS stylesheets to LESS format
Author: By
Last change:
Date: 10 years ago
Size: 548 bytes


Class file image Download


$css2less = new css_to_less(file_get_contents('css.css'));

$css2less->set_color_count(2); // If some color appears in css-code 2 or more times it will be replaced by variable
$css2less->set_max_selectors_count_in_block(4); // Maximum count of selectors in the css-block to separate it (block) by comas - A,B,C,D,E{...} to A{...} B{...} C{...} D{...} E{...}

$css2less->proc_less(); // Generate less-code

echo '<pre>';
$css2less->get_less(); // Output less-code
echo '</pre>';