Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2012-08-02 08:45
Size: 548 bytes
 

Contents

Class file image Download
<?php

require_once('class.css_to_less.php');

$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>';
echo 
$css2less->get_less(); // Output less-code
echo '</pre>';

?>