https://github.com/dresende/less.php
LESS implementation in PHP
https://github.com/dresende/less.php
Last synced: 10 months ago
JSON representation
LESS implementation in PHP
- Host: GitHub
- URL: https://github.com/dresende/less.php
- Owner: dresende
- License: mit
- Created: 2010-06-30T12:47:20.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-23T17:07:59.000Z (over 14 years ago)
- Last Synced: 2025-03-18T17:24:40.569Z (10 months ago)
- Language: PHP
- Homepage:
- Size: 266 KB
- Stars: 33
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
Less.php let's you convert .less files into .css
Versions
--------
0.0.1 - First official release (beta)
0.0.3 - Stable release; bug fixes; nested functions support; @if operator support
0.0.4 - Some improvements thanks to lars-sh
How to Use
----------
Run on the console: lessc file.less > output.css
If you want you can check the lessc file so you can use the class inside your code.
Supported
---------
- variables
- mixins
- nested rules
- operations
- comments (C-style and inline)
- math functions (min, max, avg, round, ceil, floor)
- color functions (lighten, darken, greyscale)
Missing
-------
- namespaces & accessors
TBD
---
- dataurl() function to embed images in css
- suggestions?
EXAMPLE
-------
@light-blue: #111 + #111;
@default-border: .4em;
@max-border: 2em;
/**
* First comment
**/
.bordered (@radius: 3px; @shadow-color: rgba(100, 100, 100, .5)) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
box-shadow: 0 0 3px @shadow-color;
-moz-box-shadow: 0 0 3px @shadow-color;
-webkit-box-shadow: 0 0 3px @shadow-color;
}
#header, #content {
// second comment
@red-color: #abcdef + #111; // other comment
a:active, a:hover {
text-decoration: none; // one more comment
border: @default-border + .2 solid black;
background: url(some/file.png) left center repeat-x;
}
color: @light-blue * 2;
.bordered ( 5px, );
:hover { color: @red-color; }
.item {
color: #af6788;
}
&.item {
color: red;
}
}
#nav {
margin: min(@max-border, 1em, .5em);
color: darken(#ccc, 20%); // same as lighten(#ccc, -20%)
background: greyscale(#f00);
}
.foo { &.bar { color: black }}