1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Fix a whole bunch of spurious failures caused by SassScript-with-colon.

This commit is contained in:
Nathan Weizenbaum 2010-03-26 17:02:26 -07:00
parent cbdf251b20
commit 2c340b1e4c
12 changed files with 37 additions and 30 deletions

View file

@ -1,6 +1,6 @@
<style>
/* line 1 */
p { border-style: dotted; border-width: 22px; border-color: #ff00ff; }
p { border-style: dotted; border-width: 22px; border-color: fuchsia; }
/* line 6 */
h1 { font-weight: normal; }

View file

@ -394,7 +394,7 @@ CSS
opts = {:full_exception => true}
render(<<SASS, opts)
.filler
stuff: stuff!
stuff: "stuff!"
a: b
@ -408,7 +408,7 @@ Syntax error: Properties aren't allowed at the root of a document.
on line 4 of test_cssize_exception_css_inline.sass
1: .filler
2: stuff: stuff!
2: stuff: "stuff!"
3:
4: a: b
5:
@ -454,7 +454,13 @@ WARN
end
def test_default_function
assert_equal("foo {\n bar: url(foo.png); }\n", render(%Q{foo\n bar = url("foo.png")\n}));
assert_equal(<<CSS, render(<<SASS))
foo {
bar: url("foo.png"); }
CSS
foo
bar = url("foo.png")
SASS
assert_equal("foo {\n bar: url(); }\n", render("foo\n bar = url()\n"));
end

View file

@ -24,6 +24,6 @@ body { font: Arial; background: blue; }
@import url(basic.css);
@import url(../results/complex.css);
#foo { background-color: #baf; }
#foo { background-color: #bbaaff; }
nonimported { myconst: hello; otherconst: goodbye; post-mixin: here; }

View file

@ -1,4 +1,4 @@
#main { width: 15em; color: #0000ff; }
#main { width: 15em; color: blue; }
#main p { border-style: dotted; /* Nested comment More nested stuff */ border-width: 2px; }
#main .cool { width: 100px; }

View file

@ -1,10 +1,10 @@
body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: #fff; background: url(/images/global_bg.gif); }
body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; color: white; background: url(/images/global_bg.gif); }
#page { width: 900px; margin: 0 auto; background: #440008; border-top-width: 5px; border-top-style: solid; border-top-color: #ff8500; }
#header { height: 75px; padding: 0; }
#header h1 { float: left; width: 274px; height: 75px; margin: 0; background-image: url(/images/global_logo.gif); /* Crazy nested comment */ background-repeat: no-repeat; text-indent: -9999px; }
#header .status { float: right; padding-top: .5em; padding-left: .5em; padding-right: .5em; padding-bottom: 0; }
#header .status { float: right; padding-top: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-bottom: 0; }
#header .status p { float: left; margin-top: 0; margin-right: 0.5em; margin-bottom: 0; margin-left: 0; }
#header .status ul { float: left; margin: 0; padding: 0; }
#header .status li { list-style-type: none; display: inline; margin: 0 5px; }
@ -16,9 +16,9 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
#menu { clear: both; text-align: right; height: 20px; border-bottom: 5px solid #006b95; background: #00a4e4; }
#menu .contests ul { margin: 0 5px 0 0; padding: 0; }
#menu .contests ul li { list-style-type: none; margin: 0 5px; padding: 5px 5px 0 5px; display: inline; font-size: 1.1em; color: #fff; background: #00a4e4; }
#menu .contests ul li { list-style-type: none; margin: 0 5px; padding: 5px 5px 0 5px; display: inline; font-size: 1.1em; color: white; background: #00a4e4; }
#menu .contests ul li / This rule isn't a comment! { red: green; }
#menu .contests a:link, #menu .contests a:visited { color: #fff; text-decoration: none; font-weight: bold; }
#menu .contests a:link, #menu .contests a:visited { color: white; text-decoration: none; font-weight: bold; }
#menu .contests a:hover { text-decoration: underline; }
#content { clear: both; }
@ -82,6 +82,6 @@ body { margin: 0; font: 0.85em "Lucida Grande", "Trebuchet MS", Verdana, sans-se
img { border: none; }
button.short { width: 60px; height: 22px; padding: 0 0 2px 0; color: #fff; border: none; background: url(/images/btn_short.gif) no-repeat; }
button.short { width: 60px; height: 22px; padding: 0 0 2px 0; color: white; border: none; background: url(/images/btn_short.gif) no-repeat; }
table { border-collapse: collapse; }

View file

@ -1 +1 @@
#main{width:15em;color:#0000ff}#main p{border-style:dotted;border-width:2px}#main .cool{width:100px}#left{font-size:2em;font-weight:bold;float:left}
#main{width:15em;color:blue}#main p{border-style:dotted;border-width:2px}#main .cool{width:100px}#left{font-size:2em;font-weight:bold;float:left}

View file

@ -1,6 +1,6 @@
#main {
width: 15em;
color: #0000ff;
color: blue;
}
#main p {
border-style: dotted;

View file

@ -26,6 +26,6 @@ body { font: Arial; background: blue; }
@import url(basic.css);
@import url(../results/complex.css);
#foo { background-color: #baf; }
#foo { background-color: #bbaaff; }
nonimported { myconst: hello; otherconst: goodbye; post-mixin: here; }

View file

@ -1,12 +1,12 @@
#main {
width: 15em;
color: #0000ff;
color: blue;
}
#main p {
border-top-width: 2px;
border-top-color: #ffcc00;
border-left-width: 1px;
border-left-color: #000;
border-left-color: black;
-moz-border-radius: 10px;
border-style: dotted;
border-width: 2px;
@ -19,7 +19,7 @@
border-top-width: 2px;
border-top-color: #ffcc00;
border-left-width: 1px;
border-left-color: #000;
border-left-color: black;
-moz-border-radius: 10px;
font-size: 2em;
font-weight: bold;
@ -30,9 +30,9 @@
border-top-width: 2px;
border-top-color: #ffcc00;
border-left-width: 1px;
border-left-color: #000;
border-left-color: black;
-moz-border-radius: 10px;
color: #f00;
color: red;
font-size: 20px;
float: right;
}
@ -41,12 +41,12 @@
border-top-width: 2px;
border-top-color: #ffcc00;
border-left-width: 1px;
border-left-color: #000;
border-left-color: black;
-moz-border-radius: 10px;
}
.complex {
color: #f00;
color: red;
font-size: 20px;
text-decoration: none;
}
@ -59,12 +59,12 @@
}
* html .complex {
height: 1px;
color: #f00;
color: red;
font-size: 20px;
}
.more-complex {
color: #f00;
color: red;
font-size: 20px;
text-decoration: none;
display: inline;
@ -80,16 +80,16 @@
}
* html .more-complex {
height: 1px;
color: #f00;
color: red;
font-size: 20px;
}
.more-complex a:hover {
text-decoration: underline;
color: #f00;
color: red;
font-size: 20px;
border-top-width: 2px;
border-top-color: #ffcc00;
border-left-width: 1px;
border-left-color: #000;
border-left-color: black;
-moz-border-radius: 10px;
}

