checkpoint comments

This commit is contained in:
jtm
2012-02-27 18:48:20 +00:00
parent 8e9c83a3f9
commit 4ab5c1dfae
6 changed files with 206 additions and 8 deletions

View File

@@ -205,13 +205,14 @@ class LessParser(object):
p[0] = p[1].parse(self.scope)
self.scope.current = p[1].real
def p_media_open(self, p):
""" block_open : css_media t_ws identifier brace_open
"""
ident = [p[1], p[2]]
ident.extend(p[3].tokens)
p[3].tokens = ident
p[0] = p[3]
# def p_media_open(self, p):
# """ block_open : css_media t_ws identifier brace_open
# """
# identifier = [p[1], p[2]]
# identifier.extend(p[3].tokens)
# p[3].tokens = identifier
# p[0] = p[3].parse(self.scope)
# self.scope.current = p[3].real
def p_font_face_open(self, p):
""" block_open : css_font_face t_ws brace_open
@@ -354,7 +355,8 @@ class LessParser(object):
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#
def p_identifier(self, p):
""" identifier : identifier_list
"""
@@ -404,6 +406,11 @@ class LessParser(object):
p[1] = [p[1]]
p[0] = p[1]
def p_ident_media(self, p):
""" ident_parts : css_media t_ws
"""
p[0] = list(p)[1:]
def p_selector(self, p):
""" selector : '*'
| '+'
@@ -417,6 +424,7 @@ class LessParser(object):
| id
| dom
| combinator
| color
"""
p[0] = p[1]

View File

@@ -0,0 +1,17 @@
#comments {
color: red;
background-color: orange;
font-size: 12px;
content: "content";
border: 1px solid black;
padding: 0;
margin: 2em;
}
.selector, .lots, .comments {
color: grey, orange;
-webkit-border-radius: 2px ;
-moz-border-radius: 8px;
}
#last {
color: blue;
}

3
lesscpy/test/css/comments.min.css vendored Normal file
View File

@@ -0,0 +1,3 @@
#comments{color:red;background-color:orange;font-size:12px;content:"content";border:1px solid black;padding:0;margin:2em;}
.selector,.lots,.comments{color:grey,orange;-webkit-border-radius:2px ;-moz-border-radius:8px;}
#last{color:blue;}

View File

@@ -0,0 +1,67 @@
/*
Less colors
*/
#yellow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
#argb {
color: argb(rgba(255, 238, 170, 0.1));
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
#argb {
color: argb(rgba(0, 0, 255, 0.1));
}
}
#alpha #hsla {
color: hsla(11, 20%, 20%, 0.6);
}
#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);
}
/*
Colors as ID's
*/
#808080 {
color: hsl(50, 0%, 50%);
}
#00ff00 {
color: hsl(120, 100%, 50%);
}
/*
color functions
*/
.color_functions {
lighten: lighten(#ff0000, 40%);
darken: darken(#ff0000, 40%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
spin-p: spin(hsl(340, 50%, 50%), 40);
spin-n: spin(hsl(30, 50%, 50%), -40);
hue: hue(hsl(98, 12%, 95%));
saturation: saturation(hsl(98, 12%, 95%));
lightness: lightness(hsl(98, 12%, 95%));
}

View File

@@ -0,0 +1,65 @@
/******************\
* *
* 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;
}
*/
.selector /* .with */, .lots, /* of */ .comments {
color: grey, /* blue */ orange;
-webkit-border-radius: 2px /* webkit only */;
-moz-border-radius: 2px * 4 /* moz only with operation */;
}
#last { color: blue; }
//

View File

@@ -0,0 +1,38 @@
/*
CSS media groups
*/
@media screen, projection {
html {
background: #fffef0;
color: #300;
}
body {
max-width: 35em;
margin: 0 auto;
}
}
/*
Variables
*/
@media print {
@var: 42;
.class {
color: blue;
.sub {
width: @var;
}
}
.top, header > h1 {
color: #222 * 2;
}
}
@media screen {
@base: 8;
body { max-width: @base * 60; }
}
/*
pseudo
*/
@media all and (orientation:portrait) {
aside { float: none; }
}