Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  CSS2LESS  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: simple example
Class: CSS2LESS
Convert CSS into programmable CSS with LESS syntax
Author: By
Last change:
Date: 2012-07-08 12:58
Size: 804 bytes
 

Contents

Class file image Download
<?php

include_once 'class.css2less.php';

# sample: creates less source

$css = <<<EOD
#sidebar {
  padding: 0;
  margin: 0;
  font-size: 11px;
  width: 217px;
  position: absolute;
  top: 45px;
  left: 0;
  background-color: #EFEFEF;
  color: #444;
}

#sidebar h3 {
  clear: both;
  padding: 0;
  font-size: 12px;
  font-weight: bold;
}

#sidebar input[type='text'],
#sidebar input[type='password'],
#sidebar textarea {
  width: 186px;
  padding: 6px 5px;
  color: #626262;
  font-family: "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", "Luxi Sans", Tahoma, sans-serif;
  font-size: 1em;
  border: 1px solid #CCC;
  box-shadow: inset 0 1px 3px #E4E4E4;
}

EOD;

$cls = new CSS2LESS($css);
$less $cls->convert();
echo 
sprintf('<pre>%s</pre>'$less);