View file

@ -1,6 +1,6 @@
#main {
width: 15em;
color: #0000ff; }
color: blue; }
#main p {
border-style: dotted;
/* Nested comment

View file

@ -1,4 +1,4 @@
#main { content: Hello!; qstr: Quo"ted"!; hstr: Hyph-en!; width: 30em; background-color: #000; color: #ffffaa; short-color: #112233; named-color: olive; con: foo bar(9 hi there boom); con2: noquo quo; }
#main { content: Hello!; qstr: Quo"ted"!; hstr: Hyph-en!; width: 30em; background-color: black; color: #ffffaa; short-color: #112233; named-color: olive; con: foo bar(9 hi there boom); con2: noquo quo; }
#main #sidebar { background-color: #00ff98; num-normal: 10; num-dec: 10.2; num-dec0: 99; num-neg: -10; esc: 10 +12; many: 6; order: 7; complex: #4c9db1hi16; }
#plus { num-num: 7; num-num-un: 25em; num-num-un2: 23em; num-num-neg: 9.87; num-str: 100px; num-col: #b7b7b7; num-perc: 31%; str-str: hi there; str-str2: hi there; str-col: 14em solid #112233; str-num: times: 13; col-num: #ff7b9d; col-col: #5173ff; }

View file

@ -311,13 +311,14 @@ SCSS
def test_almost_ambiguous_nested_rules_and_declarations
assert_equal <<CSS, render(<<SCSS)
foo {
bar: baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses;
bar: baz bang bop biddle woo look at all these elems; }
foo bar:baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses {
a: b; }
foo bar:baz bang bop biddle woo look at all these elems {
a: b; }
CSS
foo {
bar:baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses;
bar:baz:bang:bop:biddle:woo:look:at:all:these:pseudoclasses {a: b};
bar:baz bang bop biddle woo look at all these elems {a: b};
bar:baz bang bop biddle woo look at all these elems; }
SCSS