PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Tom Schaefer   CSS2LESS   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: simple example
Convert CSS into programmable CSS with LESS syntax
Author: By
Last change:
Date: 11 years ago
Size: 804 bytes


Class file image Download

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;


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