about
-----
This is the JavaScript, and now official, stable version of LESS.
For more information on the language and usage visit [lesscss.org](http://lesscss.org). More information also available [in our wiki](https://github.com/less/less.js/wiki)
license
-------
See `LICENSE` file.
> Copyright (c) 2009-2013 Alexis Sellier & The Core Less Team
less.js-1.4.2/benchmark/ 0000775 0000000 0000000 00000000000 12172566422 0015040 5 ustar 00root root 0000000 0000000 less.js-1.4.2/benchmark/benchmark.less 0000664 0000000 0000000 00000275116 12172566422 0017676 0 ustar 00root root 0000000 0000000 @bg: #f01;
@white: #fff;
@grey: #eee;
@black: #000;
@blue: #000;
@accent_colour: #000;
@light_grey: #eee;
@dark_grey: #eee;
@yellow: #422;
@red: #ff0000;
@colour_positive: #ff0000;
@colour_negative: #ff0000;
.box_shadow (...) {
}
.text_shadow (...) {
}
.border_radius (...) {
}
.border_radius_top_left (...) {
}
.border_radius_top_right (...) {
}
.border_radius_bottom_right (...) {
}
.border_radius_bottom_left (...) {
}
.border_radius_top (...) {
}
.border_radius_right (...) {
}
.border_radius_bottom (...) {
}
.border_radius_left (...) {
}
div.browse {
margin: 0 0 20px;
&.class {
padding: 0;
}
div.header {
padding: 10px 10px 9px; text-align: left; background: @bg url('/images/panel_header_bg.png') repeat-x top left;
border-bottom: 1px solid (@bg * 0.66 + @black * 0.33); line-height: 1; height: 18px;
.border_radius_top(3); color: @light_grey;
h3 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); }
span.filter {
float: left; display: block; overflow: hidden; position: relative; z-index: 5;
a {
margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px;
text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3;
.active {
background: @white; color: @black; z-index: 4;
:hover { color: @black; }
}
:hover { color: @white; }
:first-child { .border_radius_left(2); }
:last-child { .border_radius_right(2); margin-right: 0; }
}
}
span.filter.dropdown {
margin: 0; position: relative; overflow: visible;
a {
.border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px;
img { float: left; margin: 4px 5px 0 0; }
b.arrow {
float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none;
position: absolute; top: 6px; right: 10px;
}
:hover {
background: @accent_colour; color: @white;
b.arrow { border-top: 5px solid @white; }
}
}
ul {
position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2);
.box_shadow(0, 1, 1, @black);
li {
list-style: none; display: block; padding: 0; margin: 0;
a {
display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent;
border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap;
:hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; }
}
:last-child {
a { border: none; }
}
}
}
}
span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; }
span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; }
a.more {
float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold;
position: relative; top: 2px;
:hover { text-decoration: none; }
}
}
> ul {
margin: 0; background: @white; padding: 10px 0 0 10px; .border_radius(3); position: relative;
li {
display: block; float: left; list-style: none; margin: 0 10px 10px 0; padding: 5px; position: relative;
background: @white; width: 130px; border: 1px solid (@light_grey * 0.33 + @white * 0.66); .border_radius(2);
a.remove {
position: absolute; height: 16px; width: 16px; padding: 3px; background: @accent_colour;
.border_radius(99); display: none; z-index: 3; top: -8px; right: -8px;
img { vertical-align: middle; }
}
div.thumbnail {
.border_radius_top(3); position: relative; z-index: 3;
.marker {
position: absolute; padding: 2px; .border_radius(2); z-index: 3;
background: url('/images/transparent_backgrounds/white_75.png'); height: 12px; width: 12px;
}
.marker.coupon {
height: auto; width: auto; top: 10px; right: -3px; padding: 0; background: transparent; overflow: hidden; position: absolute;
b {
display: block; height: 0; width: 0; float: left; border: 14px solid transparent; border-top: 14px solid @accent_colour;
border-bottom: none; border-right: none; float: left;
}
span {
color: @white; font-size: 10px; font-weight: bold; text-transform: uppercase; height: 14px; line-height: 14px; display: block;
padding: 0 4px 0 2px; background: @accent_colour; .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25)); margin: 0 0 0 14px;
}
}
.marker.video {
position: absolute; left: 50%; top: 50%; background: @white; width: 10px; height: 10px;
b { display: block; width: 0; height: 0; border: 5px solid transparent; border-left: 10px solid @black; border-right: none; }
}
.marker.endorsed_by_me { background: none; padding: 0; right: 0; bottom: -32px; .border_radius(2); background: @white; }
a.thumbnail {
display: block; overflow: hidden; position: relative; text-align: center;
img { position: relative; display: block; margin: auto; }
}
}
div.text {
margin: 3px 0 0; display: block;
a { text-decoration: none; }
a.title {
display: block; text-decoration: none; font-weight: bold; font-size: 12px; line-height: 16px;
white-space: nowrap; height: 16px; overflow: hidden;
:before {
display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px;
background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white);
}
}
small {
font-size: 11px; line-height: 13px; color: @grey; display: block; height: 13px; overflow: hidden; white-space: nowrap;
a { font-weight: bold; }
:before {
display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px;
background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white);
}
}
}
:hover {
background: @accent_colour;
a.remove { display: block; }
div.thumbnail {
a.marker.remove, a.marker.video {
b { display: inline-block; }
}
a.marker.video { .box_shadow(0, 0, 2, @black); }
}
div.text {
a { color: @white; }
a.title:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); }
small {
color: @white * 0.75 + @accent_colour * 0.25;
:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); }
}
}
div.footer a { color: @white; }
}
}
> li.ad div.thumbnail a.thumbnail {
width: 130px; height: 97px;
img { width: 100%; height: 100%; }
}
> li.brand div.thumbnail a.thumbnail {
width: 120px; height: 87px; padding: 5px; background: @white; .border_radius(2);
img { max-width: 120px; max-height: 87px; }
}
li.paginate {
margin-bottom: 0;
a {
display: block; position: relative; text-decoration: none; height: 131px;
div.arrow {
background: #81c153 url('/images/button_bg.png') repeat-x left top; border: 1px solid (@accent_colour * 0.75 + @black * 0.25);
height: 44px; .border_radius(99); width: 44px; margin: 0 auto; position: relative; top: 32px;
b { text-indent: -9000px; display: block; border: 10px solid transparent; width: 0; height: 0; position: relative; top: 12px; }
}
div.label {
position: absolute; bottom: 5px; left: 0; right: 0; line-height: 13px;
color: @accent_colour * 0.85 + @black * 0.15; text-decoration: none;
font-weight: bold; font-size: 12px; text-align: center;
}
:hover {
div.arrow { background: #abd56e url('/images/button_bg.png') repeat-x left -44px; }
}
}
:hover { background: transparent; }
}
li.paginate.previous a div b { border-right: 15px solid @white; border-left: none; left: 12px; }
li.paginate.next a div b { border-left: 15px solid @white; border-right: none; left: 16px; }
}
> div.footer {
padding: 9px 10px 10px; background: @light_grey * 0.75 + @white * 0.25; overflow: hidden;
border-top: 1px solid @light_grey; .border_radius_bottom(3);
div.info {
float: left; color: @grey;
strong { color: @black; font-weight: normal; }
}
div.pagination {
float: right;
> * {
display: inline-block; line-height: 1; padding: 0 6px; line-height: 18px; height: 18px; background: @white;
.border_radius(3); text-decoration: none; font-weight: bold;
font-size: 10px; text-transform: uppercase;
}
a { color: @grey; }
a:hover { color: @black; }
span.disabled { color: @light_grey; }
span.current { color: @white; background: @bg; border: none; }
span.current:hover { color: @white; }
}
}
}
div.browse.with_categories { margin: 0 0 0 160px; }
div.browse.with_options > ul { .border_radius_top(0); }
div.browse.with_footer > ul { .border_radius_bottom(0); }
/* Browse List */
div.browse.list {
> ul {
margin: 0; min-height: 320px;
padding: 10px 0 0 10px; overflow: hidden;
> li {
display: block; list-style: none; margin: 0 10px 10px 0; padding: 5px;
.border_radius(3); position: relative; line-height: normal;
.marker {
position: absolute; padding: 2px; .border_radius(2);
background: url('/images/transparent_backgrounds/white_75.png');
img { height: 12px; width: 12px; }
}
img.marker { height: 12px; width: 12px; }
span.marker.new {
color: black; left: -5px; top: -5px; background: none; background-color: @white * 0.1 + @yellow * 0.6 + @red * 0.3; line-height: 1; padding: 2px 5px;
font-weight: bold;
}
a.marker.media_type {
display: inline-block; text-decoration: none; top: 39px; left: 8px;
font-size: 10px;
b { font-weight: normal; margin: 0 0 0 2px; line-height: 1; display: none; }
img { vertical-align: middle; }
}
a.thumbnail {
float: left;
width: 68px; display: block; overflow: hidden;
border: 1px solid @light_grey;
:hover { border-color: @accent_colour; }
}
span.title_brand {
display: block; margin: 0 0 2px 75px;
a { margin: 0; display: inline; }
a.brand_name { font-weight: normal; font-size: 12px; }
}
a.ad_title {
font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block;
}
a.brand_name {
font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block;
}
small {
display: block; color: @grey; margin: 0 0 0 75px; font-size: 12px;
}
small.brand_name { display: inline; margin: 0; }
ul.chart {
margin: 0 0 0 80px;
height: 39px;
}
ul.networks {
margin: 3px 0 0 75px; padding: 0; overflow: hidden;
li { display: block; float: left; margin: 0 5px 0 0; line-height: 1; }
}
div.points {
display: none;
font-size: 12px; text-align: right;
label { color: @grey; }
}
a.remove { bottom: -3px; right: -3px; }
}
li.ad {
a.thumbnail { height: 51px; }
span.title_brand {
small.brand_name {
display: block;
}
}
}
li.brand {
a.thumbnail { height: 68px; }
}
}
}
div.browse.list.with_options ul { .border_radius_top(0); }
div.browse.list.with_footer ul { .border_radius_bottom(0); }
div.browse.list.cols_2 {
> ul {
> li {
width: 285px; float: left;
:hover {
background: @white;
}
}
}
}
div.browse.ads.list {
> ul {
> li {
height: 53px;
a.thumbnail {
height: 51px;
}
}
}
}
div.browse.brands.list {
> ul {
> li {
height: 68px;
a.thumbnail {
height: 66px;
}
}
}
}
/* Categories List */
#categories {
margin: 40px 0 0; width: 160px; float: left; position: relative; z-index: 1;
ul {
margin: 0; padding: 10px 0 0;
li {
list-style: none; margin: 0; padding: 0; font-size: 14px;
a { color: @grey; display: block; padding: 5px 10px 5px 15px; text-decoration: none; .border_radius_left(3); }
a:hover { color: @black; background: @light_grey * 0.15 + @white * 0.85; }
}
.all a { font-weight: bold; }
.current a {
background: @white; color: @black; border: 1px solid (@light_grey * 0.25 + @white * 0.75); border-right: none; border-left: 5px solid @bg;
padding-left: 10px;
}
}
}
/* Ads > Show */
#ad {
div.header {
overflow: hidden;
h3 { font-size: 16px; margin: 0 0 3px; }
small {
a.category { font-weight: bold; color: @accent_colour; }
span.networks img { position: relative; top: 3px; }
}
span.brand {
float: right; color: @white;
a.brand_name { font-weight: bold; color: @accent_colour; }
}
}
div.content {
padding: 0; position: relative;
a.toggle_size {
display: block; .border_radius(3); background-color: @black; padding: 0 5px 0 26px;
background-position: 5px center; background-repeat: no-repeat; text-decoration: none; margin: 5px 5px 0 0;
position: absolute; top: 0; right: 0; line-height: 25px; z-index: 45;
}
img.creative { margin: 0 auto; max-width: 540px; display: block; }
object { position: relative; z-index: 44; }
object.video { line-height: 0; font-size: 0; }
object embed { position: relative; z-index: 45; line-height: 0; font-size: 0; }
}
div.content.not_video {
padding: 40px; text-align: center;
* { margin-left: auto; margin-right: auto; }
object.flash { margin-bottom: 0; }
}
div.footer {
padding: 0;
div.vote_views {
padding: 5px 10px; overflow: hidden;
div.share { float: right; margin: 2px 0 0 0; }
#login_register_msg, #encourage_vote_msg { line-height: 22px; font-weight: bold; color: @black; }
}
}
}
#sidebar {
#meta {
table {
margin: 0;
tr:last-child td { padding-bottom: 0; }
td {
padding: 0 0 5px;
ul.networks {
margin: 0; padding: 0;
li {
list-style: none; display: inline;
}
li {
}
}
}
td.label { color: @grey; white-space: nowrap; width: 1%; text-align: right; padding-right: 5px; }
}
}
}
/* Voting */
div.voted {
font-size: 12px; line-height: 22px; color: @black; display: inline-block; font-weight: bold;
img { float: left; margin-right: 5px; padding: 3px; .border_radius(3); }
}
#voted_up {
img { background: @colour_positive * 0.66 + @bg * 0.15; }
}
#voted_down {
img { background: @colour_negative * 0.66 + @bg * 0.15; }
}
#encourage_comment {
display: inline-block; line-height: 22px; font-weight: bold;
}
#vote {
overflow: hidden; font-size: 12px; line-height: 22px; color: @black; float: left;
a {
color: @white; font-weight: bold; overflow: hidden; display: block;
width: 16px; text-decoration: none; text-align: center; font-size: 10px; padding: 3px; text-transform: uppercase;
}
a.up {
float: left; background: @colour_positive * 0.66 + @bg * 0.15; .border_radius_left(3);
:hover { background: @colour_positive * 0.85 + @bg * 0.15; }
}
a.down {
float: left; background: @colour_negative * 0.66 + @bg * 0.15; .border_radius_right(3);
margin: 0 5px 0 1px;
:hover { background: @colour_negative * 0.85 + @bg * 0.15; }
}
}
#vote.disabled {
a.up {
background: (@colour_positive * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85;
:hover { background: (@colour_positive * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; }
}
a.down {
background: (@colour_negative * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85;
:hover { background: (@colour_negative * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; }
}
}
/* Panels */
div.panel {
margin: 0 0 20px; position: relative; .box_shadow(0, 0, 3, @light_grey * 0.66 + @white * 0.33); .border_radius(3);
> div.header {
background: @bg url('/images/panel_header_bg.png') repeat-x top left; border-bottom: 1px solid (@bg * 0.66 + @black * 0.33);
padding: 5px 10px 4px; .border_radius_top(3); min-height: 18px;
h2 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); }
h3 { color: @white; font-size: 14px; margin: 0; line-height: 18px; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); }
small { display: block; font-size: 12px; color: @light_grey * 0.25 + @white * 0.75; }
span.filter {
float: left; display: block; overflow: hidden; position: relative; z-index: 5;
a {
margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px;
text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3;
}
a:first-child { .border_radius_left(2); }
a:last-child { .border_radius_right(2); margin-right: 0; }
a.active { background: @white; color: @black; z-index: 4; }
a:hover { color: @white; }
a.active:hover { color: @black; }
}
span.filter.dropdown {
margin: 0; position: relative; overflow: visible;
a {
.border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px;
img { float: left; margin: 4px 5px 0 0; }
b.arrow {
float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none;
position: absolute; top: 6px; right: 10px;
}
:hover {
background: @accent_colour; color: @white;
b.arrow { border-top: 5px solid @white; }
}
}
ul {
position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2);
.box_shadow(0, 1, 1, @black);
li {
list-style: none; display: block; padding: 0; margin: 0;
a {
display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent;
border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap;
:hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; }
}
}
li:last-child {
a { border: none; }
}
}
}
span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; }
span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; }
a.more {
float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold;
position: relative; top: 2px;
:hover { text-decoration: none; }
}
}
> div.content {
background: @white; padding: 10px;
.no_padding { padding: 0; }
}
> div.footer {
background: @light_grey * 0.33 + @white * 0.66; border-top: 1px solid (@light_grey * 0.5 + @white * 0.5);
padding: 4px 10px 5px; .border_radius_bottom(3);
}
}
div.panel.no_footer div.content { .border_radius_bottom(3); }
div.panel.no_header div.content { .border_radius_top(3); }
div.panel.collapsable {
div.header {
cursor: pointer;
b.toggle { float: right; border: 5px solid transparent; border-bottom: 5px solid @white; border-top: none; display: block; width: 0; height: 0; margin: 6px 0 0 0; }
}
div.header:hover {
background-color: @bg * 0.75 + @white * 0.25;
}
}
div.panel.collapsed {
div.header {
border-bottom: none; .border_radius(3);
b.toggle { border-bottom: none; border-top: 5px solid @white; }
}
div.blank { border-bottom: none; .border_radius_bottom(3); }
div.content, div.footer { display: none; }
}
/* Sidebar Actions */
#sidebar {
#actions {
.box_shadow(0, 0, 0, transparent);
div.content {
background: url('/images/transparent_backgrounds/accent_colour_10.png'); text-align: center;
p.endorsement {
margin: 0 0 10px; font-size: 14px; font-weight: bold;
small { font-weight: normal; line-height: inherit; margin: 10px 0 0; }
:last-child { margin: 0; }
}
div.share { margin: 5px 0 0; }
a.button {
font-size: 16px; line-height: normal; height: auto; padding: 5px 10px 5px 35px; font-weight: bold; margin: 0; position: relative;
img { position: absolute; top: 3px; left: 6px; }
}
div.flash.notice {
margin: 10px 0 0; font-size: 22px;
small { font-weight: normal; margin: 0 0 10px; }
}
div.flash.notice.done { margin: 0; }
small {
display: block; margin: 10px 0 0; font-size: 11px; color: #808080; line-height: 12px;
img.favicon { vertical-align: middle; }
}
div.blank {
border: none; background: none; padding: 10px 0 0; border-top: 1px solid (@accent_colour * 0.5 + @white * 0.5);
margin: 10px 0 0;
}
}
}
}
/* People Lists */
ul.people {
margin: 0; padding: 10px 0 0 10px; background: @white;
> li {
display: block; margin: 0 10px 10px 0; float: left; padding: 2px; width: 57px; position: relative;
.border_radius(2); background: @white; list-style: none; border: 1px solid (@light_grey * 0.33 + @white * 0.66);
a.avatar {
display: block; width: 59px; height: 59px; overflow: hidden;
img { width: 100%; height: 100%; }
}
a.name { display: block; font-size: 10px; text-align: center; }
:hover {
background: @accent_colour;
a.name { color: @white; }
}
}
}
ul.people.list {
padding: 0;
> li {
margin: 0 0 10px; padding: 0 0 10px; overflow: hidden; float: none; width: auto; .border_radius(0);
border: none; border-bottom: 1px solid (@light_grey * 0.33 + @white * 0.66);
span.points {
float: right; display: block; padding: 5px; background: @light_grey * 0.15 + @white * 0.85; line-height: 1;
text-align: center; width: 50px; height: 30px; .border_radius(3); margin: 0 0 0 10px;
strong { display: block; color: @black; font-size: 16px; margin: 2px 0 0; }
label { color: @grey; text-transform: uppercase; font-size: 10px; }
label.long { display: block; }
label.short { display: none; }
}
a.avatar { float: left; width: 40px; height: 40px; }
a.name { font-size: 14px; font-weight: bold; margin: 0 0 0 50px; text-align: left; }
a.name.long { display: inline; }
a.name.short { display: none; }
span.networks {
display: block; margin: 0 0 0 50px;
img.favicon { vertical-align: middle; }
}
:hover {
background: transparent;
a.name { color: @accent_colour * 0.85 + @black * 0.15; }
}
:last-child { padding-bottom: 0; border-bottom: none; margin-bottom: 0; }
}
}
ul.people.list.small {
> li {
span.points {
padding: 3px 6px; height: 18px; font-size: 9px; line-height: 17px; width: 60px;
strong { font-size: 12px; margin: 0; display: inline; }
label { font-size: 9px; }
label.long { display: none; }
label.short { display: inline; }
}
a.avatar { width: 24px; height: 24px; }
a.name { display: inline; line-height: 24px; margin: 0 0 0 5px; font-size: 12px; height: 24px; }
a.name.long { display: none; }
a.name.short { display: inline; }
span.networks { display: inline; margin: 0; }
:last-child { padding-bottom: 0; border-bottom: none; margin-bottom: 0; }
}
}
ul.people.tiled {
> li {
width: 28px; padding: 2px;
a.avatar { width: 24px; height: 24px; background: @white; padding: 2px; }
a.name, small, span.networks, span.points { display: none; }
}
}
/* Comments */
#comments {
ul {
margin: 0 0 20px; padding: 0;
li {
display: block; list-style: none; padding: 0; margin: 0 0 10px;
span.meta {
margin: 0; overflow: hidden; display: block;
small { font-size: 12px; color: @light_grey; float: right; line-height: 16px; display: inline-block; }
a.avatar {
display: inline-block; height: 16px; width: 16px; position: relative; top: 3px;
img { height: 100%; width: 100%; }
}
a.name { font-weight: bold; line-height: 16px; display: inline-block; }
span.inactive { color: @grey; font-weight: bold; line-height: 16px; display: inline-block; }
}
b.tail {
display: block; width: 0; height: 0; margin: 3px 0 0 10px; border: 5px solid transparent; border-top: none;
border-bottom: 5px solid @white; position: relative; z-index: 2;
}
blockquote {
margin: 0; padding: 10px; .border_radius(3); font-style: normal; background: @white;
color: @dark_grey; .box_shadow(0, 0, 3, @light_grey * 0.66 + @white * 0.33);
}
}
}
form {
margin: 0;
textarea { width: 500px; }
}
}
/* Sidebar Categories */
#sidebar {
#categories {
margin: 0 0 20px;
width: auto;
p { margin: 0; }
}
}
#sidebar {
#ads > ul li, #recommendations > ul li {
width: 81px;
div.thumbnail {
a.thumbnail { height: 60px; width: 81px; }
}
div.text {
a.title { font-size: 11px; height: 14px; line-height: 14px; }
small { display: none; }
}
}
#brands > ul li {
width: 55px;
div.thumbnail {
a.thumbnail {
height: 45px; width: 45px;
img { max-height: 45px; max-width: 45px; }
}
}
div.text { display: none; }
}
}
/* My Account */
#accounts_controller {
#top {
#page_title {
#page_options {
a.button.public_profile {
float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 35px 8px 15px; position: relative;
b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; right: 15px; border: 6px solid transparent; border-right: none; border-left: 6px solid @white; margin: 0; }
}
a.button.goto_dashboard {
float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 15px 8px 35px; margin-right: 5px; position: relative;
b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; left: 15px; border: 6px solid transparent; border-left: none; border-right: 6px solid @white; margin: 0; }
}
}
}
}
#account_nav {
float: left; width: 200px; margin: 0 20px 0 0;
ul.nav {
margin: 0; padding: 0;
li {
margin: 0 0 5px; display: block; list-style: none; padding: 0;
a {
display: block; height: 30px; text-decoration: none; color: @white;
b {
border: 15px solid transparent; border-right: none; border-left: 10px solid transparent; width: 0;
height: 0; float: right; display: none;
}
span {
.border_radius(3); background: @bg; display: block;
line-height: 30px; padding: 0 10px; font-size: 14px; font-weight: bold; margin: 0 10px 0 0;
}
}
:hover {
a {
color: @white;
b { border-left-color: @bg; display: block; }
span { background: @bg; .border_radius_right(0); }
}
}
}
li.current a {
b { border-left-color: @accent_colour; display: block; }
span { background: @accent_colour; color: @white; .border_radius_right(0); }
}
}
}
#main {
> div {
margin: 0 0 20px;
form { margin: 0; }
}
#profile {
a.avatar {
float: left; display: block;
width: 70px; overflow: hidden; position: relative; text-decoration: none;
img { width: 100%; }
span {
display: block; line-height: 1; padding: 3px; margin: 5px 0 0; color: @white; background: @accent_colour;
.border_radius(3); .text_shadow(1, 1, 0, @grey);
text-align: center; font-size: 10px; font-weight: bold; text-transform: uppercase;
}
}
form {
margin: 0 0 0 90px;
h4 { margin: 10px 0 20px; border-bottom: 1px solid (@light_grey * 0.5 + @white * 0.5); padding: 0; color: @bg; font-size: 16px; }
ul.choices {
li { width: 30%; }
}
div.extra { margin-top: 20px; }
}
}
#networks {
ul { margin: 0 -10px -10px 0; padding: 0; overflow: hidden;
li:hover
{
background: @light_grey; display: block; float: left; width: 180px;
padding: 10px; margin: 0 10px 10px 0; list-style: none; .border_radius(3);
position: relative;
* { line-height: normal; }
img { vertical-align: middle; float: left; }
.name { font-weight: bold; font-size: 14px; display: block; margin: -2px 0 0 42px; }
small {
font-size: 12px; color: @grey; display: block; margin-left: 42px;
strong { color: @black; font-weight: normal; }
}
:hover {
}
}
li.installed {
background: @white;
border: 2px solid @accent_colour; padding: 8px;
}
li.unavailable {
.name { color: @black; }
:hover {
background: @light_grey;
}
}
li:hover {
background: @light_grey * 0.5 + @white * 0.5;
}
}
}
}
}
/* Shopping Style Panel */
#shopping_style {
div.header a.button.small { float: right; }
div.content {
p {
margin: 0 0 10px;
label { text-transform: uppercase; font-size: 11px; display: block; color: @bg; font-weight: bold; }
span { color: @black; }
span.toggle { white-space: nowrap; color: @grey; }
:last-child { margin: 0; }
}
p.more { text-align: left; font-weight: normal; }
p.less { display: none; margin: 0; }
}
}
/* People Controller */
#people_controller.index {
#main {
div.panel {
float: left; width: 300px; margin: 0 20px 0 0;
:last-child { margin-right: 0; }
}
}
}
#people_controller.show {
#person_overview, #shopping_style {
a.button.small {
}
}
#content {
#shopping_style {
float: left; width: 240px; margin: 0 20px 0 0;
}
#main { width: 360px; }
}
}
/* Search Results */
#search_results {
margin: 0 0 20px;
li {
:hover {
small { color: @white * 0.75 + @accent_colour * 0.25; }
}
}
}
#search {
div.content {
padding: 20px;
form {
margin: 0; float: none;
span.submit_and_options {
display: block;
}
}
p { margin: 0 0 15px; }
h4 { font-weight: normal; margin: 0 0 5px; }
}
}
/* Recommendations */
#recommendations {
div.browse {
margin: 0; padding: 0; background: none;
ul { min-height: 0; .border_radius(0); }
}
}
/* Blank States */
div.blank {
padding: 20px; background: @bg * 0.05 + @blue * 0.05 + @white * 0.9; position: relative;
border: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); z-index: 1;
h4 { font-size: 18px; margin: 0 0 10px; }
h4:last-child { margin: 0; }
p { font-size: 16px; margin: 0 0 10px; }
p:last-child { margin: 0; }
p.with_list_number.large {
span { margin-left: 48px; display: block; color: @white; }
}
p.earn span { font-size: 22px; color: @white; line-height: 48px; font-weight: bold; }
a { white-space: nowrap; }
a.hide {
position: absolute; top: -5px; right: -5px; display: block; height: 16px; width: 16px; padding: 3px; background: #E7E9F6; .border_radius(99);
}
}
div.blank.small {
padding: 10px 20px;
h4 { font-weight: normal; font-size: 16px; }
p { margin: 0; }
}
div.blank.tiny {
padding: 10px 20px;
h4 { font-weight: normal; font-size: 14px; }
p { margin: 0; font-size: 12px; }
}
div.blank.rounded {
.border_radius(3); margin: 0 0 20px;
}
div.blank.rounded.bottom { .border_radius_top(0); }
div.blank.with_border_bottom { border-bottom: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); }
div.blank.no_border_top { border-top: none; }
div.blank.no_border_bottom { border-bottom: none; }
div.blank.no_side_borders { border-right: none; border-left: none; }
div.panel {
div.blank {
padding: 10px 20px; overflow: hidden; margin: 0;
h4 { font-weight: normal; font-size: 14px; }
p, ul { margin: 0 0 10px; font-size: 12px; }
p:last-child, ul:last-child { margin: 0; }
}
}
/* Sidebar Browse */
#sidebar {
div.panel {
div.content.browse {
padding: 0; margin: 0;
> ul {
min-height: 0; .border_radius(0);
> li {
div.thumbnail {
a.thumbnail { padding: 5px; }
img.marker.media_type { top: 48px; left: 8px; }
}
div.footer {
a.title, a.name { font-size: 11px; font-weight: normal; }
}
}
}
}
div.content.browse.ads > ul > li {
width: 93px;
> div.thumbnail a.thumbnail { width: 83px; height: 62px; }
}
div.content.browse.brands {
.border_radius(3);
> ul {
background: none;
> li {
width: 52px;
> div.thumbnail {
padding: 3px;
a.thumbnail { width: 42px; height: 42px; padding: 2px; }
}
li.active { background: @accent_colour; }
}
}
}
div.footer {
div.info { float: none; }
div.pagination { float: none; margin: 3px 0 0; }
}
}
}
/* List Numbers */
label.list_number {
float: left; background: url('/images/transparent_backgrounds/black_15.png'); padding: 2px; width: 24px; height: 24px; display: block;
.border_radius(99);
b {
display: block; font-weight: bold; font-size: 14px; color: @white; background: @accent_colour; height: 20px; width: 20px; line-height: 20px;
text-align: center; .border_radius(99); .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25));
border: 2px solid @white;
}
}
label.list_number.large {
padding: 4px; width: 48px; height: 48px; .border_radius(99); position: relative; left: -10px;
b {
font-size: 28px; height: 40px; width: 40px; .border_radius(99); line-height: 40px;
.text_shadow(2, 2, 0px, (@accent_colour * 0.75 + @black * 0.25)); border-width: 4px;
}
}
/* Dashboard */
#dashboard_controller {
#ads {
span.filter.state { float: right; }
}
#sidebar {
#shopping_style div.content {
p.less { display: block; }
p.more { display: none; }
}
#influences {
div.header {
padding-bottom: 0;
ul.tabs {
position: relative; top: 1px; z-index: 3;
li {
margin: 0 5px 0 0;
a {
border: none; background: url('/images/transparent_backgrounds/white_75.png');
:hover { color: @black; }
}
}
li.active {
a {
background: @white; border: none;
:hover { color: @black; }
}
}
}
}
div.tab_content {
overflow: hidden; padding: 0;
> ul {
padding: 10px 10px 0; max-height: 280px; min-height: 120px; overflow-y: scroll; .border_radius_bottom(3px);
}
}
div.footer {
form {
p {
margin: 0 0 5px;
img.marker { float: right; margin: 5px 0 0 0; }
span.invitee {
line-height: 26px; padding: 3px 3px 0; font-size: 14px;
small { color: @grey; font-size: 12px; }
}
}
p.indent { margin-left: 36px; }
p.submit { margin-top: 10px; }
}
}
}
}
div.panel.full {
> div.content {
margin: 0; padding: 0; background: none;
ul {
li {
width: 148px;
div.thumbnail {
img.marker.media_type { top: 90px; }
a.thumbnail { width: 138px; height: 104px; }
}
}
}
}
}
#people {
form {
padding: 0 0 5px;
input { width: 225px; float: left; margin: 0 5px 0 0; }
a.button { height: 23px; line-height: 23px; width: 60px; padding: 0; text-align: center; }
}
}
}
/* Remove Pages Titles when Browsing */
#ads_controller, #brands_controller {
#page_title { display: none; }
}
/* Brands > Show */
#brands_controller.show {
#ads {
div.filters {
h3 { font-size: 16px; margin: 0; }
span.show { float: right; }
span.filter.dropdown.localisation { float: right; margin: 0 0 0 10px; }
span.filter.state { float: right; margin: 0 0 0 10px; }
}
}
}
/* FAQ */
#pages_controller.faq {
#answers {
h3 { margin-top: 20px; padding-top: 20px; border-top: 1px solid (@light_grey * 0.75 + @white * 0.25); }
h3.first { margin-top: 0; padding-top: 0; border: none; }
}
#questions {
div.content {
padding: 20px;
ul {
margin: 0; padding: 0;
li {
margin: 0 0 10px; list-style: none; display: block; padding: 0;
a { font-size: 14px; }
}
li:last-child {
margin: 0;
}
}
}
}
}
/* Person Overview */
#person_overview {
padding: 20px 10px; position: relative; z-index: 25;
#person {
float: left; width: 620px;
a.avatar {
display: block; float: left; width: 60px; height: 60px;
img { height: 100%; width: 100%; }
}
> div {
margin: 0 0 0 75px; color: @white; font-size: 14px; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33);
}
div.name {
h2 {
margin: 0 0 5px; display: inline;
a {
font-size: 20px; font-weight: bold; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33);
line-height: 1; color: @white; text-decoration: none;
:hover { text-decoration: underline; }
}
a.button.small {
font-size: 10px;
:hover { text-decoration: none; }
}
}
span.points {
float: right; display: block; padding: 5px 10px; .border_radius(2); text-align: center; background: @white; position: relative;
min-width: 45px;
strong { color: @black; font-weight: bold; font-size: 24px; line-height: 1; display: block; .text_shadow(0, 0, 0, transparent); }
label { font-size: 9px; text-transform: uppercase; color: @grey; display: block; .text_shadow(0, 0, 0, transparent); font-weight: bold; }
}
span.points.with_redeem {
.border_radius_bottom(0);
a.button {
display: block; text-align: center; .border_radius_top(0); font-size: 10px; font-weight: bold; padding: 0;
position: absolute; height: 18px; left: 0; right: 0; bottom: -19px; line-height: 18px; text-transform: uppercase; border: none;
}
}
div.options { margin: 0; }
}
div.meta {
color: @white * 0.66 + @bg * 0.33;
span { color: @white; }
label { color: @white * 0.66 + @bg * 0.33; }
ul.networks {
display: inline; margin: 0; padding: 0;
li {
display: inline; line-height: 1;
img { position: relative; vertical-align: middle; top: -1px; }
}
}
}
div.extra {
font-size: 12px; margin-top: 20px; margin-bottom: 20px;
span.toggle {
.text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33);
a { font-size: 10px; font-weight: bold; text-transform: uppercase; text-decoration: none; color: @accent_colour; }
b.arrow { display: inline-block; width: 0; height: 0; border: 5px solid transparent; position: relative; top: -2px; }
}
#less_info {
span.toggle {
b.arrow { border-top: 5px solid @accent_colour; border-bottom: 0; }
}
}
#more_info {
span.toggle {
float: right;
b.arrow { border-bottom: 5px solid @accent_colour; border-top: 0; }
}
h4 {
color: @white; margin: 0 0 10px 0; border-bottom: 1px solid (@white * 0.25 + @bg * 0.75); .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33);
span { font-size: 12px; }
}
p {
margin: 0 0 5px;
label { display: block; float: left; width: 120px; color: @white * 0.66 + @bg * 0.33; }
span { display: block; margin: 0 0 0 130px; }
}
p:last-child { margin: 0; }
}
}
div.login {
margin: 0 0 0 75px;
a.button { font-weight: bold; }
}
}
}
/* Dashboard Nav */
#dashboard_nav {
position: absolute; bottom: 0; left: 10px; margin: 0; padding: 0; overflow: hidden;
li {
display: block; float: left; margin: 0 5px 0 0;
a {
display: block; height: 28px; padding: 0 10px; line-height: 28px; .border_radius_top(2);
text-decoration: none; color: @white; background: url('/images/transparent_backgrounds/accent_colour_30.png'); font-size: 14px;
font-weight: bold;
:hover { background: url('/images/transparent_backgrounds/accent_colour_45.png'); }
}
}
li.active {
a {
background: @white; color: @black;
:hover { color: @black; }
}
}
}
/* Dwellometer */
#dwellometer {
z-index: 45; float: right; .box_shadow(0, 0, 0, transparent); margin: 0;
div.content {
text-align: center; position: relative;
object, object embed { position: relative; z-index: 46; line-height: 0; }
div.title {
position: absolute; bottom: 10px; left: 0; right: 0; z-index: 50;
img { width: 120px; display: block; margin: 0 auto; position: relative; left: -5px; }
}
}
}
/* Activity Stream */
#activity {
div.content {
ul.events {
padding: 0; margin: 0 0 -10px;
li {
margin: 0; padding: 10px 0; border-bottom: 1px solid (@light_grey * 0.33 + @white * 0.66);
list-style: none; overflow: hidden;
small.meta {
font-size: 12px; color: @light_grey; float: right;
}
a.button { float: right; margin: 0 0 10px 10px; }
a.avatar, a.logo, a.thumbnail {
height: 32px; display: block; float: left;
img { width: 100%; height: 100%; }
}
a.avatar, a.logo, a.icon { width: 32px; }
a.thumbnail { width: 42px; }
div.symbols {
float: left; overflow: hidden;
b {
display: block; float: left; margin: 10px 5px 0;
img { height: 12px; width: 12px; }
}
b.voted { margin: 10px 3px 0; padding: 2px; .border_radius(2); }
b.voted.for { background: @colour_positive * 0.33 + @white * 0.66; }
b.voted.against { background: @colour_negative * 0.33 + @white * 0.66; }
}
/* Temporarily removed avatar and symbol */
/* div.symbols a.agent, b { display: none; }*/
div.description {
font-size: 12px; color: @grey;
a.agent { font-weight: bold; }
}
div.comment {
margin-top: 2px;
b.tail {
display: block; margin: 0 0 0 10px; width: 0; height: 0; border: 5px solid transparent;
border-top: none; border-bottom: 5px solid (@light_grey * 0.25 + @white * 0.75);
}
blockquote {
margin: 0; font-style: normal; color: @dark_grey;
.border_radius(3); background: @light_grey * 0.25 + @white * 0.75; padding: 5px 10px;
span.view_comment {
color: @grey;
}
}
}
div.content {
overflow: hidden;
}
}
li.new_comment.ad, li.endorsed.ad, li.voted {
div.description, div.content { margin-left: 106px; }
/* div.description, div.content { margin-left: 53px; }*/
}
li.new_comment.brand, li.replied_to, li.endorsed.brand, li.connected, li.sn_setup {
div.description, div.content { margin-left: 96px; }
/* div.description, div.content { margin-left: 43px; }*/
}
li.replied_to {
div.content {
a.thumbnail, a.logo { margin-top: 7px; }
}
}
li.replied_to.ad {
div.content {
div.comment { margin-left: 52px; }
}
}
li.replied_to.brand {
div.content {
div.comment { margin-left: 42px; }
}
}
li.voted div.description span.action { .border_radius(2); color: @dark_grey; padding: 0 3px; white-space: nowrap; }
li.voted.for div.description span.action { background: @colour_positive * 0.15 + @white * 0.85; }
li.voted.against div.description span.action { background: @colour_negative * 0.15 + @white * 0.85; }
li:first-child { padding-top: 0; }
li:last-child { border-bottom: none; }
li:hover div.content div.comment blockquote span.view_comment {
}
}
}
}
/* Login/Register Modal */
#login_register {
div.location_select,
div.location_search { margin-left: 130px; }
h3 {
small { font-size: 14px; font-weight: normal; display: block; color: @grey; text-align: left; margin: 0; display: block; }
}
}
/* Contact Form in Pages */
#pages_controller {
#sidebar {
#contact {
margin: 15px 0 0;
form {
label { text-align: left; float: none; width: auto; font-size: 12px; font-weight: bold; line-height: 1; margin: 0 0 5px; }
p.submit.indent {
margin: 0;
span.with_cancel { display: none; }
}
}
}
}
}
/* Exclusive Offers */
#offers {
div.content {
a.gift {
display: block; text-align: center;
img { height: 100px; }
}
}
}
div.browse {
margin: 0 0 20px;
&.class {
padding: 0;
}
div.header {
padding: 10px 10px 9px; text-align: left; background: @bg url('/images/panel_header_bg.png') repeat-x top left;
border-bottom: 1px solid (@bg * 0.66 + @black * 0.33); line-height: 1; height: 18px;
.border_radius_top(3); color: @light_grey;
h3 { font-size: 16px; margin: 0; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); }
span.filter {
float: left; display: block; overflow: hidden; position: relative; z-index: 5;
a {
margin: 0 1px 0 0; display: block; float: left; padding: 0 8px; height: 18px; font-weight: bold; font-size: 10px; line-height: 18px;
text-transform: uppercase; background: url('/images/transparent_backgrounds/black_50.png'); color: @light_grey; text-decoration: none; position: relative; z-index: 3;
.active {
background: @white; color: @black; z-index: 4;
:hover { color: @black; }
}
:hover { color: @white; }
:first-child { .border_radius_left(2); }
:last-child { .border_radius_right(2); margin-right: 0; }
}
}
span.filter.dropdown {
margin: 0; position: relative; overflow: visible;
a {
.border_radius(2); background: @white; color: @black; margin: 0; position: relative; padding-right: 25px;
img { float: left; margin: 4px 5px 0 0; }
b.arrow {
float: right; display: block; height: 0; width: 0; border: 5px solid transparent; border-top: 5px solid @black; border-bottom: none;
position: absolute; top: 6px; right: 10px;
}
:hover {
background: @accent_colour; color: @white;
b.arrow { border-top: 5px solid @white; }
}
}
ul {
position: absolute; top: 100%; left: 0; margin: 1px 0 0; padding: 0; background: @white; .border_radius(2);
.box_shadow(0, 1, 1, @black);
li {
list-style: none; display: block; padding: 0; margin: 0;
a {
display: block; height: 18px; line-height: 18px; color: @black; font-size: 10px; text-transform: uppercase; background: transparent;
border-bottom: 1px solid (@light_grey * 0.66 + @white * 0.33); float: none; margin: 0; .border_radius(0); white-space: nowrap;
:hover { background: url('/images/transparent_backgrounds/accent_colour_25.png'); color: @black; }
}
:last-child {
a { border: none; }
}
}
}
}
span.filter.dropdown.sort { float: left; margin: 0 0 0 10px; }
span.filter.dropdown.localisation { float: left; margin: 0 0 0 10px; }
a.more {
float: right; color: @white; .text_shadow(1, 1, 0, @bg * 0.66 + @black * 0.33); font-size: 14px; font-weight: bold;
position: relative; top: 2px;
:hover { text-decoration: none; }
}
}
> ul {
margin: 0; background: @white; padding: 10px 0 0 10px; .border_radius(3); position: relative;
li {
display: block; float: left; list-style: none; margin: 0 10px 10px 0; padding: 5px; position: relative;
background: @white; width: 130px; border: 1px solid (@light_grey * 0.33 + @white * 0.66); .border_radius(2);
a.remove {
position: absolute; height: 16px; width: 16px; padding: 3px; background: @accent_colour;
.border_radius(99); display: none; z-index: 3; top: -8px; right: -8px;
img { vertical-align: middle; }
}
div.thumbnail {
.border_radius_top(3); position: relative; z-index: 3;
.marker {
position: absolute; padding: 2px; .border_radius(2); z-index: 3;
background: url('/images/transparent_backgrounds/white_75.png'); height: 12px; width: 12px;
}
.marker.coupon {
height: auto; width: auto; top: 10px; right: -3px; padding: 0; background: transparent; overflow: hidden; position: absolute;
b {
display: block; height: 0; width: 0; float: left; border: 14px solid transparent; border-top: 14px solid @accent_colour;
border-bottom: none; border-right: none; float: left;
}
span {
color: @white; font-size: 10px; font-weight: bold; text-transform: uppercase; height: 14px; line-height: 14px; display: block;
padding: 0 4px 0 2px; background: @accent_colour; .text_shadow(1, 1, 0px, (@accent_colour * 0.75 + @black * 0.25)); margin: 0 0 0 14px;
}
}
.marker.video {
position: absolute; left: 50%; top: 50%; background: @white; width: 10px; height: 10px;
b { display: block; width: 0; height: 0; border: 5px solid transparent; border-left: 10px solid @black; border-right: none; }
}
.marker.endorsed_by_me { background: none; padding: 0; right: 0; bottom: -32px; .border_radius(2); background: @white; }
a.thumbnail {
display: block; overflow: hidden; position: relative; text-align: center;
img { position: relative; display: block; margin: auto; }
}
}
div.text {
margin: 3px 0 0; display: block;
a { text-decoration: none; }
a.title {
display: block; text-decoration: none; font-weight: bold; font-size: 12px; line-height: 16px;
white-space: nowrap; height: 16px; overflow: hidden;
:before {
display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px;
background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white);
}
}
small {
font-size: 11px; line-height: 13px; color: @grey; display: block; height: 13px; overflow: hidden; white-space: nowrap;
a { font-weight: bold; }
:before {
display: block; height: 32px; width: 20px; content: " "; float: right; right: -15px; top: -8px;
background: @white; position: relative; z-index: 1; .box_shadow(-5, 0, 10, @white);
}
}
}
:hover {
background: @accent_colour;
a.remove { display: block; }
div.thumbnail {
a.marker.remove, a.marker.video {
b { display: inline-block; }
}
a.marker.video { .box_shadow(0, 0, 2, @black); }
}
div.text {
a { color: @white; }
a.title:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); }
small {
color: @white * 0.75 + @accent_colour * 0.25;
:before { background: @accent_colour; .box_shadow(-5, 0, 10, @accent_colour); }
}
}
div.footer a { color: @white; }
}
}
> li.ad div.thumbnail a.thumbnail {
width: 130px; height: 97px;
img { width: 100%; height: 100%; }
}
> li.brand div.thumbnail a.thumbnail {
width: 120px; height: 87px; padding: 5px; background: @white; .border_radius(2);
img { max-width: 120px; max-height: 87px; }
}
li.paginate {
margin-bottom: 0;
a {
display: block; position: relative; text-decoration: none; height: 131px;
div.arrow {
background: #81c153 url('/images/button_bg.png') repeat-x left top; border: 1px solid (@accent_colour * 0.75 + @black * 0.25);
height: 44px; .border_radius(99); width: 44px; margin: 0 auto; position: relative; top: 32px;
b { text-indent: -9000px; display: block; border: 10px solid transparent; width: 0; height: 0; position: relative; top: 12px; }
}
div.label {
position: absolute; bottom: 5px; left: 0; right: 0; line-height: 13px;
color: @accent_colour * 0.85 + @black * 0.15; text-decoration: none;
font-weight: bold; font-size: 12px; text-align: center;
}
:hover {
div.arrow { background: #abd56e url('/images/button_bg.png') repeat-x left -44px; }
}
}
:hover { background: transparent; }
}
li.paginate.previous a div b { border-right: 15px solid @white; border-left: none; left: 12px; }
li.paginate.next a div b { border-left: 15px solid @white; border-right: none; left: 16px; }
}
> div.footer {
padding: 9px 10px 10px; background: @light_grey * 0.75 + @white * 0.25; overflow: hidden;
border-top: 1px solid @light_grey; .border_radius_bottom(3);
div.info {
float: left; color: @grey;
strong { color: @black; font-weight: normal; }
}
div.pagination {
float: right;
> * {
display: inline-block; line-height: 1; padding: 0 6px; line-height: 18px; height: 18px; background: @white;
.border_radius(3); text-decoration: none; font-weight: bold;
font-size: 10px; text-transform: uppercase;
}
a { color: @grey; }
a:hover { color: @black; }
span.disabled { color: @light_grey; }
span.current { color: @white; background: @bg; border: none; }
span.current:hover { color: @white; }
}
}
}
div.browse.with_categories { margin: 0 0 0 160px; }
div.browse.with_options > ul { .border_radius_top(0); }
div.browse.with_footer > ul { .border_radius_bottom(0); }
/* Browse List */
div.browse.list {
> ul {
margin: 0; min-height: 320px;
padding: 10px 0 0 10px; overflow: hidden;
> li {
display: block; list-style: none; margin: 0 10px 10px 0; padding: 5px;
.border_radius(3); position: relative; line-height: normal;
.marker {
position: absolute; padding: 2px; .border_radius(2);
background: url('/images/transparent_backgrounds/white_75.png');
img { height: 12px; width: 12px; }
}
img.marker { height: 12px; width: 12px; }
span.marker.new {
color: black; left: -5px; top: -5px; background: none; background-color: @white * 0.1 + @yellow * 0.6 + @red * 0.3; line-height: 1; padding: 2px 5px;
font-weight: bold;
}
a.marker.media_type {
display: inline-block; text-decoration: none; top: 39px; left: 8px;
font-size: 10px;
b { font-weight: normal; margin: 0 0 0 2px; line-height: 1; display: none; }
img { vertical-align: middle; }
}
a.thumbnail {
float: left;
width: 68px; display: block; overflow: hidden;
border: 1px solid @light_grey;
:hover { border-color: @accent_colour; }
}
span.title_brand {
display: block; margin: 0 0 2px 75px;
a { margin: 0; display: inline; }
a.brand_name { font-weight: normal; font-size: 12px; }
}
a.ad_title {
font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block;
}
a.brand_name {
font-weight: bold; font-size: 14px; margin: 0 0 0 75px; display: block;
}
small {
display: block; color: @grey; margin: 0 0 0 75px; font-size: 12px;
}
small.brand_name { display: inline; margin: 0; }
ul.chart {
margin: 0 0 0 80px;
height: 39px;
}
ul.networks {
margin: 3px 0 0 75px; padding: 0; overflow: hidden;
li { display: block; float: left; margin: 0 5px 0 0; line-height: 1; }
}
div.points {
display: none;
font-size: 12px; text-align: right;
label { color: @grey; }
}
a.remove { bottom: -3px; right: -3px; }
}
li.ad {
a.thumbnail { height: 51px; }
span.title_brand {
small.brand_name {
display: block;
}
}
}
li.brand {
a.thumbnail { height: 68px; }
}
}
}
div.browse.list.with_options ul { .border_radius_top(0); }
div.browse.list.with_footer ul { .border_radius_bottom(0); }
div.browse.list.cols_2 {
> ul {
> li {
width: 285px; float: left;
:hover {
background: @white;
}
}
}
}
div.browse.ads.list {
> ul {
> li {
height: 53px;
a.thumbnail {
height: 51px;
}
}
}
}
div.browse.brands.list {
> ul {
> li {
height: 68px;
a.thumbnail {
height: 66px;
}
}
}
}
/* Categories List */
#categories {
margin: 40px 0 0; width: 160px; float: left; position: relative; z-index: 1;
ul {
margin: 0; padding: 10px 0 0;
li {
list-style: none; margin: 0; padding: 0; font-size: 14px;
a { color: @grey; display: block; padding: 5px 10px 5px 15px; text-decoration: none; .border_radius_left(3); }
a:hover { color: @black; background: @light_grey * 0.15 + @white * 0.85; }
}
.all a { font-weight: bold; }
.current a {
background: @white; color: @black; border: 1px solid (@light_grey * 0.25 + @white * 0.75); border-right: none; border-left: 5px solid @bg;
padding-left: 10px;
}
}
}
/* Ads > Show */
#ad {
div.header {
overflow: hidden;
h3 { font-size: 16px; margin: 0 0 3px; }
small {
a.category { font-weight: bold; color: @accent_colour; }
span.networks img { position: relative; top: 3px; }
}
span.brand {
float: right; color: @white;
a.brand_name { font-weight: bold; color: @accent_colour; }
}
}
div.content {
padding: 0; position: relative;
a.toggle_size {
display: block; .border_radius(3); background-color: @black; padding: 0 5px 0 26px;
background-position: 5px center; background-repeat: no-repeat; text-decoration: none; margin: 5px 5px 0 0;
position: absolute; top: 0; right: 0; line-height: 25px; z-index: 45;
}
img.creative { margin: 0 auto; max-width: 540px; display: block; }
object { position: relative; z-index: 44; }
object.video { line-height: 0; font-size: 0; }
object embed { position: relative; z-index: 45; line-height: 0; font-size: 0; }
}
div.content.not_video {
padding: 40px; text-align: center;
* { margin-left: auto; margin-right: auto; }
object.flash { margin-bottom: 0; }
}
div.footer {
padding: 0;
div.vote_views {
padding: 5px 10px; overflow: hidden;
div.share { float: right; margin: 2px 0 0 0; }
#login_register_msg, #encourage_vote_msg { line-height: 22px; font-weight: bold; color: @black; }
}
}
}
#sidebar {
#meta {
table {
margin: 0;
tr:last-child td { padding-bottom: 0; }
td {
padding: 0 0 5px;
ul.networks {
margin: 0; padding: 0;
li {
list-style: none; display: inline;
}
li {
}
}
}
td.label { color: @grey; white-space: nowrap; width: 1%; text-align: right; padding-right: 5px; }
}
}
}
/* Voting */
div.voted {
font-size: 12px; line-height: 22px; color: @black; display: inline-block; font-weight: bold;
img { float: left; margin-right: 5px; padding: 3px; .border_radius(3); }
}
#voted_up {
img { background: @colour_positive * 0.66 + @bg * 0.15; }
}
#voted_down {
img { background: @colour_negative * 0.66 + @bg * 0.15; }
}
#encourage_comment {
display: inline-block; line-height: 22px; font-weight: bold;
}
#vote {
overflow: hidden; font-size: 12px; line-height: 22px; color: @black; float: left;
a {
color: @white; font-weight: bold; overflow: hidden; display: block;
width: 16px; text-decoration: none; text-align: center; font-size: 10px; padding: 3px; text-transform: uppercase;
}
a.up {
float: left; background: @colour_positive * 0.66 + @bg * 0.15; .border_radius_left(3);
:hover { background: @colour_positive * 0.85 + @bg * 0.15; }
}
a.down {
float: left; background: @colour_negative * 0.66 + @bg * 0.15; .border_radius_right(3);
margin: 0 5px 0 1px;
:hover { background: @colour_negative * 0.85 + @bg * 0.15; }
}
}
#vote.disabled {
a.up {
background: (@colour_positive * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85;
:hover { background: (@colour_positive * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; }
}
a.down {
background: (@colour_negative * 0.66 + @bg * 0.15) * 0.15 + @grey * 0.85;
:hover { background: (@colour_negative * 0.85 + @bg * 0.15) * 0.25 + @grey * 0.75; }
}
}
#sidebar {
#ads > ul li, #recommendations > ul li {
width: 81px;
div.thumbnail {
a.thumbnail { height: 60px; width: 81px; }
}
div.text {
a.title { font-size: 11px; height: 14px; line-height: 14px; }
small { display: none; }
}
}
#brands > ul li {
width: 55px;
div.thumbnail {
a.thumbnail {
height: 45px; width: 45px;
img { max-height: 45px; max-width: 45px; }
}
}
div.text { display: none; }
}
}
/* My Account */
#accounts_controller {
#top {
#page_title {
#page_options {
a.button.public_profile {
float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 35px 8px 15px; position: relative;
b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; right: 15px; border: 6px solid transparent; border-right: none; border-left: 6px solid @white; margin: 0; }
}
a.button.goto_dashboard {
float: right; font-size: 16px; line-height: 1; height: auto; padding: 8px 15px 8px 35px; margin-right: 5px; position: relative;
b.arrow { display: block; height: 0; width: 0; position: absolute; top: 10px; left: 15px; border: 6px solid transparent; border-left: none; border-right: 6px solid @white; margin: 0; }
}
}
}
}
#account_nav {
float: left; width: 200px; margin: 0 20px 0 0;
ul.nav {
margin: 0; padding: 0;
li {
margin: 0 0 5px; display: block; list-style: none; padding: 0;
a {
display: block; height: 30px; text-decoration: none; color: @white;
b {
border: 15px solid transparent; border-right: none; border-left: 10px solid transparent; width: 0;
height: 0; float: right; display: none;
}
span {
.border_radius(3); background: @bg; display: block;
line-height: 30px; padding: 0 10px; font-size: 14px; font-weight: bold; margin: 0 10px 0 0;
}
}
:hover {
a {
color: @white;
b { border-left-color: @bg; display: block; }
span { background: @bg; .border_radius_right(0); }
}
}
}
li.current a {
b { border-left-color: @accent_colour; display: block; }
span { background: @accent_colour; color: @white; .border_radius_right(0); }
}
}
}
#main {
> div {
margin: 0 0 20px;
form { margin: 0; }
}
#profile {
a.avatar {
float: left; display: block;
width: 70px; overflow: hidden; position: relative; text-decoration: none;
img { width: 100%; }
span {
display: block; line-height: 1; padding: 3px; margin: 5px 0 0; color: @white; background: @accent_colour;
.border_radius(3); .text_shadow(1, 1, 0, @grey);
text-align: center; font-size: 10px; font-weight: bold; text-transform: uppercase;
}
}
form {
margin: 0 0 0 90px;
h4 { margin: 10px 0 20px; border-bottom: 1px solid (@light_grey * 0.5 + @white * 0.5); padding: 0; color: @bg; font-size: 16px; }
ul.choices {
li { width: 30%; }
}
div.extra { margin-top: 20px; }
}
}
#networks {
ul { margin: 0 -10px -10px 0; padding: 0; overflow: hidden;
li:hover
{
background: @light_grey; display: block; float: left; width: 180px;
padding: 10px; margin: 0 10px 10px 0; list-style: none; .border_radius(3);
position: relative;
* { line-height: normal; }
img { vertical-align: middle; float: left; }
.name { font-weight: bold; font-size: 14px; display: block; margin: -2px 0 0 42px; }
small {
font-size: 12px; color: @grey; display: block; margin-left: 42px;
strong { color: @black; font-weight: normal; }
}
:hover {
}
}
li.installed {
background: @white;
border: 2px solid @accent_colour; padding: 8px;
}
li.unavailable {
.name { color: @black; }
:hover {
background: @light_grey;
}
}
li:hover {
background: @light_grey * 0.5 + @white * 0.5;
}
}
}
}
}
/* Shopping Style Panel */
#shopping_style {
div.header a.button.small { float: right; }
div.content {
p {
margin: 0 0 10px;
label { text-transform: uppercase; font-size: 11px; display: block; color: @bg; font-weight: bold; }
span { color: @black; }
span.toggle { white-space: nowrap; color: @grey; }
:last-child { margin: 0; }
}
p.more { text-align: left; font-weight: normal; }
p.less { display: none; margin: 0; }
}
}
/* People Controller */
#people_controller.index {
#main {
div.panel {
float: left; width: 300px; margin: 0 20px 0 0;
:last-child { margin-right: 0; }
}
}
}
#people_controller.show {
#person_overview, #shopping_style {
a.button.small {
}
}
#content {
#shopping_style {
float: left; width: 240px; margin: 0 20px 0 0;
}
#main { width: 360px; }
}
}
/* Search Results */
#search_results {
margin: 0 0 20px;
li {
:hover {
small { color: @white * 0.75 + @accent_colour * 0.25; }
}
}
}
#search {
div.content {
padding: 20px;
form {
margin: 0; float: none;
span.submit_and_options {
display: block;
}
}
p { margin: 0 0 15px; }
h4 { font-weight: normal; margin: 0 0 5px; }
}
}
/* Recommendations */
#recommendations {
div.browse {
margin: 0; padding: 0; background: none;
ul { min-height: 0; .border_radius(0); }
}
}
/* Blank States */
div.blank {
padding: 20px; background: @bg * 0.05 + @blue * 0.05 + @white * 0.9; position: relative;
border: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); z-index: 1;
h4 { font-size: 18px; margin: 0 0 10px; }
h4:last-child { margin: 0; }
p { font-size: 16px; margin: 0 0 10px; }
p:last-child { margin: 0; }
p.with_list_number.large {
span { margin-left: 48px; display: block; color: @white; }
}
p.earn span { font-size: 22px; color: @white; line-height: 48px; font-weight: bold; }
a { white-space: nowrap; }
a.hide {
position: absolute; top: -5px; right: -5px; display: block; height: 16px; width: 16px; padding: 3px; background: #E7E9F6; .border_radius(99);
}
}
div.blank.small {
padding: 10px 20px;
h4 { font-weight: normal; font-size: 16px; }
p { margin: 0; }
}
div.blank.tiny {
padding: 10px 20px;
h4 { font-weight: normal; font-size: 14px; }
p { margin: 0; font-size: 12px; }
}
div.blank.rounded {
.border_radius(3); margin: 0 0 20px;
}
div.blank.rounded.bottom { .border_radius_top(0); }
div.blank.with_border_bottom { border-bottom: 1px solid (@bg * 0.1 + @blue * 0.1 + @white * 0.8); }
div.blank.no_border_top { border-top: none; }
div.blank.no_border_bottom { border-bottom: none; }
div.blank.no_side_borders { border-right: none; border-left: none; }
div.panel {
div.blank {
padding: 10px 20px; overflow: hidden; margin: 0;
h4 { font-weight: normal; font-size: 14px; }
p, ul { margin: 0 0 10px; font-size: 12px; }
p:last-child, ul:last-child { margin: 0; }
}
}
#yelow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
}
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
#grey {
color: rgb(200, 200, 200);
}
#808080 {
color: hsl(50, 0%, 50%);
}
#00ff00 {
color: hsl(120, 100%, 50%);
}
/******************\
* *
* Comment Header *
* *
\******************/
/*
Comment
*/
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
////////////////
@var: "content";
////////////////
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
/* lost comment */ content: @var;
border: 1px solid black;
// padding & margin //
padding: 0;
margin: 2em;
} //
/* commented out
#more-comments {
color: grey;
}
*/
#last { color: blue }
//
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
form[data-disabled] {
color: black;
}
p::before {
color: black;
}
@charset "utf-8";
div { color: black; }
div { width: 99%; }
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
font-size: 3em;
}
@media screen {
font-size: 10px;
}
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
color: #999;
}
p, p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}
#functions {
@var: 10;
color: color("evil red"); // #660000
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
variable: increment(@var);
}
#built-in {
@r: 32;
escaped: e("-Some::weird(#thing, y)");
lighten: lighten(#ff0000, 50%);
darken: darken(#ff0000, 50%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
format: %("rgb(%d, %d, %d)", @r, 128, 64);
format-string: %("hello %s", "world");
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
}
@var: @a;
@a: 100%;
.lazy-eval {
width: @var;
}
.mixin (@a: 1px, @b: 50%) {
width: @a * 5;
height: @b - 1%;
}
.mixina (@style, @width, @color: black) {
border: @width @style @color;
}
.mixiny
(@a: 0, @b: 0) {
margin: @a;
padding: @b;
}
.hidden() {
color: transparent;
}
.two-args {
color: blue;
.mixin(2px, 100%);
.mixina(dotted, 2px);
}
.one-arg {
.mixin(3px);
}
.no-parens {
.mixin;
}
.no-args {
.mixin();
}
.var-args {
@var: 9;
.mixin(@var, @var * 2);
}
.multi-mix {
.mixin(2px, 30%);
.mixiny(4, 5);
}
.maxa(@arg1: 10, @arg2: #f00) {
padding: @arg1 * 2px;
color: @arg2;
}
body {
.maxa(15);
}
@glob: 5;
.global-mixin(@a:2) {
width: @glob + @a;
}
.scope-mix {
.global-mixin(3);
}
.nested-ruleset (@width: 200px) {
width: @width;
.column { margin: @width; }
}
.content {
.nested-ruleset(600px);
}
//
.same-var-name2(@radius) {
radius: @radius;
}
.same-var-name(@radius) {
.same-var-name2(@radius);
}
#same-var-name {
.same-var-name(5px);
}
//
.var-inside () {
@var: 10px;
width: @var;
}
#var-inside { .var-inside; }
.mix-inner (@var) {
border-width: @var;
}
.mix (@a: 10) {
.inner {
height: @a * 10;
.innest {
width: @a;
.mix-inner(@a * 2);
}
}
}
.class {
.mix(30);
}
.mixin () {
zero: 0;
}
.mixin (@a: 1px) {
one: 1;
}
.mixin (@a) {
one-req: 1;
}
.mixin (@a: 1px, @b: 2px) {
two: 2;
}
.mixin (@a, @b, @c) {
three-req: 3;
}
.mixin (@a: 1px, @b: 2px, @c: 3px) {
three: 3;
}
.zero {
.mixin();
}
.one {
.mixin(1);
}
.two {
.mixin(1, 2);
}
.three {
.mixin(1, 2, 3);
}
//
.mixout ('left') {
left: 1;
}
.mixout ('right') {
right: 1;
}
.left {
.mixout('left');
}
.right {
.mixout('right');
}
//
.border (@side, @width) {
color: black;
.border-side(@side, @width);
}
.border-side (left, @w) {
border-left: @w;
}
.border-side (right, @w) {
border-right: @w;
}
.border-right {
.border(right, 4px);
}
.border-left {
.border(left, 4px);
}
//
.border-radius (@r) {
both: @r * 10;
}
.border-radius (@r, left) {
left: @r;
}
.border-radius (@r, right) {
right: @r;
}
.only-right {
.border-radius(33, right);
}
.only-left {
.border-radius(33, left);
}
.left-right {
.border-radius(33);
}
.mixin { border: 1px solid black; }
.mixout { border-color: orange; }
.borders { border-style: dashed; }
#namespace {
.borders {
border-style: dotted;
}
.biohazard {
content: "death";
.man {
color: transparent;
}
}
}
#theme {
> .mixin {
background-color: grey;
}
}
#container {
color: black;
.mixin;
.mixout;
#theme > .mixin;
}
#header {
.milk {
color: white;
.mixin;
#theme > .mixin;
}
#cookie {
.chips {
#namespace .borders;
.calories {
#container;
}
}
.borders;
}
}
.secure-zone { #namespace .biohazard .man; }
.direct {
#namespace > .borders;
}
#operations {
color: #110000 + #000011 + #001100; // #111111
height: 10px / 2px + 6px - 1px * 2; // 9px
width: 2 * 4 - 5em; // 3em
.spacing {
height: 10px / 2px+6px-1px*2;
width: 2 * 4-5em;
}
substraction: 20 - 10 - 5 - 5; // 0
division: 20 / 5 / 4; // 1
}
@x: 4;
@y: 12em;
.with-variables {
height: @x + @y; // 16em
width: 12 + @y; // 24em
size: 5cm - @x; // 1cm
}
@z: -2;
.negative {
height: 2px + @z; // 0px
width: 2px - @z; // 4px
}
.shorthands {
padding: -1px 2px 0 -4px; //
}
.colors {
color: #123; // #112233
border-color: #234 + #111111; // #334455
background-color: #222222 - #fff; // #000000
.other {
color: 2 * #111; // #222222
border-color: #333333 / 3 + #111; // #222222
}
}
.parens {
@var: 1px;
border: (@var * 2) solid black;
margin: (@var * 1) (@var + 2) (4 * 4) 3;
width: (6 * 6);
padding: 2px (6px * 6px);
}
.more-parens {
@var: (2 * 2);
padding: (2 * @var) 4 4 (@var * 1px);
width: (@var * @var) * 6;
height: (7 * 7) + (8 * 8);
margin: 4 * (5 + 5) / 2 - (@var * 2);
//margin: (6 * 6)px;
}
.nested-parens {
width: 2 * (4 * (2 + (1 + 6))) - 1;
height: ((2+3)*(2+3) / (9-4)) + 1;
}
.mixed-units {
margin: 2px 4em 1 5pc;
padding: (2px + 4px) 1em 2px 2;
}
#first > .one {
> #second .two > #deux {
width: 50%;
#third {
&:focus {
color: black;
#fifth {
> #sixth {
.seventh #eighth {
+ #ninth {
color: purple;
}
}
}
}
}
height: 100%;
}
#fourth, #five, #six {
color: #110000;
.seven, .eight > #nine {
border: 1px solid black;
}
#ten {
color: red;
}
}
}
font-size: 2em;
}
@x: blue;
@z: transparent;
@mix: none;
.mixin {
@mix: #989;
}
.tiny-scope {
color: @mix; // #989
.mixin;
}
.scope1 {
@y: orange;
@z: black;
color: @x; // blue
border-color: @z; // black
.hidden {
@x: #131313;
}
.scope2 {
@y: red;
color: @x; // blue
.scope3 {
@local: white;
color: @y; // red
border-color: @z; // black
background-color: @local; // white
}
}
}h1, h2, h3 {
a, p {
&:hover {
color: red;
}
}
}
#all { color: blue; }
#the { color: blue; }
#same { color: blue; }
ul, li, div, q, blockquote, textarea {
margin: 0;
}
td {
margin: 0;
padding: 0;
}
td, input {
line-height: 1em;
}
#strings {
background-image: url("http://son-of-a-banana.com");
quotes: "~" "~";
content: "#*%:&^,)!.(~*})";
empty: "";
brackets: "{" "}";
}
#comments {
content: "/* hello */ // not-so-secret";
}
#single-quote {
quotes: "'" "'";
content: '""#!&""';
empty: '';
}
@a: 2;
@x: @a * @a;
@y: @x + 1;
@z: @x * 2 + @y;
.variables {
width: @z + 1cm; // 14cm
}
@b: @a * 10;
@c: #888;
@fonts: "Trebuchet MS", Verdana, sans-serif;
@f: @fonts;
@quotes: "~" "~";
@q: @quotes;
.variables {
height: @b + @x + 0px; // 24px
color: @c;
font-family: @f;
quotes: @q;
}
.redefinition {
@var: 4;
@var: 2;
@var: 3;
three: @var;
}
.values {
@a: 'Trebuchet';
font-family: @a, @a, @a;
}
.whitespace
{ color: white; }
.whitespace
{
color: white;
}
.whitespace
{ color: white; }
.whitespace{color:white;}
.whitespace { color : white ; }
.white,
.space,
.mania
{ color: white; }
.no-semi-column { color: white }
.no-semi-column {
color: white;
white-space: pre
}
.no-semi-column {border: 2px solid white}
.newlines {
background: the,
great,
wall;
border: 2px
solid
black;
}
.empty {
}
#yelow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
}
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
#grey {
color: rgb(200, 200, 200);
}
#808080 {
color: hsl(50, 0%, 50%);
}
#00ff00 {
color: hsl(120, 100%, 50%);
}
/******************\
* *
* Comment Header *
* *
\******************/
/*
Comment
*/
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
////////////////
@var: "content";
////////////////
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
/* lost comment */ content: @var;
border: 1px solid black;
// padding & margin //
padding: 0;
margin: 2em;
} //
/* commented out
#more-comments {
color: grey;
}
*/
#last { color: blue }
//
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
form[data-disabled] {
color: black;
}
p::before {
color: black;
}
@charset "utf-8";
div { color: black; }
div { width: 99%; }
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
font-size: 3em;
}
@media screen {
font-size: 10px;
}
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
color: #999;
}
p, p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}
#functions {
@var: 10;
color: color("evil red"); // #660000
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
variable: increment(@var);
}
#built-in {
@r: 32;
escaped: e("-Some::weird(#thing, y)");
lighten: lighten(#ff0000, 50%);
darken: darken(#ff0000, 50%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
format: %("rgb(%d, %d, %d)", @r, 128, 64);
format-string: %("hello %s", "world");
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
}
@var: @a;
@a: 100%;
.lazy-eval {
width: @var;
}
.mixin (@a: 1px, @b: 50%) {
width: @a * 5;
height: @b - 1%;
}
.mixina (@style, @width, @color: black) {
border: @width @style @color;
}
.mixiny
(@a: 0, @b: 0) {
margin: @a;
padding: @b;
}
.hidden() {
color: transparent;
}
.two-args {
color: blue;
.mixin(2px, 100%);
.mixina(dotted, 2px);
}
.one-arg {
.mixin(3px);
}
.no-parens {
.mixin;
}
.no-args {
.mixin();
}
.var-args {
@var: 9;
.mixin(@var, @var * 2);
}
.multi-mix {
.mixin(2px, 30%);
.mixiny(4, 5);
}
.maxa(@arg1: 10, @arg2: #f00) {
padding: @arg1 * 2px;
color: @arg2;
}
body {
.maxa(15);
}
@glob: 5;
.global-mixin(@a:2) {
width: @glob + @a;
}
.scope-mix {
.global-mixin(3);
}
.nested-ruleset (@width: 200px) {
width: @width;
.column { margin: @width; }
}
.content {
.nested-ruleset(600px);
}
//
.same-var-name2(@radius) {
radius: @radius;
}
.same-var-name(@radius) {
.same-var-name2(@radius);
}
#same-var-name {
.same-var-name(5px);
}
//
.var-inside () {
@var: 10px;
width: @var;
}
#var-inside { .var-inside; }
.mix-inner (@var) {
border-width: @var;
}
.mix (@a: 10) {
.inner {
height: @a * 10;
.innest {
width: @a;
.mix-inner(@a * 2);
}
}
}
.class {
.mix(30);
}
.mixin () {
zero: 0;
}
.mixin (@a: 1px) {
one: 1;
}
.mixin (@a) {
one-req: 1;
}
.mixin (@a: 1px, @b: 2px) {
two: 2;
}
.mixin (@a, @b, @c) {
three-req: 3;
}
.mixin (@a: 1px, @b: 2px, @c: 3px) {
three: 3;
}
.zero {
.mixin();
}
.one {
.mixin(1);
}
.two {
.mixin(1, 2);
}
.three {
.mixin(1, 2, 3);
}
//
.mixout ('left') {
left: 1;
}
.mixout ('right') {
right: 1;
}
.left {
.mixout('left');
}
.right {
.mixout('right');
}
//
.border (@side, @width) {
color: black;
.border-side(@side, @width);
}
.border-side (left, @w) {
border-left: @w;
}
.border-side (right, @w) {
border-right: @w;
}
.border-right {
.border(right, 4px);
}
.border-left {
.border(left, 4px);
}
//
.border-radius (@r) {
both: @r * 10;
}
.border-radius (@r, left) {
left: @r;
}
.border-radius (@r, right) {
right: @r;
}
.only-right {
.border-radius(33, right);
}
.only-left {
.border-radius(33, left);
}
.left-right {
.border-radius(33);
}
.mixin { border: 1px solid black; }
.mixout { border-color: orange; }
.borders { border-style: dashed; }
#namespace {
.borders {
border-style: dotted;
}
.biohazard {
content: "death";
.man {
color: transparent;
}
}
}
#theme {
> .mixin {
background-color: grey;
}
}
#container {
color: black;
.mixin;
.mixout;
#theme > .mixin;
}
#header {
.milk {
color: white;
.mixin;
#theme > .mixin;
}
#cookie {
.chips {
#namespace .borders;
.calories {
#container;
}
}
.borders;
}
}
.secure-zone { #namespace .biohazard .man; }
.direct {
#namespace > .borders;
}
#operations {
color: #110000 + #000011 + #001100; // #111111
height: 10px / 2px + 6px - 1px * 2; // 9px
width: 2 * 4 - 5em; // 3em
.spacing {
height: 10px / 2px+6px-1px*2;
width: 2 * 4-5em;
}
substraction: 20 - 10 - 5 - 5; // 0
division: 20 / 5 / 4; // 1
}
@x: 4;
@y: 12em;
.with-variables {
height: @x + @y; // 16em
width: 12 + @y; // 24em
size: 5cm - @x; // 1cm
}
@z: -2;
.negative {
height: 2px + @z; // 0px
width: 2px - @z; // 4px
}
.shorthands {
padding: -1px 2px 0 -4px; //
}
.colors {
color: #123; // #112233
border-color: #234 + #111111; // #334455
background-color: #222222 - #fff; // #000000
.other {
color: 2 * #111; // #222222
border-color: #333333 / 3 + #111; // #222222
}
}
.parens {
@var: 1px;
border: (@var * 2) solid black;
margin: (@var * 1) (@var + 2) (4 * 4) 3;
width: (6 * 6);
padding: 2px (6px * 6px);
}
.more-parens {
@var: (2 * 2);
padding: (2 * @var) 4 4 (@var * 1px);
width: (@var * @var) * 6;
height: (7 * 7) + (8 * 8);
margin: 4 * (5 + 5) / 2 - (@var * 2);
//margin: (6 * 6)px;
}
.nested-parens {
width: 2 * (4 * (2 + (1 + 6))) - 1;
height: ((2+3)*(2+3) / (9-4)) + 1;
}
.mixed-units {
margin: 2px 4em 1 5pc;
padding: (2px + 4px) 1em 2px 2;
}
#first > .one {
> #second .two > #deux {
width: 50%;
#third {
&:focus {
color: black;
#fifth {
> #sixth {
.seventh #eighth {
+ #ninth {
color: purple;
}
}
}
}
}
height: 100%;
}
#fourth, #five, #six {
color: #110000;
.seven, .eight > #nine {
border: 1px solid black;
}
#ten {
color: red;
}
}
}
font-size: 2em;
}
@x: blue;
@z: transparent;
@mix: none;
.mixin {
@mix: #989;
}
.tiny-scope {
color: @mix; // #989
.mixin;
}
.scope1 {
@y: orange;
@z: black;
color: @x; // blue
border-color: @z; // black
.hidden {
@x: #131313;
}
.scope2 {
@y: red;
color: @x; // blue
.scope3 {
@local: white;
color: @y; // red
border-color: @z; // black
background-color: @local; // white
}
}
}h1, h2, h3 {
a, p {
&:hover {
color: red;
}
}
}
#all { color: blue; }
#the { color: blue; }
#same { color: blue; }
ul, li, div, q, blockquote, textarea {
margin: 0;
}
td {
margin: 0;
padding: 0;
}
td, input {
line-height: 1em;
}
#strings {
background-image: url("http://son-of-a-banana.com");
quotes: "~" "~";
content: "#*%:&^,)!.(~*})";
empty: "";
brackets: "{" "}";
}
#comments {
content: "/* hello */ // not-so-secret";
}
#single-quote {
quotes: "'" "'";
content: '""#!&""';
empty: '';
}
@a: 2;
@x: @a * @a;
@y: @x + 1;
@z: @x * 2 + @y;
.variables {
width: @z + 1cm; // 14cm
}
@b: @a * 10;
@c: #888;
@fonts: "Trebuchet MS", Verdana, sans-serif;
@f: @fonts;
@quotes: "~" "~";
@q: @quotes;
.variables {
height: @b + @x + 0px; // 24px
color: @c;
font-family: @f;
quotes: @q;
}
.redefinition {
@var: 4;
@var: 2;
@var: 3;
three: @var;
}
.values {
@a: 'Trebuchet';
font-family: @a, @a, @a;
}
.whitespace
{ color: white; }
.whitespace
{
color: white;
}
.whitespace
{ color: white; }
.whitespace{color:white;}
.whitespace { color : white ; }
.white,
.space,
.mania
{ color: white; }
.no-semi-column { color: white }
.no-semi-column {
color: white;
white-space: pre
}
.no-semi-column {border: 2px solid white}
.newlines {
background: the,
great,
wall;
border: 2px
solid
black;
}
.empty {
}
#yelow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
}
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
#grey {
color: rgb(200, 200, 200);
}
#808080 {
color: hsl(50, 0%, 50%);
}
#00ff00 {
color: hsl(120, 100%, 50%);
}
/******************\
* *
* Comment Header *
* *
\******************/
/*
Comment
*/
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
////////////////
@var: "content";
////////////////
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
/* lost comment */ content: @var;
border: 1px solid black;
// padding & margin //
padding: 0;
margin: 2em;
} //
/* commented out
#more-comments {
color: grey;
}
*/
#last { color: blue }
//
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
form[data-disabled] {
color: black;
}
p::before {
color: black;
}
@charset "utf-8";
div { color: black; }
div { width: 99%; }
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
font-size: 3em;
}
@media screen {
font-size: 10px;
}
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
color: #999;
}
p, p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}
#functions {
@var: 10;
color: color("evil red"); // #660000
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
variable: increment(@var);
}
#built-in {
@r: 32;
escaped: e("-Some::weird(#thing, y)");
lighten: lighten(#ff0000, 50%);
darken: darken(#ff0000, 50%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
format: %("rgb(%d, %d, %d)", @r, 128, 64);
format-string: %("hello %s", "world");
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
}
@var: @a;
@a: 100%;
.lazy-eval {
width: @var;
}
.mixin (@a: 1px, @b: 50%) {
width: @a * 5;
height: @b - 1%;
}
.mixina (@style, @width, @color: black) {
border: @width @style @color;
}
.mixiny
(@a: 0, @b: 0) {
margin: @a;
padding: @b;
}
.hidden() {
color: transparent;
}
.two-args {
color: blue;
.mixin(2px, 100%);
.mixina(dotted, 2px);
}
.one-arg {
.mixin(3px);
}
.no-parens {
.mixin;
}
.no-args {
.mixin();
}
.var-args {
@var: 9;
.mixin(@var, @var * 2);
}
.multi-mix {
.mixin(2px, 30%);
.mixiny(4, 5);
}
.maxa(@arg1: 10, @arg2: #f00) {
padding: @arg1 * 2px;
color: @arg2;
}
body {
.maxa(15);
}
@glob: 5;
.global-mixin(@a:2) {
width: @glob + @a;
}
.scope-mix {
.global-mixin(3);
}
.nested-ruleset (@width: 200px) {
width: @width;
.column { margin: @width; }
}
.content {
.nested-ruleset(600px);
}
//
.same-var-name2(@radius) {
radius: @radius;
}
.same-var-name(@radius) {
.same-var-name2(@radius);
}
#same-var-name {
.same-var-name(5px);
}
//
.var-inside () {
@var: 10px;
width: @var;
}
#var-inside { .var-inside; }
.mix-inner (@var) {
border-width: @var;
}
.mix (@a: 10) {
.inner {
height: @a * 10;
.innest {
width: @a;
.mix-inner(@a * 2);
}
}
}
.class {
.mix(30);
}
.mixin () {
zero: 0;
}
.mixin (@a: 1px) {
one: 1;
}
.mixin (@a) {
one-req: 1;
}
.mixin (@a: 1px, @b: 2px) {
two: 2;
}
.mixin (@a, @b, @c) {
three-req: 3;
}
.mixin (@a: 1px, @b: 2px, @c: 3px) {
three: 3;
}
.zero {
.mixin();
}
.one {
.mixin(1);
}
.two {
.mixin(1, 2);
}
.three {
.mixin(1, 2, 3);
}
//
.mixout ('left') {
left: 1;
}
less.js-1.4.2/benchmark/less-benchmark.js 0000664 0000000 0000000 00000002360 12172566422 0020275 0 ustar 00root root 0000000 0000000 var path = require('path'),
fs = require('fs'),
sys = require('util');
var less = require('../lib/less');
var file = path.join(__dirname, 'benchmark.less');
if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) }
fs.readFile(file, 'utf8', function (e, data) {
var tree, css, start, end, total;
sys.puts("Benchmarking...\n", path.basename(file) + " (" +
parseInt(data.length / 1024) + " KB)", "");
start = new(Date);
new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) {
end = new(Date);
total = end - start;
sys.puts("Parsing: " +
total + " ms (" +
parseInt(1000 / total *
data.length / 1024) + " KB\/s)");
start = new(Date);
css = tree.toCSS();
end = new(Date);
sys.puts("Generation: " + (end - start) + " ms (" +
parseInt(1000 / (end - start) *
data.length / 1024) + " KB\/s)");
total += end - start;
sys.puts("Total: " + total + "ms (" +
parseInt(1000 / total * data.length / 1024) + " KB/s)");
if (err) {
less.writeError(err);
process.exit(3);
}
});
});
less.js-1.4.2/bin/ 0000775 0000000 0000000 00000000000 12172566422 0013656 5 ustar 00root root 0000000 0000000 less.js-1.4.2/bin/lessc 0000775 0000000 0000000 00000016332 12172566422 0014722 0 ustar 00root root 0000000 0000000 #!/usr/bin/env node
var path = require('path'),
fs = require('fs'),
sys = require('util'),
os = require('os'),
mkdirp;
var less = require('../lib/less');
var args = process.argv.slice(1);
var options = {
depends: false,
compress: false,
yuicompress: false,
max_line_len: -1,
optimization: 1,
silent: false,
verbose: false,
lint: false,
paths: [],
color: true,
strictImports: false,
rootpath: '',
relativeUrls: false,
ieCompat: true,
strictMath: false,
strictUnits: false
};
var continueProcessing = true,
currentErrorcode;
// calling process.exit does not flush stdout always
// so use this to set the exit code
process.on('exit', function() { process.reallyExit(currentErrorcode) });
var checkArgFunc = function(arg, option) {
if (!option) {
sys.puts(arg + " option requires a parameter");
continueProcessing = false;
return false;
}
return true;
};
var checkBooleanArg = function(arg) {
var onOff = /^((on|t|true|y|yes)|(off|f|false|n|no))$/i.exec(arg);
if (!onOff) {
sys.puts(" unable to parse "+arg+" as a boolean. use one of on/t/true/y/yes/off/f/false/n/no");
continueProcessing = false;
return false;
}
return Boolean(onOff[2]);
};
args = args.filter(function (arg) {
var match;
if (match = arg.match(/^-I(.+)$/)) {
options.paths.push(match[1]);
return false;
}
if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]*))?$/i)) { arg = match[1] }
else { return arg }
switch (arg) {
case 'v':
case 'version':
sys.puts("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]");
continueProcessing = false;
case 'verbose':
options.verbose = true;
break;
case 's':
case 'silent':
options.silent = true;
break;
case 'l':
case 'lint':
options.lint = true;
break;
case 'strict-imports':
options.strictImports = true;
break;
case 'h':
case 'help':
require('../lib/less/lessc_helper').printUsage();
continueProcessing = false;
case 'x':
case 'compress':
options.compress = true;
break;
case 'M':
case 'depends':
options.depends = true;
break;
case 'yui-compress':
options.yuicompress = true;
break;
case 'max-line-len':
if (checkArgFunc(arg, match[2])) {
options.maxLineLen = parseInt(match[2], 10);
if (options.maxLineLen <= 0) {
options.maxLineLen = -1;
}
}
break;
case 'no-color':
options.color = false;
break;
case 'no-ie-compat':
options.ieCompat = false;
break;
case 'include-path':
if (checkArgFunc(arg, match[2])) {
options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
.map(function(p) {
if (p) {
return path.resolve(process.cwd(), p);
}
});
}
break;
case 'O0': options.optimization = 0; break;
case 'O1': options.optimization = 1; break;
case 'O2': options.optimization = 2; break;
case 'line-numbers':
if (checkArgFunc(arg, match[2])) {
options.dumpLineNumbers = match[2];
}
break;
case 'rp':
case 'rootpath':
if (checkArgFunc(arg, match[2])) {
options.rootpath = match[2].replace(/\\/g, '/');
}
break;
case "ru":
case "relative-urls":
options.relativeUrls = true;
break;
case "sm":
case "strict-math":
if (checkArgFunc(arg, match[2])) {
options.strictMath = checkBooleanArg(match[2]);
}
break;
case "su":
case "strict-units":
if (checkArgFunc(arg, match[2])) {
options.strictUnits = checkBooleanArg(match[2]);
}
break;
}
});
if (!continueProcessing) {
return;
}
var input = args[1];
var inputbase = args[1];
if (input && input != '-') {
input = path.resolve(process.cwd(), input);
}
var output = args[2];
var outputbase = args[2];
if (output) {
output = path.resolve(process.cwd(), output);
}
if (! input) {
sys.puts("lessc: no input files");
sys.puts("");
require('../lib/less/lessc_helper').printUsage();
currentErrorcode = 1;
return;
}
var ensureDirectory = function (filepath) {
var dir = path.dirname(filepath),
cmd,
existsSync = fs.existsSync || path.existsSync;
if (!existsSync(dir)) {
if (mkdirp === undefined) {
try {mkdirp = require('mkdirp');}
catch(e) { mkdirp = null; }
}
cmd = mkdirp && mkdirp.sync || fs.mkdirSync;
cmd(dir);
}
};
if (options.depends) {
if (!outputbase) {
sys.print("option --depends requires an output path to be specified");
return;
}
sys.print(outputbase + ": ");
}
var parseLessFile = function (e, data) {
if (e) {
sys.puts("lessc: " + e.message);
currentErrorcode = 1;
return;
}
options.paths = [path.dirname(input)].concat(options.paths);
options.filename = input;
var parser = new(less.Parser)(options);
parser.parse(data, function (err, tree) {
if (err) {
less.writeError(err, options);
currentErrorcode = 1;
return;
} else if (options.depends) {
for(var file in parser.imports.files) {
sys.print(file + " ")
}
sys.print("\n");
} else if(!options.lint) {
try {
var css = tree.toCSS({
silent: options.silent,
verbose: options.verbose,
ieCompat: options.ieCompat,
compress: options.compress,
yuicompress: options.yuicompress,
maxLineLen: options.maxLineLen,
strictMath: options.strictMath,
strictUnits: options.strictUnits
});
if (output) {
ensureDirectory(output);
fs.writeFileSync(output, css, 'utf8');
if (options.verbose) {
console.log('lessc: wrote ' + output);
}
} else {
sys.print(css);
}
} catch (e) {
less.writeError(e, options);
currentErrorcode = 2;
return;
}
}
});
};
if (input != '-') {
fs.readFile(input, 'utf8', parseLessFile);
} else {
process.stdin.resume();
process.stdin.setEncoding('utf8');
var buffer = '';
process.stdin.on('data', function(data) {
buffer += data;
});
process.stdin.on('end', function() {
parseLessFile(false, buffer);
});
}
less.js-1.4.2/build/ 0000775 0000000 0000000 00000000000 12172566422 0014205 5 ustar 00root root 0000000 0000000 less.js-1.4.2/build/amd.js 0000664 0000000 0000000 00000000215 12172566422 0015302 0 ustar 00root root 0000000 0000000 // amd.js
//
// Define Less as an AMD module.
if (typeof define === "function" && define.amd) {
define(function () { return less; } );
}
less.js-1.4.2/build/header.js 0000664 0000000 0000000 00000000243 12172566422 0015772 0 ustar 00root root 0000000 0000000 /*
* LESS - Leaner CSS v@VERSION
* http://lesscss.org
*
* Copyright (c) 2009-2013, Alexis Sellier
* Licensed under the Apache 2.0 License.
*
* @licence
*/
less.js-1.4.2/build/require-rhino.js 0000664 0000000 0000000 00000000145 12172566422 0017334 0 ustar 00root root 0000000 0000000 //
// Stub out `require` in rhino
//
function require(arg) {
return less[arg.split('/')[1]];
};
less.js-1.4.2/build/require.js 0000664 0000000 0000000 00000000162 12172566422 0016216 0 ustar 00root root 0000000 0000000 //
// Stub out `require` in the browser
//
function require(arg) {
return window.less[arg.split('/')[1]];
};
less.js-1.4.2/dist/ 0000775 0000000 0000000 00000000000 12172566422 0014051 5 ustar 00root root 0000000 0000000 less.js-1.4.2/dist/less-1.1.0.js 0000664 0000000 0000000 00000260517 12172566422 0016023 0 ustar 00root root 0000000 0000000 //
// LESS - Leaner CSS v1.1.0
// http://lesscss.org
//
// Copyright (c) 2009-2011, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
(function (window, undefined) {
//
// Stub out `require` in the browser
//
function require(arg) {
return window.less[arg.split('/')[1]];
};
// ecma-5.js
//
// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
// -- tlrobinson Tom Robinson
// dantman Daniel Friesen
//
// Array
//
if (!Array.isArray) {
Array.isArray = function(obj) {
return Object.prototype.toString.call(obj) === "[object Array]" ||
(obj instanceof Array);
};
}
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(block, thisObject) {
var len = this.length >>> 0;
for (var i = 0; i < len; i++) {
if (i in this) {
block.call(thisObject, this[i], i, this);
}
}
};
}
if (!Array.prototype.map) {
Array.prototype.map = function(fun /*, thisp*/) {
var len = this.length >>> 0;
var res = new Array(len);
var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in this) {
res[i] = fun.call(thisp, this[i], i, this);
}
}
return res;
};
}
if (!Array.prototype.filter) {
Array.prototype.filter = function (block /*, thisp */) {
var values = [];
var thisp = arguments[1];
for (var i = 0; i < this.length; i++) {
if (block.call(thisp, this[i])) {
values.push(this[i]);
}
}
return values;
};
}
if (!Array.prototype.reduce) {
Array.prototype.reduce = function(fun /*, initial*/) {
var len = this.length >>> 0;
var i = 0;
// no value to return if no initial value and an empty array
if (len === 0 && arguments.length === 1) throw new TypeError();
if (arguments.length >= 2) {
var rv = arguments[1];
} else {
do {
if (i in this) {
rv = this[i++];
break;
}
// if array contains no values, no initial value to return
if (++i >= len) throw new TypeError();
} while (true);
}
for (; i < len; i++) {
if (i in this) {
rv = fun.call(null, rv, this[i], i, this);
}
}
return rv;
};
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (value /*, fromIndex */ ) {
var length = this.length;
var i = arguments[1] || 0;
if (!length) return -1;
if (i >= length) return -1;
if (i < 0) i += length;
for (; i < length; i++) {
if (!Object.prototype.hasOwnProperty.call(this, i)) { continue }
if (value === this[i]) return i;
}
return -1;
};
}
//
// Object
//
if (!Object.keys) {
Object.keys = function (object) {
var keys = [];
for (var name in object) {
if (Object.prototype.hasOwnProperty.call(object, name)) {
keys.push(name);
}
}
return keys;
};
}
//
// String
//
if (!String.prototype.trim) {
String.prototype.trim = function () {
return String(this).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
};
}
var less, tree;
if (typeof(window) === 'undefined') {
less = exports,
tree = require('less/tree');
} else {
if (typeof(window.less) === 'undefined') { window.less = {} }
less = window.less,
tree = window.less.tree = {};
}
//
// less.js - parser
//
// A relatively straight-forward predictive parser.
// There is no tokenization/lexing stage, the input is parsed
// in one sweep.
//
// To make the parser fast enough to run in the browser, several
// optimization had to be made:
//
// - Matching and slicing on a huge input is often cause of slowdowns.
// The solution is to chunkify the input into smaller strings.
// The chunks are stored in the `chunks` var,
// `j` holds the current chunk index, and `current` holds
// the index of the current chunk in relation to `input`.
// This gives us an almost 4x speed-up.
//
// - In many cases, we don't need to match individual tokens;
// for example, if a value doesn't hold any variables, operations
// or dynamic references, the parser can effectively 'skip' it,
// treating it as a literal.
// An example would be '1px solid #000' - which evaluates to itself,
// we don't need to know what the individual components are.
// The drawback, of course is that you don't get the benefits of
// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
// and a smaller speed-up in the code-gen.
//
//
// Token matching is done with the `$` function, which either takes
// a terminal string or regexp, or a non-terminal function to call.
// It also takes care of moving all the indices forwards.
//
//
less.Parser = function Parser(env) {
var input, // LeSS input string
i, // current index in `input`
j, // current chunk
temp, // temporarily holds a chunk's state, for backtracking
memo, // temporarily holds `i`, when backtracking
furthest, // furthest index the parser has gone to
chunks, // chunkified input
current, // index of current chunk, in `input`
parser;
var that = this;
// This function is called after all files
// have been imported through `@import`.
var finish = function () {};
var imports = this.imports = {
paths: env && env.paths || [], // Search paths, when importing
queue: [], // Files which haven't been imported yet
files: {}, // Holds the imported parse trees
mime: env && env.mime, // MIME type of .less files
push: function (path, callback) {
var that = this;
this.queue.push(path);
//
// Import a file asynchronously
//
less.Parser.importer(path, this.paths, function (root) {
that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
that.files[path] = root; // Store the root
callback(root);
if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing
}, env);
}
};
function save() { temp = chunks[j], memo = i, current = i }
function restore() { chunks[j] = temp, i = memo, current = i }
function sync() {
if (i > current) {
chunks[j] = chunks[j].slice(i - current);
current = i;
}
}
//
// Parse from a token, regexp or string, and move forward if match
//
function $(tok) {
var match, args, length, c, index, endIndex, k, mem;
//
// Non-terminal
//
if (tok instanceof Function) {
return tok.call(parser.parsers);
//
// Terminal
//
// Either match a single character in the input,
// or match a regexp in the current chunk (chunk[j]).
//
} else if (typeof(tok) === 'string') {
match = input.charAt(i) === tok ? tok : null;
length = 1;
sync ();
} else {
sync ();
if (match = tok.exec(chunks[j])) {
length = match[0].length;
} else {
return null;
}
}
// The match is confirmed, add the match length to `i`,
// and consume any extra white-space characters (' ' || '\n')
// which come after that. The reason for this is that LeSS's
// grammar is mostly white-space insensitive.
//
if (match) {
mem = i += length;
endIndex = i + chunks[j].length - length;
while (i < endIndex) {
c = input.charCodeAt(i);
if (! (c === 32 || c === 10 || c === 9)) { break }
i++;
}
chunks[j] = chunks[j].slice(length + (i - mem));
current = i;
if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
if(typeof(match) === 'string') {
return match;
} else {
return match.length === 1 ? match[0] : match;
}
}
}
// Same as $(), but don't change the state of the parser,
// just return the match.
function peek(tok) {
if (typeof(tok) === 'string') {
return input.charAt(i) === tok;
} else {
if (tok.test(chunks[j])) {
return true;
} else {
return false;
}
}
}
this.env = env = env || {};
// The optimization level dictates the thoroughness of the parser,
// the lower the number, the less nodes it will create in the tree.
// This could matter for debugging, or if you want to access
// the individual nodes in the tree.
this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
this.env.filename = this.env.filename || null;
//
// The Parser
//
return parser = {
imports: imports,
//
// Parse an input string into an abstract syntax tree,
// call `callback` when done.
//
parse: function (str, callback) {
var root, start, end, zone, line, lines, buff = [], c, error = null;
i = j = current = furthest = 0;
chunks = [];
input = str.replace(/\r\n/g, '\n');
// Split the input into chunks.
chunks = (function (chunks) {
var j = 0,
skip = /[^"'`\{\}\/\(\)]+/g,
comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
level = 0,
match,
chunk = chunks[0],
inParam,
inString;
for (var i = 0, c, cc; i < input.length; i++) {
skip.lastIndex = i;
if (match = skip.exec(input)) {
if (match.index === i) {
i += match[0].length;
chunk.push(match[0]);
}
}
c = input.charAt(i);
comment.lastIndex = i;
if (!inString && !inParam && c === '/') {
cc = input.charAt(i + 1);
if (cc === '/' || cc === '*') {
if (match = comment.exec(input)) {
if (match.index === i) {
i += match[0].length;
chunk.push(match[0]);
c = input.charAt(i);
}
}
}
}
if (c === '{' && !inString && !inParam) { level ++;
chunk.push(c);
} else if (c === '}' && !inString && !inParam) { level --;
chunk.push(c);
chunks[++j] = chunk = [];
} else if (c === '(' && !inString && !inParam) {
chunk.push(c);
inParam = true;
} else if (c === ')' && !inString && inParam) {
chunk.push(c);
inParam = false;
} else {
if (c === '"' || c === "'" || c === '`') {
if (! inString) {
inString = c;
} else {
inString = inString === c ? false : inString;
}
}
chunk.push(c);
}
}
if (level > 0) {
throw {
type: 'Syntax',
message: "Missing closing `}`",
filename: env.filename
};
}
return chunks.map(function (c) { return c.join('') });;
})([[]]);
// Start with the primary rule.
// The whole syntax tree is held under a Ruleset node,
// with the `root` property set to true, so no `{}` are
// output. The callback is called when the input is parsed.
root = new(tree.Ruleset)([], $(this.parsers.primary));
root.root = true;
root.toCSS = (function (evaluate) {
var line, lines, column;
return function (options, variables) {
var frames = [];
options = options || {};
//
// Allows setting variables with a hash, so:
//
// `{ color: new(tree.Color)('#f01') }` will become:
//
// new(tree.Rule)('@color',
// new(tree.Value)([
// new(tree.Expression)([
// new(tree.Color)('#f01')
// ])
// ])
// )
//
if (typeof(variables) === 'object' && !Array.isArray(variables)) {
variables = Object.keys(variables).map(function (k) {
var value = variables[k];
if (! (value instanceof tree.Value)) {
if (! (value instanceof tree.Expression)) {
value = new(tree.Expression)([value]);
}
value = new(tree.Value)([value]);
}
return new(tree.Rule)('@' + k, value, false, 0);
});
frames = [new(tree.Ruleset)(null, variables)];
}
try {
var css = evaluate.call(this, { frames: frames })
.toCSS([], { compress: options.compress || false });
} catch (e) {
lines = input.split('\n');
line = getLine(e.index);
for (var n = e.index, column = -1;
n >= 0 && input.charAt(n) !== '\n';
n--) { column++ }
throw {
type: e.type,
message: e.message,
filename: env.filename,
index: e.index,
line: typeof(line) === 'number' ? line + 1 : null,
callLine: e.call && (getLine(e.call) + 1),
callExtract: lines[getLine(e.call)],
stack: e.stack,
column: column,
extract: [
lines[line - 1],
lines[line],
lines[line + 1]
]
};
}
if (options.compress) {
return css.replace(/(\s)+/g, "$1");
} else {
return css;
}
function getLine(index) {
return index ? (input.slice(0, index).match(/\n/g) || "").length : null;
}
};
})(root.eval);
// If `i` is smaller than the `input.length - 1`,
// it means the parser wasn't able to parse the whole
// string, so we've got a parsing error.
//
// We try to extract a \n delimited string,
// showing the line where the parse error occured.
// We split it up into two parts (the part which parsed,
// and the part which didn't), so we can color them differently.
if (i < input.length - 1) {
i = furthest;
lines = input.split('\n');
line = (input.slice(0, i).match(/\n/g) || "").length + 1;
for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
error = {
name: "ParseError",
message: "Syntax Error on line " + line,
index: i,
filename: env.filename,
line: line,
column: column,
extract: [
lines[line - 2],
lines[line - 1],
lines[line]
]
};
}
if (this.imports.queue.length > 0) {
finish = function () { callback(error, root) };
} else {
callback(error, root);
}
},
//
// Here in, the parsing rules/functions
//
// The basic structure of the syntax tree generated is as follows:
//
// Ruleset -> Rule -> Value -> Expression -> Entity
//
// Here's some LESS code:
//
// .class {
// color: #fff;
// border: 1px solid #000;
// width: @w + 4px;
// > .child {...}
// }
//
// And here's what the parse tree might look like:
//
// Ruleset (Selector '.class', [
// Rule ("color", Value ([Expression [Color #fff]]))
// Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
// Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
// Ruleset (Selector [Element '>', '.child'], [...])
// ])
//
// In general, most rules will try to parse a token with the `$()` function, and if the return
// value is truly, will return a new node, of the relevant type. Sometimes, we need to check
// first, before parsing, that's when we use `peek()`.
//
parsers: {
//
// The `primary` rule is the *entry* and *exit* point of the parser.
// The rules here can appear at any level of the parse tree.
//
// The recursive nature of the grammar is an interplay between the `block`
// rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
// as represented by this simplified grammar:
//
// primary → (ruleset | rule)+
// ruleset → selector+ block
// block → '{' primary '}'
//
// Only at one point is the primary rule not called from the
// block rule: at the root level.
//
primary: function () {
var node, root = [];
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
$(this.mixin.call) || $(this.comment) || $(this.directive))
|| $(/^[\s\n]+/)) {
node && root.push(node);
}
return root;
},
// We create a Comment node for CSS comments `/* */`,
// but keep the LeSS comments `//` silent, by just skipping
// over them.
comment: function () {
var comment;
if (input.charAt(i) !== '/') return;
if (input.charAt(i + 1) === '/') {
return new(tree.Comment)($(/^\/\/.*/), true);
} else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
return new(tree.Comment)(comment);
}
},
//
// Entities are tokens which can be found inside an Expression
//
entities: {
//
// A string, which supports escaping " and '
//
// "milky way" 'he\'s the one!'
//
quoted: function () {
var str, j = i, e;
if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
e && $('~');
if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
return new(tree.Quoted)(str[0], str[1] || str[2], e);
}
},
//
// A catch-all word, such as:
//
// black border-collapse
//
keyword: function () {
var k;
if (k = $(/^[A-Za-z-]+/)) { return new(tree.Keyword)(k) }
},
//
// A function call
//
// rgb(255, 0, 255)
//
// We also try to catch IE's `alpha()`, but let the `alpha` parser
// deal with the details.
//
// The arguments are parsed with the `entities.arguments` parser.
//
call: function () {
var name, args;
if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
name = name[1].toLowerCase();
if (name === 'url') { return null }
else { i += name.length }
if (name === 'alpha') { return $(this.alpha) }
$('('); // Parse the '(' and consume whitespace.
args = $(this.entities.arguments);
if (! $(')')) return;
if (name) { return new(tree.Call)(name, args) }
},
arguments: function () {
var args = [], arg;
while (arg = $(this.expression)) {
args.push(arg);
if (! $(',')) { break }
}
return args;
},
literal: function () {
return $(this.entities.dimension) ||
$(this.entities.color) ||
$(this.entities.quoted);
},
//
// Parse url() tokens
//
// We use a specific rule for urls, because they don't really behave like
// standard function calls. The difference is that the argument doesn't have
// to be enclosed within a string, so it can't be parsed as an Expression.
//
url: function () {
var value;
if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
value = $(this.entities.quoted) || $(this.entities.variable) ||
$(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
if (! $(')')) throw new(Error)("missing closing ) for url()");
return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
? value : new(tree.Anonymous)(value), imports.paths);
},
dataURI: function () {
var obj;
if ($(/^data:/)) {
obj = {};
obj.mime = $(/^[^\/]+\/[^,;)]+/) || '';
obj.charset = $(/^;\s*charset=[^,;)]+/) || '';
obj.base64 = $(/^;\s*base64/) || '';
obj.data = $(/^,\s*[^)]+/);
if (obj.data) { return obj }
}
},
//
// A Variable entity, such as `@fink`, in
//
// width: @fink + 2px
//
// We use a different parser for variable definitions,
// see `parsers.variable`.
//
variable: function () {
var name, index = i;
if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
return new(tree.Variable)(name, index);
}
},
//
// A Hexadecimal color
//
// #4F3C2F
//
// `rgb` and `hsl` colors are parsed through the `entities.call` parser.
//
color: function () {
var rgb;
if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
return new(tree.Color)(rgb[1]);
}
},
//
// A Dimension, that is, a number and a unit
//
// 0.5em 95%
//
dimension: function () {
var value, c = input.charCodeAt(i);
if ((c > 57 || c < 45) || c === 47) return;
if (value = $(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
return new(tree.Dimension)(value[1], value[2]);
}
},
//
// JavaScript code to be evaluated
//
// `window.location.href`
//
javascript: function () {
var str, j = i, e;
if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
if (input.charAt(j) !== '`') { return }
e && $('~');
if (str = $(/^`([^`]*)`/)) {
return new(tree.JavaScript)(str[1], i, e);
}
}
},
//
// The variable part of a variable definition. Used in the `rule` parser
//
// @fink:
//
variable: function () {
var name;
if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] }
},
//
// A font size/line-height shorthand
//
// small/12px
//
// We need to peek first, or we'll match on keywords and dimensions
//
shorthand: function () {
var a, b;
if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;
if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
return new(tree.Shorthand)(a, b);
}
},
//
// Mixins
//
mixin: {
//
// A Mixin call, with an optional argument list
//
// #mixins > .square(#fff);
// .rounded(4px, black);
// .button;
//
// The `while` loop is there because mixins can be
// namespaced, but we only support the child and descendant
// selector for now.
//
call: function () {
var elements = [], e, c, args, index = i, s = input.charAt(i);
if (s !== '.' && s !== '#') { return }
while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
elements.push(new(tree.Element)(c, e));
c = $('>');
}
$('(') && (args = $(this.entities.arguments)) && $(')');
if (elements.length > 0 && ($(';') || peek('}'))) {
return new(tree.mixin.Call)(elements, args, index);
}
},
//
// A Mixin definition, with a list of parameters
//
// .rounded (@radius: 2px, @color) {
// ...
// }
//
// Until we have a finer grained state-machine, we have to
// do a look-ahead, to make sure we don't have a mixin call.
// See the `rule` function for more information.
//
// We start by matching `.rounded (`, and then proceed on to
// the argument list, which has optional default values.
// We store the parameters in `params`, with a `value` key,
// if there is a value, such as in the case of `@radius`.
//
// Once we've got our params list, and a closing `)`, we parse
// the `{...}` block.
//
definition: function () {
var name, params = [], match, ruleset, param, value;
if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
peek(/^[^{]*(;|})/)) return;
if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
name = match[1];
while (param = $(this.entities.variable) || $(this.entities.literal)
|| $(this.entities.keyword)) {
// Variable
if (param instanceof tree.Variable) {
if ($(':')) {
if (value = $(this.expression)) {
params.push({ name: param.name, value: value });
} else {
throw new(Error)("Expected value");
}
} else {
params.push({ name: param.name });
}
} else {
params.push({ value: param });
}
if (! $(',')) { break }
}
if (! $(')')) throw new(Error)("Expected )");
ruleset = $(this.block);
if (ruleset) {
return new(tree.mixin.Definition)(name, params, ruleset);
}
}
}
},
//
// Entities are the smallest recognized token,
// and can be found inside a rule's value.
//
entity: function () {
return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
$(this.entities.call) || $(this.entities.keyword) || $(this.entities.javascript) ||
$(this.comment);
},
//
// A Rule terminator. Note that we use `peek()` to check for '}',
// because the `block` rule will be expecting it, but we still need to make sure
// it's there, if ';' was ommitted.
//
end: function () {
return $(';') || peek('}');
},
//
// IE's alpha function
//
// alpha(opacity=88)
//
alpha: function () {
var value;
if (! $(/^opacity=/i)) return;
if (value = $(/^\d+/) || $(this.entities.variable)) {
if (! $(')')) throw new(Error)("missing closing ) for alpha()");
return new(tree.Alpha)(value);
}
},
//
// A Selector Element
//
// div
// + h1
// #socks
// input[type="text"]
//
// Elements are the building blocks for Selectors,
// they are made out of a `Combinator` (see combinator rule),
// and an element name, such as a tag a class, or `*`.
//
element: function () {
var e, t, c;
c = $(this.combinator);
e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
if (e) { return new(tree.Element)(c, e) }
},
//
// Combinators combine elements together, in a Selector.
//
// Because our parser isn't white-space sensitive, special care
// has to be taken, when parsing the descendant combinator, ` `,
// as it's an empty space. We have to check the previous character
// in the input, to see if it's a ` ` character. More info on how
// we deal with this in *combinator.js*.
//
combinator: function () {
var match, c = input.charAt(i);
if (c === '>' || c === '&' || c === '+' || c === '~') {
i++;
while (input.charAt(i) === ' ') { i++ }
return new(tree.Combinator)(c);
} else if (c === ':' && input.charAt(i + 1) === ':') {
i += 2;
while (input.charAt(i) === ' ') { i++ }
return new(tree.Combinator)('::');
} else if (input.charAt(i - 1) === ' ') {
return new(tree.Combinator)(" ");
} else {
return new(tree.Combinator)(null);
}
},
//
// A CSS Selector
//
// .class > div + h1
// li a:hover
//
// Selectors are made out of one or more Elements, see above.
//
selector: function () {
var sel, e, elements = [], c, match;
while (e = $(this.element)) {
c = input.charAt(i);
elements.push(e)
if (c === '{' || c === '}' || c === ';' || c === ',') { break }
}
if (elements.length > 0) { return new(tree.Selector)(elements) }
},
tag: function () {
return $(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || $('*');
},
attribute: function () {
var attr = '', key, val, op;
if (! $('[')) return;
if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
if ((op = $(/^[|~*$^]?=/)) &&
(val = $(this.entities.quoted) || $(/^[\w-]+/))) {
attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
} else { attr = key }
}
if (! $(']')) return;
if (attr) { return "[" + attr + "]" }
},
//
// The `block` rule is used by `ruleset` and `mixin.definition`.
// It's a wrapper around the `primary` rule, with added `{}`.
//
block: function () {
var content;
if ($('{') && (content = $(this.primary)) && $('}')) {
return content;
}
},
//
// div, .class, body > p {...}
//
ruleset: function () {
var selectors = [], s, rules, match;
save();
if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
i += match[0].length - 1;
selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
} else {
while (s = $(this.selector)) {
selectors.push(s);
$(this.comment);
if (! $(',')) { break }
$(this.comment);
}
}
if (selectors.length > 0 && (rules = $(this.block))) {
return new(tree.Ruleset)(selectors, rules);
} else {
// Backtrack
furthest = i;
restore();
}
},
rule: function () {
var name, value, c = input.charAt(i), important, match;
save();
if (c === '.' || c === '#' || c === '&') { return }
if (name = $(this.variable) || $(this.property)) {
if ((name.charAt(0) != '@') && (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j]))) {
i += match[0].length - 1;
value = new(tree.Anonymous)(match[1]);
} else if (name === "font") {
value = $(this.font);
} else {
value = $(this.value);
}
important = $(this.important);
if (value && $(this.end)) {
return new(tree.Rule)(name, value, important, memo);
} else {
furthest = i;
restore();
}
}
},
//
// An @import directive
//
// @import "lib";
//
// Depending on our environemnt, importing is done differently:
// In the browser, it's an XHR request, in Node, it would be a
// file-system operation. The function used for importing is
// stored in `import`, which we pass to the Import constructor.
//
"import": function () {
var path;
if ($(/^@import\s+/) &&
(path = $(this.entities.quoted) || $(this.entities.url)) &&
$(';')) {
return new(tree.Import)(path, imports);
}
},
//
// A CSS Directive
//
// @charset "utf-8";
//
directive: function () {
var name, value, rules, types;
if (input.charAt(i) !== '@') return;
if (value = $(this['import'])) {
return value;
} else if (name = $(/^@media|@page|@-[-a-z]+/)) {
types = ($(/^[^{]+/) || '').trim();
if (rules = $(this.block)) {
return new(tree.Directive)(name + " " + types, rules);
}
} else if (name = $(/^@[-a-z]+/)) {
if (name === '@font-face') {
if (rules = $(this.block)) {
return new(tree.Directive)(name, rules);
}
} else if ((value = $(this.entity)) && $(';')) {
return new(tree.Directive)(name, value);
}
}
},
font: function () {
var value = [], expression = [], weight, shorthand, font, e;
while (e = $(this.shorthand) || $(this.entity)) {
expression.push(e);
}
value.push(new(tree.Expression)(expression));
if ($(',')) {
while (e = $(this.expression)) {
value.push(e);
if (! $(',')) { break }
}
}
return new(tree.Value)(value);
},
//
// A Value is a comma-delimited list of Expressions
//
// font-family: Baskerville, Georgia, serif;
//
// In a Rule, a Value represents everything after the `:`,
// and before the `;`.
//
value: function () {
var e, expressions = [], important;
while (e = $(this.expression)) {
expressions.push(e);
if (! $(',')) { break }
}
if (expressions.length > 0) {
return new(tree.Value)(expressions);
}
},
important: function () {
if (input.charAt(i) === '!') {
return $(/^! *important/);
}
},
sub: function () {
var e;
if ($('(') && (e = $(this.expression)) && $(')')) {
return e;
}
},
multiplication: function () {
var m, a, op, operation;
if (m = $(this.operand)) {
while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
operation = new(tree.Operation)(op, [operation || m, a]);
}
return operation || m;
}
},
addition: function () {
var m, a, op, operation;
if (m = $(this.multiplication)) {
while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) &&
(a = $(this.multiplication))) {
operation = new(tree.Operation)(op, [operation || m, a]);
}
return operation || m;
}
},
//
// An operand is anything that can be part of an operation,
// such as a Color, or a Variable
//
operand: function () {
var negate, p = input.charAt(i + 1);
if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
var o = $(this.sub) || $(this.entities.dimension) ||
$(this.entities.color) || $(this.entities.variable) ||
$(this.entities.call);
return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o])
: o;
},
//
// Expressions either represent mathematical operations,
// or white-space delimited Entities.
//
// 1px solid black
// @var * 2
//
expression: function () {
var e, delim, entities = [], d;
while (e = $(this.addition) || $(this.entity)) {
entities.push(e);
}
if (entities.length > 0) {
return new(tree.Expression)(entities);
}
},
property: function () {
var name;
if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) {
return name[1];
}
}
}
};
};
if (typeof(window) !== 'undefined') {
//
// Used by `@import` directives
//
less.Parser.importer = function (path, paths, callback, env) {
if (path.charAt(0) !== '/' && paths.length > 0) {
path = paths[0] + path;
}
// We pass `true` as 3rd argument, to force the reload of the import.
// This is so we can get the syntax tree as opposed to just the CSS output,
// as we need this to evaluate the current stylesheet.
loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
};
}
(function (tree) {
tree.functions = {
rgb: function (r, g, b) {
return this.rgba(r, g, b, 1.0);
},
rgba: function (r, g, b, a) {
var rgb = [r, g, b].map(function (c) { return number(c) }),
a = number(a);
return new(tree.Color)(rgb, a);
},
hsl: function (h, s, l) {
return this.hsla(h, s, l, 1.0);
},
hsla: function (h, s, l, a) {
h = (number(h) % 360) / 360;
s = number(s); l = number(l); a = number(a);
var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
var m1 = l * 2 - m2;
return this.rgba(hue(h + 1/3) * 255,
hue(h) * 255,
hue(h - 1/3) * 255,
a);
function hue(h) {
h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
else if (h * 2 < 1) return m2;
else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;
else return m1;
}
},
hue: function (color) {
return new(tree.Dimension)(Math.round(color.toHSL().h));
},
saturation: function (color) {
return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
},
lightness: function (color) {
return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
},
alpha: function (color) {
return new(tree.Dimension)(color.toHSL().a);
},
saturate: function (color, amount) {
var hsl = color.toHSL();
hsl.s += amount.value / 100;
hsl.s = clamp(hsl.s);
return hsla(hsl);
},
desaturate: function (color, amount) {
var hsl = color.toHSL();
hsl.s -= amount.value / 100;
hsl.s = clamp(hsl.s);
return hsla(hsl);
},
lighten: function (color, amount) {
var hsl = color.toHSL();
hsl.l += amount.value / 100;
hsl.l = clamp(hsl.l);
return hsla(hsl);
},
darken: function (color, amount) {
var hsl = color.toHSL();
hsl.l -= amount.value / 100;
hsl.l = clamp(hsl.l);
return hsla(hsl);
},
fadein: function (color, amount) {
var hsl = color.toHSL();
hsl.a += amount.value / 100;
hsl.a = clamp(hsl.a);
return hsla(hsl);
},
fadeout: function (color, amount) {
var hsl = color.toHSL();
hsl.a -= amount.value / 100;
hsl.a = clamp(hsl.a);
return hsla(hsl);
},
spin: function (color, amount) {
var hsl = color.toHSL();
var hue = (hsl.h + amount.value) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return hsla(hsl);
},
//
// Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
// http://sass-lang.com
//
mix: function (color1, color2, weight) {
var p = weight.value / 100.0;
var w = p * 2 - 1;
var a = color1.toHSL().a - color2.toHSL().a;
var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
var w2 = 1 - w1;
var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
color1.rgb[1] * w1 + color2.rgb[1] * w2,
color1.rgb[2] * w1 + color2.rgb[2] * w2];
var alpha = color1.alpha * p + color2.alpha * (1 - p);
return new(tree.Color)(rgb, alpha);
},
greyscale: function (color) {
return this.desaturate(color, new(tree.Dimension)(100));
},
e: function (str) {
return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
},
escape: function (str) {
return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
},
'%': function (quoted /* arg, arg, ...*/) {
var args = Array.prototype.slice.call(arguments, 1),
str = quoted.value;
for (var i = 0; i < args.length; i++) {
str = str.replace(/%[sda]/i, function(token) {
var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
});
}
str = str.replace(/%%/g, '%');
return new(tree.Quoted)('"' + str + '"', str);
},
round: function (n) {
if (n instanceof tree.Dimension) {
return new(tree.Dimension)(Math.round(number(n)), n.unit);
} else if (typeof(n) === 'number') {
return Math.round(n);
} else {
throw {
error: "RuntimeError",
message: "math functions take numbers as parameters"
};
}
}
};
function hsla(hsla) {
return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
}
function number(n) {
if (n instanceof tree.Dimension) {
return parseFloat(n.unit == '%' ? n.value / 100 : n.value);
} else if (typeof(n) === 'number') {
return n;
} else {
throw {
error: "RuntimeError",
message: "color functions take numbers as parameters"
};
}
}
function clamp(val) {
return Math.min(1, Math.max(0, val));
}
})(require('less/tree'));
(function (tree) {
tree.Alpha = function (val) {
this.value = val;
};
tree.Alpha.prototype = {
toCSS: function () {
return "alpha(opacity=" +
(this.value.toCSS ? this.value.toCSS() : this.value) + ")";
},
eval: function () { return this }
};
})(require('less/tree'));
(function (tree) {
tree.Anonymous = function (string) {
this.value = string.value || string;
};
tree.Anonymous.prototype = {
toCSS: function () {
return this.value;
},
eval: function () { return this }
};
})(require('less/tree'));
(function (tree) {
//
// A function call node.
//
tree.Call = function (name, args) {
this.name = name;
this.args = args;
};
tree.Call.prototype = {
//
// When evaluating a function call,
// we either find the function in `tree.functions` [1],
// in which case we call it, passing the evaluated arguments,
// or we simply print it out as it appeared originally [2].
//
// The *functions.js* file contains the built-in functions.
//
// The reason why we evaluate the arguments, is in the case where
// we try to pass a variable to a function, like: `saturate(@color)`.
// The function should receive the value, not the variable.
//
eval: function (env) {
var args = this.args.map(function (a) { return a.eval(env) });
if (this.name in tree.functions) { // 1.
return tree.functions[this.name].apply(tree.functions, args);
} else { // 2.
return new(tree.Anonymous)(this.name +
"(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
}
},
toCSS: function (env) {
return this.eval(env).toCSS();
}
};
})(require('less/tree'));
(function (tree) {
//
// RGB Colors - #ff0014, #eee
//
tree.Color = function (rgb, a) {
//
// The end goal here, is to parse the arguments
// into an integer triplet, such as `128, 255, 0`
//
// This facilitates operations and conversions.
//
if (Array.isArray(rgb)) {
this.rgb = rgb;
} else if (rgb.length == 6) {
this.rgb = rgb.match(/.{2}/g).map(function (c) {
return parseInt(c, 16);
});
} else if (rgb.length == 8) {
this.alpha = parseInt(rgb.substring(0,2), 16) / 255.0;
this.rgb = rgb.substr(2).match(/.{2}/g).map(function (c) {
return parseInt(c, 16);
});
} else {
this.rgb = rgb.split('').map(function (c) {
return parseInt(c + c, 16);
});
}
this.alpha = typeof(a) === 'number' ? a : 1;
};
tree.Color.prototype = {
eval: function () { return this },
//
// If we have some transparency, the only way to represent it
// is via `rgba`. Otherwise, we use the hex representation,
// which has better compatibility with older browsers.
// Values are capped between `0` and `255`, rounded and zero-padded.
//
toCSS: function () {
if (this.alpha < 1.0) {
return "rgba(" + this.rgb.map(function (c) {
return Math.round(c);
}).concat(this.alpha).join(', ') + ")";
} else {
return '#' + this.rgb.map(function (i) {
i = Math.round(i);
i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
return i.length === 1 ? '0' + i : i;
}).join('');
}
},
//
// Operations have to be done per-channel, if not,
// channels will spill onto each other. Once we have
// our result, in the form of an integer triplet,
// we create a new Color node to hold the result.
//
operate: function (op, other) {
var result = [];
if (! (other instanceof tree.Color)) {
other = other.toColor();
}
for (var c = 0; c < 3; c++) {
result[c] = tree.operate(op, this.rgb[c], other.rgb[c]);
}
return new(tree.Color)(result, this.alpha + other.alpha);
},
toHSL: function () {
var r = this.rgb[0] / 255,
g = this.rgb[1] / 255,
b = this.rgb[2] / 255,
a = this.alpha;
var max = Math.max(r, g, b), min = Math.min(r, g, b);
var h, s, l = (max + min) / 2, d = max - min;
if (max === min) {
h = s = 0;
} else {
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r: h = (g - b) / d + (g < b ? 6 : 0); break;
case g: h = (b - r) / d + 2; break;
case b: h = (r - g) / d + 4; break;
}
h /= 6;
}
return { h: h * 360, s: s, l: l, a: a };
}
};
})(require('less/tree'));
(function (tree) {
tree.Comment = function (value, silent) {
this.value = value;
this.silent = !!silent;
};
tree.Comment.prototype = {
toCSS: function (env) {
return env.compress ? '' : this.value;
},
eval: function () { return this }
};
})(require('less/tree'));
(function (tree) {
//
// A number with a unit
//
tree.Dimension = function (value, unit) {
this.value = parseFloat(value);
this.unit = unit || null;
};
tree.Dimension.prototype = {
eval: function () { return this },
toColor: function () {
return new(tree.Color)([this.value, this.value, this.value]);
},
toCSS: function () {
var css = this.value + this.unit;
return css;
},
// In an operation between two Dimensions,
// we default to the first Dimension's unit,
// so `1px + 2em` will yield `3px`.
// In the future, we could implement some unit
// conversions such that `100cm + 10mm` would yield
// `101cm`.
operate: function (op, other) {
return new(tree.Dimension)
(tree.operate(op, this.value, other.value),
this.unit || other.unit);
}
};
})(require('less/tree'));
(function (tree) {
tree.Directive = function (name, value) {
this.name = name;
if (Array.isArray(value)) {
this.ruleset = new(tree.Ruleset)([], value);
} else {
this.value = value;
}
};
tree.Directive.prototype = {
toCSS: function (ctx, env) {
if (this.ruleset) {
this.ruleset.root = true;
return this.name + (env.compress ? '{' : ' {\n ') +
this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') +
(env.compress ? '}': '\n}\n');
} else {
return this.name + ' ' + this.value.toCSS() + ';\n';
}
},
eval: function (env) {
env.frames.unshift(this);
this.ruleset = this.ruleset && this.ruleset.eval(env);
env.frames.shift();
return this;
},
variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
};
})(require('less/tree'));
(function (tree) {
tree.Element = function (combinator, value) {
this.combinator = combinator instanceof tree.Combinator ?
combinator : new(tree.Combinator)(combinator);
this.value = value.trim();
};
tree.Element.prototype.toCSS = function (env) {
return this.combinator.toCSS(env || {}) + this.value;
};
tree.Combinator = function (value) {
if (value === ' ') {
this.value = ' ';
} else {
this.value = value ? value.trim() : "";
}
};
tree.Combinator.prototype.toCSS = function (env) {
return {
'' : '',
' ' : ' ',
'&' : '',
':' : ' :',
'::': '::',
'+' : env.compress ? '+' : ' + ',
'~' : env.compress ? '~' : ' ~ ',
'>' : env.compress ? '>' : ' > '
}[this.value];
};
})(require('less/tree'));
(function (tree) {
tree.Expression = function (value) { this.value = value };
tree.Expression.prototype = {
eval: function (env) {
if (this.value.length > 1) {
return new(tree.Expression)(this.value.map(function (e) {
return e.eval(env);
}));
} else {
return this.value[0].eval(env);
}
},
toCSS: function (env) {
return this.value.map(function (e) {
return e.toCSS(env);
}).join(' ');
}
};
})(require('less/tree'));
(function (tree) {
//
// CSS @import node
//
// The general strategy here is that we don't want to wait
// for the parsing to be completed, before we start importing
// the file. That's because in the context of a browser,
// most of the time will be spent waiting for the server to respond.
//
// On creation, we push the import path to our import queue, though
// `import,push`, we also pass it a callback, which it'll call once
// the file has been fetched, and parsed.
//
tree.Import = function (path, imports) {
var that = this;
this._path = path;
// The '.less' extension is optional
if (path instanceof tree.Quoted) {
this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less';
} else {
this.path = path.value.value || path.value;
}
this.css = /css$/.test(this.path);
// Only pre-compile .less files
if (! this.css) {
imports.push(this.path, function (root) {
if (! root) {
throw new(Error)("Error parsing " + that.path);
}
that.root = root;
});
}
};
//
// The actual import node doesn't return anything, when converted to CSS.
// The reason is that it's used at the evaluation stage, so that the rules
// it imports can be treated like any other rules.
//
// In `eval`, we make sure all Import nodes get evaluated, recursively, so
// we end up with a flat structure, which can easily be imported in the parent
// ruleset.
//
tree.Import.prototype = {
toCSS: function () {
if (this.css) {
return "@import " + this._path.toCSS() + ';\n';
} else {
return "";
}
},
eval: function (env) {
var ruleset;
if (this.css) {
return this;
} else {
ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
for (var i = 0; i < ruleset.rules.length; i++) {
if (ruleset.rules[i] instanceof tree.Import) {
Array.prototype
.splice
.apply(ruleset.rules,
[i, 1].concat(ruleset.rules[i].eval(env)));
}
}
return ruleset.rules;
}
}
};
})(require('less/tree'));
(function (tree) {
tree.JavaScript = function (string, index, escaped) {
this.escaped = escaped;
this.expression = string;
this.index = index;
};
tree.JavaScript.prototype = {
toCSS: function () {
if (this.escaped) {
return this.evaluated;
} else {
return JSON.stringify(this.evaluated);
}
},
eval: function (env) {
var result,
context = {};
var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
return new(tree.Variable)('@' + name).eval(env).value;
});
expression = new(Function)('return (' + expression + ')');
for (var k in env.frames[0].variables()) {
context[k.slice(1)] = {
value: env.frames[0].variables()[k].value,
toJS: function () {
return this.value.eval(env).toCSS();
}
};
}
try {
this.evaluated = expression.call(context);
} catch (e) {
throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
index: this.index };
}
return this;
}
};
})(require('less/tree'));
(function (tree) {
tree.Keyword = function (value) { this.value = value };
tree.Keyword.prototype = {
eval: function () { return this },
toCSS: function () { return this.value }
};
})(require('less/tree'));
(function (tree) {
tree.mixin = {};
tree.mixin.Call = function (elements, args, index) {
this.selector = new(tree.Selector)(elements);
this.arguments = args;
this.index = index;
};
tree.mixin.Call.prototype = {
eval: function (env) {
var mixins, rules = [], match = false;
for (var i = 0; i < env.frames.length; i++) {
if ((mixins = env.frames[i].find(this.selector)).length > 0) {
for (var m = 0; m < mixins.length; m++) {
if (mixins[m].match(this.arguments, env)) {
try {
Array.prototype.push.apply(
rules, mixins[m].eval(env, this.arguments).rules);
match = true;
} catch (e) {
throw { message: e.message, index: e.index, stack: e.stack, call: this.index };
}
}
}
if (match) {
return rules;
} else {
throw { message: 'No matching definition was found for `' +
this.selector.toCSS().trim() + '(' +
this.arguments.map(function (a) {
return a.toCSS();
}).join(', ') + ")`",
index: this.index };
}
}
}
throw { message: this.selector.toCSS().trim() + " is undefined",
index: this.index };
}
};
tree.mixin.Definition = function (name, params, rules) {
this.name = name;
this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
this.params = params;
this.arity = params.length;
this.rules = rules;
this._lookups = {};
this.required = params.reduce(function (count, p) {
if (!p.name || (p.name && !p.value)) { return count + 1 }
else { return count }
}, 0);
this.parent = tree.Ruleset.prototype;
this.frames = [];
};
tree.mixin.Definition.prototype = {
toCSS: function () { return "" },
variable: function (name) { return this.parent.variable.call(this, name) },
variables: function () { return this.parent.variables.call(this) },
find: function () { return this.parent.find.apply(this, arguments) },
rulesets: function () { return this.parent.rulesets.apply(this) },
eval: function (env, args) {
var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
for (var i = 0, val; i < this.params.length; i++) {
if (this.params[i].name) {
if (val = (args && args[i]) || this.params[i].value) {
frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env)));
} else {
throw { message: "wrong number of arguments for " + this.name +
' (' + args.length + ' for ' + this.arity + ')' };
}
}
}
for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
_arguments.push(args[i] || this.params[i].value);
}
frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments)));
return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
frames: [this, frame].concat(this.frames, env.frames)
});
},
match: function (args, env) {
var argsLength = (args && args.length) || 0, len;
if (argsLength < this.required) { return false }
if ((this.required > 0) && (argsLength > this.params.length)) { return false }
len = Math.min(argsLength, this.arity);
for (var i = 0; i < len; i++) {
if (!this.params[i].name) {
if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
return false;
}
}
}
return true;
}
};
})(require('less/tree'));
(function (tree) {
tree.Operation = function (op, operands) {
this.op = op.trim();
this.operands = operands;
};
tree.Operation.prototype.eval = function (env) {
var a = this.operands[0].eval(env),
b = this.operands[1].eval(env),
temp;
if (a instanceof tree.Dimension && b instanceof tree.Color) {
if (this.op === '*' || this.op === '+') {
temp = b, b = a, a = temp;
} else {
throw { name: "OperationError",
message: "Can't substract or divide a color from a number" };
}
}
return a.operate(this.op, b);
};
tree.operate = function (op, a, b) {
switch (op) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
}
};
})(require('less/tree'));
(function (tree) {
tree.Quoted = function (str, content, escaped, i) {
this.escaped = escaped;
this.value = content || '';
this.quote = str.charAt(0);
this.index = i;
};
tree.Quoted.prototype = {
toCSS: function () {
if (this.escaped) {
return this.value;
} else {
return this.quote + this.value + this.quote;
}
},
eval: function (env) {
this.value = this.value.replace(/@\{([\w-]+)\}/g, function (_, name) {
return new(tree.Variable)('@' + name).eval(env).value;
}).replace(/`([^`]+)`/g, function (_, exp) {
return new(tree.JavaScript)(exp, this.index, true).eval(env).toCSS();
});
return this;
}
};
})(require('less/tree'));
(function (tree) {
tree.Rule = function (name, value, important, index) {
this.name = name;
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
this.important = important ? ' ' + important.trim() : '';
this.index = index;
if (name.charAt(0) === '@') {
this.variable = true;
} else { this.variable = false }
};
tree.Rule.prototype.toCSS = function (env) {
if (this.variable) { return "" }
else {
return this.name + (env.compress ? ':' : ': ') +
this.value.toCSS(env) +
this.important + ";";
}
};
tree.Rule.prototype.eval = function (context) {
return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index);
};
tree.Shorthand = function (a, b) {
this.a = a;
this.b = b;
};
tree.Shorthand.prototype = {
toCSS: function (env) {
return this.a.toCSS(env) + "/" + this.b.toCSS(env);
},
eval: function () { return this }
};
})(require('less/tree'));
(function (tree) {
tree.Ruleset = function (selectors, rules) {
this.selectors = selectors;
this.rules = rules;
this._lookups = {};
};
tree.Ruleset.prototype = {
eval: function (env) {
var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
ruleset.root = this.root;
// push the current ruleset to the frames stack
env.frames.unshift(ruleset);
// Evaluate imports
if (ruleset.root) {
for (var i = 0; i < ruleset.rules.length; i++) {
if (ruleset.rules[i] instanceof tree.Import) {
Array.prototype.splice
.apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
}
}
}
// Store the frames around mixin definitions,
// so they can be evaluated like closures when the time comes.
for (var i = 0; i < ruleset.rules.length; i++) {
if (ruleset.rules[i] instanceof tree.mixin.Definition) {
ruleset.rules[i].frames = env.frames.slice(0);
}
}
// Evaluate mixin calls.
for (var i = 0; i < ruleset.rules.length; i++) {
if (ruleset.rules[i] instanceof tree.mixin.Call) {
Array.prototype.splice
.apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
}
}
// Evaluate everything else
for (var i = 0, rule; i < ruleset.rules.length; i++) {
rule = ruleset.rules[i];
if (! (rule instanceof tree.mixin.Definition)) {
ruleset.rules[i] = rule.eval ? rule.eval(env) : rule;
}
}
// Pop the stack
env.frames.shift();
return ruleset;
},
match: function (args) {
return !args || args.length === 0;
},
variables: function () {
if (this._variables) { return this._variables }
else {
return this._variables = this.rules.reduce(function (hash, r) {
if (r instanceof tree.Rule && r.variable === true) {
hash[r.name] = r;
}
return hash;
}, {});
}
},
variable: function (name) {
return this.variables()[name];
},
rulesets: function () {
if (this._rulesets) { return this._rulesets }
else {
return this._rulesets = this.rules.filter(function (r) {
return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition);
});
}
},
find: function (selector, self) {
self = self || this;
var rules = [], rule, match,
key = selector.toCSS();
if (key in this._lookups) { return this._lookups[key] }
this.rulesets().forEach(function (rule) {
if (rule !== self) {
for (var j = 0; j < rule.selectors.length; j++) {
if (match = selector.match(rule.selectors[j])) {
if (selector.elements.length > 1) {
Array.prototype.push.apply(rules, rule.find(
new(tree.Selector)(selector.elements.slice(1)), self));
} else {
rules.push(rule);
}
break;
}
}
}
});
return this._lookups[key] = rules;
},
//
// Entry point for code generation
//
// `context` holds an array of arrays.
//
toCSS: function (context, env) {
var css = [], // The CSS output
rules = [], // node.Rule instances
rulesets = [], // node.Ruleset instances
paths = [], // Current selectors
selector, // The fully rendered selector
rule;
if (! this.root) {
if (context.length === 0) {
paths = this.selectors.map(function (s) { return [s] });
} else {
for (var s = 0; s < this.selectors.length; s++) {
for (var c = 0; c < context.length; c++) {
paths.push(context[c].concat([this.selectors[s]]));
}
}
}
}
// Compile rules and rulesets
for (var i = 0; i < this.rules.length; i++) {
rule = this.rules[i];
if (rule.rules || (rule instanceof tree.Directive)) {
rulesets.push(rule.toCSS(paths, env));
} else if (rule instanceof tree.Comment) {
if (!rule.silent) {
if (this.root) {
rulesets.push(rule.toCSS(env));
} else {
rules.push(rule.toCSS(env));
}
}
} else {
if (rule.toCSS && !rule.variable) {
rules.push(rule.toCSS(env));
} else if (rule.value && !rule.variable) {
rules.push(rule.value.toString());
}
}
}
rulesets = rulesets.join('');
// If this is the root node, we don't render
// a selector, or {}.
// Otherwise, only output if this ruleset has rules.
if (this.root) {
css.push(rules.join(env.compress ? '' : '\n'));
} else {
if (rules.length > 0) {
selector = paths.map(function (p) {
return p.map(function (s) {
return s.toCSS(env);
}).join('').trim();
}).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
css.push(selector,
(env.compress ? '{' : ' {\n ') +
rules.join(env.compress ? '' : '\n ') +
(env.compress ? '}' : '\n}\n'));
}
}
css.push(rulesets);
return css.join('') + (env.compress ? '\n' : '');
}
};
})(require('less/tree'));
(function (tree) {
tree.Selector = function (elements) {
this.elements = elements;
if (this.elements[0].combinator.value === "") {
this.elements[0].combinator.value = ' ';
}
};
tree.Selector.prototype.match = function (other) {
if (this.elements[0].value === other.elements[0].value) {
return true;
} else {
return false;
}
};
tree.Selector.prototype.toCSS = function (env) {
if (this._css) { return this._css }
return this._css = this.elements.map(function (e) {
if (typeof(e) === 'string') {
return ' ' + e.trim();
} else {
return e.toCSS(env);
}
}).join('');
};
})(require('less/tree'));
(function (tree) {
tree.URL = function (val, paths) {
if (val.data) {
this.attrs = val;
} else {
// Add the base path if the URL is relative and we are in the browser
if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
}
this.value = val;
this.paths = paths;
}
};
tree.URL.prototype = {
toCSS: function () {
return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
: this.value.toCSS()) + ")";
},
eval: function (ctx) {
return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths);
}
};
})(require('less/tree'));
(function (tree) {
tree.Value = function (value) {
this.value = value;
this.is = 'value';
};
tree.Value.prototype = {
eval: function (env) {
if (this.value.length === 1) {
return this.value[0].eval(env);
} else {
return new(tree.Value)(this.value.map(function (v) {
return v.eval(env);
}));
}
},
toCSS: function (env) {
return this.value.map(function (e) {
return e.toCSS(env);
}).join(env.compress ? ',' : ', ');
}
};
})(require('less/tree'));
(function (tree) {
tree.Variable = function (name, index) { this.name = name, this.index = index };
tree.Variable.prototype = {
eval: function (env) {
var variable, v, name = this.name;
if (name.indexOf('@@') == 0) {
name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
}
if (variable = tree.find(env.frames, function (frame) {
if (v = frame.variable(name)) {
return v.value.eval(env);
}
})) { return variable }
else {
throw { message: "variable " + name + " is undefined",
index: this.index };
}
}
};
})(require('less/tree'));
require('less/tree').find = function (obj, fun) {
for (var i = 0, r; i < obj.length; i++) {
if (r = fun.call(obj, obj[i])) { return r }
}
return null;
};
//
// browser.js - client-side engine
//
var isFileProtocol = (location.protocol === 'file:' ||
location.protocol === 'chrome:' ||
location.protocol === 'chrome-extension:' ||
location.protocol === 'resource:');
less.env = less.env || (location.hostname == '127.0.0.1' ||
location.hostname == '0.0.0.0' ||
location.hostname == 'localhost' ||
location.port.length > 0 ||
isFileProtocol ? 'development'
: 'production');
// Load styles asynchronously (default: false)
//
// This is set to `false` by default, so that the body
// doesn't start loading before the stylesheets are parsed.
// Setting this to `true` can result in flickering.
//
less.async = false;
// Interval between watch polls
less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
//
// Watch mode
//
less.watch = function () { return this.watchMode = true };
less.unwatch = function () { return this.watchMode = false };
if (less.env === 'development') {
less.optimization = 0;
if (/!watch/.test(location.hash)) {
less.watch();
}
less.watchTimer = setInterval(function () {
if (less.watchMode) {
loadStyleSheets(function (root, sheet, env) {
if (root) {
createCSS(root.toCSS(), sheet, env.lastModified);
}
});
}
}, less.poll);
} else {
less.optimization = 3;
}
var cache;
try {
cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
} catch (_) {
cache = null;
}
//
// Get all tags with the 'rel' attribute set to "stylesheet/less"
//
var links = document.getElementsByTagName('link');
var typePattern = /^text\/(x-)?less$/;
less.sheets = [];
for (var i = 0; i < links.length; i++) {
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
(links[i].type.match(typePattern)))) {
less.sheets.push(links[i]);
}
}
less.refresh = function (reload) {
var startTime, endTime;
startTime = endTime = new(Date);
loadStyleSheets(function (root, sheet, env) {
if (env.local) {
log("loading " + sheet.href + " from cache.");
} else {
log("parsed " + sheet.href + " successfully.");
createCSS(root.toCSS(), sheet, env.lastModified);
}
log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms');
(env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms');
endTime = new(Date);
}, reload);
loadStyles();
};
less.refreshStyles = loadStyles;
less.refresh(less.env === 'development');
function loadStyles() {
var styles = document.getElementsByTagName('style');
for (var i = 0; i < styles.length; i++) {
if (styles[i].type.match(typePattern)) {
new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
styles[i].type = 'text/css';
styles[i].innerHTML = tree.toCSS();
});
}
}
}
function loadStyleSheets(callback, reload) {
for (var i = 0; i < less.sheets.length; i++) {
loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1));
}
}
function loadStyleSheet(sheet, callback, reload, remaining) {
var url = window.location.href.replace(/[#?].*$/, '');
var href = sheet.href.replace(/\?.*$/, '');
var css = cache && cache.getItem(href);
var timestamp = cache && cache.getItem(href + ':timestamp');
var styles = { css: css, timestamp: timestamp };
// Stylesheets in IE don't always return the full path
if (! /^(https?|file):/.test(href)) {
if (href.charAt(0) == "/") {
href = window.location.protocol + "//" + window.location.host + href;
} else {
href = url.slice(0, url.lastIndexOf('/') + 1) + href;
}
}
xhr(sheet.href, sheet.type, function (data, lastModified) {
if (!reload && styles && lastModified &&
(new(Date)(lastModified).valueOf() ===
new(Date)(styles.timestamp).valueOf())) {
// Use local copy
createCSS(styles.css, sheet);
callback(null, sheet, { local: true, remaining: remaining });
} else {
// Use remote copy (re-parse)
try {
new(less.Parser)({
optimization: less.optimization,
paths: [href.replace(/[\w\.-]+$/, '')],
mime: sheet.type
}).parse(data, function (e, root) {
if (e) { return error(e, href) }
try {
callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining });
removeNode(document.getElementById('less-error-message:' + extractId(href)));
} catch (e) {
error(e, href);
}
});
} catch (e) {
error(e, href);
}
}
}, function (status, url) {
throw new(Error)("Couldn't load " + url + " (" + status + ")");
});
}
function extractId(href) {
return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain
.replace(/^\//, '' ) // Remove root /
.replace(/\?.*$/, '' ) // Remove query
.replace(/\.[^\.\/]+$/, '' ) // Remove file extension
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
}
function createCSS(styles, sheet, lastModified) {
var css;
// Strip the query-string
var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
// If there is no title set, use the filename, minus the extension
var id = 'less:' + (sheet.title || extractId(href));
// If the stylesheet doesn't exist, create a new node
if ((css = document.getElementById(id)) === null) {
css = document.createElement('style');
css.type = 'text/css';
css.media = sheet.media || 'screen';
css.id = id;
document.getElementsByTagName('head')[0].appendChild(css);
}
if (css.styleSheet) { // IE
try {
css.styleSheet.cssText = styles;
} catch (e) {
throw new(Error)("Couldn't reassign styleSheet.cssText.");
}
} else {
(function (node) {
if (css.childNodes.length > 0) {
if (css.firstChild.nodeValue !== node.nodeValue) {
css.replaceChild(node, css.firstChild);
}
} else {
css.appendChild(node);
}
})(document.createTextNode(styles));
}
// Don't update the local store if the file wasn't modified
if (lastModified && cache) {
log('saving ' + href + ' to cache.');
cache.setItem(href, styles);
cache.setItem(href + ':timestamp', lastModified);
}
}
function xhr(url, type, callback, errback) {
var xhr = getXMLHttpRequest();
var async = isFileProtocol ? false : less.async;
if (typeof(xhr.overrideMimeType) === 'function') {
xhr.overrideMimeType('text/css');
}
xhr.open('GET', url, async);
xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
xhr.send(null);
if (isFileProtocol) {
if (xhr.status === 0) {
callback(xhr.responseText);
} else {
errback(xhr.status, url);
}
} else if (async) {
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
handleResponse(xhr, callback, errback);
}
};
} else {
handleResponse(xhr, callback, errback);
}
function handleResponse(xhr, callback, errback) {
if (xhr.status >= 200 && xhr.status < 300) {
callback(xhr.responseText,
xhr.getResponseHeader("Last-Modified"));
} else if (typeof(errback) === 'function') {
errback(xhr.status, url);
}
}
}
function getXMLHttpRequest() {
if (window.XMLHttpRequest) {
return new(XMLHttpRequest);
} else {
try {
return new(ActiveXObject)("MSXML2.XMLHTTP.3.0");
} catch (e) {
log("browser doesn't support AJAX.");
return null;
}
}
}
function removeNode(node) {
return node && node.parentNode.removeChild(node);
}
function log(str) {
if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) }
}
function error(e, href) {
var id = 'less-error-message:' + extractId(href);
var template = ['',
'{0}
',
'{current}
',
'{2}
',
'
'].join('\n');
var elem = document.createElement('div'), timer, content;
elem.id = id;
elem.className = "less-error-message";
content = '' + (e.message || 'There is an error in your .less file') +
'
' + '' + href + " ";
if (e.extract) {
content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':
' +
template.replace(/\[(-?\d)\]/g, function (_, i) {
return (parseInt(e.line) + parseInt(i)) || '';
}).replace(/\{(\d)\}/g, function (_, i) {
return e.extract[parseInt(i)] || '';
}).replace(/\{current\}/, e.extract[1].slice(0, e.column) + '' +
e.extract[1].slice(e.column) + '');
}
elem.innerHTML = content;
// CSS for error messages
createCSS([
'.less-error-message ul, .less-error-message li {',
'list-style-type: none;',
'margin-right: 15px;',
'padding: 4px 0;',
'margin: 0;',
'}',
'.less-error-message label {',
'font-size: 12px;',
'margin-right: 15px;',
'padding: 4px 0;',
'color: #cc7777;',
'}',
'.less-error-message pre {',
'color: #ee4444;',
'padding: 4px 0;',
'margin: 0;',
'display: inline-block;',
'}',
'.less-error-message pre.ctx {',
'color: #dd4444;',
'}',
'.less-error-message h3 {',
'font-size: 20px;',
'font-weight: bold;',
'padding: 15px 0 5px 0;',
'margin: 0;',
'}',
'.less-error-message a {',
'color: #10a',
'}',
'.less-error-message .error {',
'color: red;',
'font-weight: bold;',
'padding-bottom: 2px;',
'border-bottom: 1px dashed red;',
'}'
].join('\n'), { title: 'error-message' });
elem.style.cssText = [
"font-family: Arial, sans-serif",
"border: 1px solid #e00",
"background-color: #eee",
"border-radius: 5px",
"-webkit-border-radius: 5px",
"-moz-border-radius: 5px",
"color: #e00",
"padding: 15px",
"margin-bottom: 15px"
].join(';');
if (less.env == 'development') {
timer = setInterval(function () {
if (document.body) {
if (document.getElementById(id)) {
document.body.replaceChild(elem, document.getElementById(id));
} else {
document.body.insertBefore(elem, document.body.firstChild);
}
clearInterval(timer);
}
}, 10);
}
}
})(window);
less.js-1.4.2/dist/less-1.1.0.min.js 0000664 0000000 0000000 00000102533 12172566422 0016576 0 ustar 00root root 0000000 0000000 //
// LESS - Leaner CSS v1.1.0
// http://lesscss.org
//
// Copyright (c) 2009-2011, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
//
// LESS - Leaner CSS v1.1.0
// http://lesscss.org
//
// Copyright (c) 2009-2011, Alexis Sellier
// Licensed under the Apache 2.0 License.
//
(function(a,b){function v(a,b){var c="less-error-message:"+p(b),e=["",'{0}
',"{current}
",'{2}
',"
"].join("\n"),f=document.createElement("div"),g,h;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+"
"+''+b+" ",a.extract&&(h+="on line "+a.line+", column "+(a.column+1)+":
"+e.replace(/\[(-?\d)\]/g,function(b,c){return parseInt(a.line)+parseInt(c)||""}).replace(/\{(\d)\}/g,function(b,c){return a.extract[parseInt(c)]||""}).replace(/\{current\}/,a.extract[1].slice(0,a.column)+''+a.extract[1].slice(a.column)+"")),f.innerHTML=h,q([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function u(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function t(a){return a&&a.parentNode.removeChild(a)}function s(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){u("browser doesn't support AJAX.");return null}}function r(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var f=s(),h=g?!1:d.async;typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/css"),f.open("GET",a,h),f.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),f.send(null),g?f.status===0?c(f.responseText):e(f.status,a):h?f.onreadystatechange=function(){f.readyState==4&&i(f,c,e)}:i(f,c,e)}function q(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||p(e));(d=document.getElementById(f))===null&&(d=document.createElement("style"),d.type="text/css",d.media=b.media||"screen",d.id=f,document.getElementsByTagName("head")[0].appendChild(d));if(d.styleSheet)try{d.styleSheet.cssText=a}catch(g){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&h&&(u("saving "+e+" to cache."),h.setItem(e,a),h.setItem(e+":timestamp",c))}function p(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function o(b,c,e,f){var g=a.location.href.replace(/[#?].*$/,""),i=b.href.replace(/\?.*$/,""),j=h&&h.getItem(i),k=h&&h.getItem(i+":timestamp"),l={css:j,timestamp:k};/^(https?|file):/.test(i)||(i.charAt(0)=="/"?i=a.location.protocol+"//"+a.location.host+i:i=g.slice(0,g.lastIndexOf("/")+1)+i),r(b.href,b.type,function(a,g){if(!e&&l&&g&&(new Date(g)).valueOf()===(new Date(l.timestamp)).valueOf())q(l.css,b),c(null,b,{local:!0,remaining:f});else try{(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/,"")],mime:b.type})).parse(a,function(a,d){if(a)return v(a,i);try{c(d,b,{local:!1,lastModified:g,remaining:f}),t(document.getElementById("less-error-message:"+p(i)))}catch(a){v(a,i)}})}catch(h){v(h,i)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function n(a,b){for(var c=0;c>>0;for(var d=0;d>>0,c=Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else for(;;){if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}for(;c=b)return-1;c<0&&(c+=b);for(;ck&&(j[f]=j[f].slice(c-k),k=c)}function q(){j[f]=g,c=h,k=c}function p(){g=j[f],h=c,k=c}var b,c,f,g,h,i,j,k,l,m=this,n=function(){},o=this.imports={paths:a&&a.paths||[],queue:[],files:{},mime:a&&a.mime,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=a,c(a),e.queue.length===0&&n()},a)}};this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null;return l={imports:o,parse:function(d,g){var h,l,m,o,p,q,r=[],t,u=null;c=f=k=i=0,j=[],b=d.replace(/\r\n/g,"\n"),j=function(c){var d=0,e=/[^"'`\{\}\/\(\)]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=0,h,i=c[0],j,k;for(var l=0,m,n;l0)throw{type:"Syntax",message:"Missing closing `}`",filename:a.filename};return c.map(function(a){return a.join("")})}([[]]),h=new e.Ruleset([],s(this.parsers.primary)),h.root=!0,h.toCSS=function(c){var d,f,g;return function(g,h){function n(a){return a?(b.slice(0,a).match(/\n/g)||"").length:null}var i=[];g=g||{},typeof h=="object"&&!Array.isArray(h)&&(h=Object.keys(h).map(function(a){var b=h[a];b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b]));return new e.Rule("@"+a,b,!1,0)}),i=[new e.Ruleset(null,h)]);try{var j=c.call(this,{frames:i}).toCSS([],{compress:g.compress||!1})}catch(k){f=b.split("\n"),d=n(k.index);for(var l=k.index,m=-1;l>=0&&b.charAt(l)!=="\n";l--)m++;throw{type:k.type,message:k.message,filename:a.filename,index:k.index,line:typeof d=="number"?d+1:null,callLine:k.call&&n(k.call)+1,callExtract:f[n(k.call)],stack:k.stack,column:m,extract:[f[d-1],f[d],f[d+1]]}}return g.compress?j.replace(/(\s)+/g,"$1"):j}}(h.eval);if(c=0&&b.charAt(v)!=="\n";v--)w++;u={name:"ParseError",message:"Syntax Error on line "+p,index:c,filename:a.filename,line:p,column:w,extract:[q[p-2],q[p-1],q[p]]}}this.imports.queue.length>0?n=function(){g(u,h)}:g(u,h)},parsers:{primary:function(){var a,b=[];while((a=s(this.mixin.definition)||s(this.rule)||s(this.ruleset)||s(this.mixin.call)||s(this.comment)||s(this.directive))||s(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(c)==="/"){if(b.charAt(c+1)==="/")return new e.Comment(s(/^\/\/.*/),!0);if(a=s(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)}},entities:{quoted:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==='"'||b.charAt(d)==="'"){f&&s("~");if(a=s(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],f)}},keyword:function(){var a;if(a=s(/^[A-Za-z-]+/))return new e.Keyword(a)},call:function(){var a,b;if(!!(a=/^([\w-]+|%)\(/.exec(j[f]))){a=a[1].toLowerCase();if(a==="url")return null;c+=a.length;if(a==="alpha")return s(this.alpha);s("("),b=s(this.entities.arguments);if(!s(")"))return;if(a)return new e.Call(a,b)}},arguments:function(){var a=[],b;while(b=s(this.expression)){a.push(b);if(!s(","))break}return a},literal:function(){return s(this.entities.dimension)||s(this.entities.color)||s(this.entities.quoted)},url:function(){var a;if(b.charAt(c)==="u"&&!!s(/^url\(/)){a=s(this.entities.quoted)||s(this.entities.variable)||s(this.entities.dataURI)||s(/^[-\w%@$\/.&=:;#+?~]+/)||"";if(!s(")"))throw new Error("missing closing ) for url()");return new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),o.paths)}},dataURI:function(){var a;if(s(/^data:/)){a={},a.mime=s(/^[^\/]+\/[^,;)]+/)||"",a.charset=s(/^;\s*charset=[^,;)]+/)||"",a.base64=s(/^;\s*base64/)||"",a.data=s(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var a,d=c;if(b.charAt(c)==="@"&&(a=s(/^@@?[\w-]+/)))return new e.Variable(a,d)},color:function(){var a;if(b.charAt(c)==="#"&&(a=s(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,d=b.charCodeAt(c);if(!(d>57||d<45||d===47))if(a=s(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==="`"){f&&s("~");if(a=s(/^`([^`]*)`/))return new e.JavaScript(a[1],c,f)}}},variable:function(){var a;if(b.charAt(c)==="@"&&(a=s(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!!t(/^[@\w.%-]+\/[@\w.-]+/)&&(a=s(this.entity))&&s("/")&&(b=s(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var a=[],d,f,g,h=c,i=b.charAt(c);if(i==="."||i==="#"){while(d=s(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))a.push(new e.Element(f,d)),f=s(">");s("(")&&(g=s(this.entities.arguments))&&s(")");if(a.length>0&&(s(";")||t("}")))return new e.mixin.Call(a,g,h)}},definition:function(){var a,d=[],f,g,h,i;if(!(b.charAt(c)!=="."&&b.charAt(c)!=="#"||t(/^[^{]*(;|})/)))if(f=s(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=f[1];while(h=s(this.entities.variable)||s(this.entities.literal)||s(this.entities.keyword)){if(h instanceof e.Variable)if(s(":"))if(i=s(this.expression))d.push({name:h.name,value:i});else throw new Error("Expected value");else d.push({name:h.name});else d.push({value:h});if(!s(","))break}if(!s(")"))throw new Error("Expected )");g=s(this.block);if(g)return new e.mixin.Definition(a,d,g)}}},entity:function(){return s(this.entities.literal)||s(this.entities.variable)||s(this.entities.url)||s(this.entities.call)||s(this.entities.keyword)||s(this.entities.javascript)||s(this.comment)},end:function(){return s(";")||t("}")},alpha:function(){var a;if(!!s(/^opacity=/i))if(a=s(/^\d+/)||s(this.entities.variable)){if(!s(")"))throw new Error("missing closing ) for alpha()");return new e.Alpha(a)}},element:function(){var a,b,c;c=s(this.combinator),a=s(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||s("*")||s(this.attribute)||s(/^\([^)@]+\)/);if(a)return new e.Element(c,a)},combinator:function(){var a,d=b.charAt(c);if(d===">"||d==="&"||d==="+"||d==="~"){c++;while(b.charAt(c)===" ")c++;return new e.Combinator(d)}if(d===":"&&b.charAt(c+1)===":"){c+=2;while(b.charAt(c)===" ")c++;return new e.Combinator("::")}return b.charAt(c-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,d,f=[],g,h;while(d=s(this.element)){g=b.charAt(c),f.push(d);if(g==="{"||g==="}"||g===";"||g===",")break}if(f.length>0)return new e.Selector(f)},tag:function(){return s(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||s("*")},attribute:function(){var a="",b,c,d;if(!!s("[")){if(b=s(/^[a-zA-Z-]+/)||s(this.entities.quoted))(d=s(/^[|~*$^]?=/))&&(c=s(this.entities.quoted)||s(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!s("]"))return;if(a)return"["+a+"]"}},block:function(){var a;if(s("{")&&(a=s(this.primary))&&s("}"))return a},ruleset:function(){var a=[],b,d,g;p();if(g=/^([.#: \w-]+)[\s\n]*\{/.exec(j[f]))c+=g[0].length-1,a=[new e.Selector([new e.Element(null,g[1])])];else while(b=s(this.selector)){a.push(b),s(this.comment);if(!s(","))break;s(this.comment)}if(a.length>0&&(d=s(this.block)))return new e.Ruleset(a,d);i=c,q()},rule:function(){var a,d,g=b.charAt(c),k,l;p();if(g!=="."&&g!=="#"&&g!=="&")if(a=s(this.variable)||s(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(j[f]))?(c+=l[0].length-1,d=new e.Anonymous(l[1])):a==="font"?d=s(this.font):d=s(this.value),k=s(this.important);if(d&&s(this.end))return new e.Rule(a,d,k,h);i=c,q()}},"import":function(){var a;if(s(/^@import\s+/)&&(a=s(this.entities.quoted)||s(this.entities.url))&&s(";"))return new e.Import(a,o)},directive:function(){var a,d,f,g;if(b.charAt(c)==="@"){if(d=s(this["import"]))return d;if(a=s(/^@media|@page|@-[-a-z]+/)){g=(s(/^[^{]+/)||"").trim();if(f=s(this.block))return new e.Directive(a+" "+g,f)}else if(a=s(/^@[-a-z]+/))if(a==="@font-face"){if(f=s(this.block))return new e.Directive(a,f)}else if((d=s(this.entity))&&s(";"))return new e.Directive(a,d)}},font:function(){var a=[],b=[],c,d,f,g;while(g=s(this.shorthand)||s(this.entity))b.push(g);a.push(new e.Expression(b));if(s(","))while(g=s(this.expression)){a.push(g);if(!s(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=s(this.expression)){b.push(a);if(!s(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(c)==="!")return s(/^! *important/)},sub:function(){var a;if(s("(")&&(a=s(this.expression))&&s(")"))return a},multiplication:function(){var a,b,c,d;if(a=s(this.operand)){while((c=s("/")||s("*"))&&(b=s(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,d,f,g;if(a=s(this.multiplication)){while((f=s(/^[-+]\s+/)||b.charAt(c-1)!=" "&&(s("+")||s("-")))&&(d=s(this.multiplication)))g=new e.Operation(f,[g||a,d]);return g||a}},operand:function(){var a,d=b.charAt(c+1);b.charAt(c)==="-"&&(d==="@"||d==="(")&&(a=s("-"));var f=s(this.sub)||s(this.entities.dimension)||s(this.entities.color)||s(this.entities.variable)||s(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),f]):f},expression:function(){var a,b,c=[],d;while(a=s(this.addition)||s(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=s(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}},typeof a!="undefined"&&(d.Parser.importer=function(a,b,c,d){a.charAt(0)!=="/"&&b.length>0&&(a=b[0]+a),o({href:a,title:a,type:d.mime},c,!0)}),function(a){function d(a){return Math.min(1,Math.max(0,a))}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();e.s+=c.value/100,e.s=d(e.s);return b(e)},desaturate:function(a,c){var e=a.toHSL();e.s-=c.value/100,e.s=d(e.s);return b(e)},lighten:function(a,c){var e=a.toHSL();e.l+=c.value/100,e.l=d(e.l);return b(e)},darken:function(a,c){var e=a.toHSL();e.l-=c.value/100,e.l=d(e.l);return b(e)},fadein:function(a,c){var e=a.toHSL();e.a+=c.value/100,e.a=d(e.a);return b(e)},fadeout:function(a,c){var e=a.toHSL();e.a-=c.value/100,e.a=d(e.a);return b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;d.h=e<0?360+e:e;return b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b":a.compress?">":" > "}[this.value]}}(c("less/tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value[0].eval(b)},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(" ")}}}(c("less/tree")),function(a){a.Import=function(b,c){var d=this;this._path=b,b instanceof a.Quoted?this.path=/\.(le?|c)ss$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css$/.test(this.path),this.css||c.push(this.path,function(a){if(!a)throw new Error("Error parsing "+d.path);d.root=a})},a.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var c;if(this.css)return this;c=new a.Ruleset(null,this.root.rules.slice(0));for(var d=0;d0){for(var f=0;f0&&c>this.params.length)return!1;d=Math.min(c,this.arity);for(var e=0;e1?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}});return this._lookups[g]=d},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;if(!this.root)if(b.length===0)g=this.selectors.map(function(a){return[a]});else for(var j=0;j0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":g.length>3?",\n":", "),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f);return d.join("")+(c.compress?"\n":"")}}}(c("less/tree")),function(a){a.Selector=function(a){this.elements=a,this.elements[0].combinator.value===""&&(this.elements[0].combinator.value=" ")},a.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?!0:!1},a.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(b){return typeof b=="string"?" "+b.trim():b.toCSS(a)}).join("")}}(c("less/tree")),function(b){b.URL=function(b,c){b.data?this.attrs=b:(!/^(?:https?:\/|file:\/|data:\/)?\//.test(b.value)&&c.length>0&&typeof a!="undefined"&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("less/tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("less/tree")),function(a){a.Variable=function(a,b){this.name=a,this.index=b},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{message:"variable "+e+" is undefined",index:this.index}}}}(c("less/tree")),c("less/tree").find=function(a,b){for(var c=0,d;c0||g?"development":"production"),d.async=!1,d.poll=d.poll||(g?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&n(function(a,b,c){a&&q(a.toCSS(),b,c.lastModified)})},d.poll)):d.optimization=3;var h;try{h=typeof a.localStorage=="undefined"?null:a.localStorage}catch(i){h=null}var j=document.getElementsByTagName("link"),k=/^text\/(x-)?less$/;d.sheets=[];for(var l=0;l