From 613eff4f0343c9132d139b4bd36e7385d86960bc Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sat, 24 Sep 2016 20:17:35 +0200 Subject: [PATCH] Add more sass spec tests --- spec/sass/bem/expected_output.css | 6 +++++ spec/sass/bem/input.sass | 9 +++++++ spec/sass/extend/expected_output.css | 13 +++++++++ spec/sass/extend/input.sass | 15 +++++++++++ spec/sass/functions/expected_output.css | 2 ++ spec/sass/functions/input.sass | 8 ++++++ spec/sass/mixins/expected_output.css | 18 +++++++++++++ spec/sass/mixins/input.sass | 35 +++++++++++++++++++++++++ spec/sass/pseudo/expected_output.css | 23 ++++++++++++++++ spec/sass/pseudo/input.sass | 18 +++++++++++++ spec/sass/selectors/expected_output.css | 15 +++++++++++ spec/sass/selectors/input.sass | 21 +++++++++++++++ 12 files changed, 183 insertions(+) create mode 100644 spec/sass/bem/expected_output.css create mode 100644 spec/sass/bem/input.sass create mode 100644 spec/sass/extend/expected_output.css create mode 100644 spec/sass/extend/input.sass create mode 100644 spec/sass/functions/expected_output.css create mode 100644 spec/sass/functions/input.sass create mode 100644 spec/sass/mixins/expected_output.css create mode 100644 spec/sass/mixins/input.sass create mode 100644 spec/sass/pseudo/expected_output.css create mode 100644 spec/sass/pseudo/input.sass create mode 100644 spec/sass/selectors/expected_output.css create mode 100644 spec/sass/selectors/input.sass diff --git a/spec/sass/bem/expected_output.css b/spec/sass/bem/expected_output.css new file mode 100644 index 0000000000..94af59740a --- /dev/null +++ b/spec/sass/bem/expected_output.css @@ -0,0 +1,6 @@ +.testing { + margin-bottom: 32px; + margin-foobar-bar: 1px; + margin-foobar-baz: 2px; + margin-hover-baz: 3px; + end: 4px; } diff --git a/spec/sass/bem/input.sass b/spec/sass/bem/input.sass new file mode 100644 index 0000000000..48716ccd3c --- /dev/null +++ b/spec/sass/bem/input.sass @@ -0,0 +1,9 @@ +.testing + :margin + :bottom 32px + :foobar + :bar 1px + :baz 2px + :hover + :baz 3px + :end 4px \ No newline at end of file diff --git a/spec/sass/extend/expected_output.css b/spec/sass/extend/expected_output.css new file mode 100644 index 0000000000..f0679be4da --- /dev/null +++ b/spec/sass/extend/expected_output.css @@ -0,0 +1,13 @@ +.error, .seriousError, .criticalError { + border: 1px #f00; + background-color: #fdd; } + +.seriousError, .criticalError { + border-width: 3px; } + +.criticalError { + position: fixed; + top: 10%; + bottom: 10%; + left: 10%; + right: 10%; } diff --git a/spec/sass/extend/input.sass b/spec/sass/extend/input.sass new file mode 100644 index 0000000000..b55d335088 --- /dev/null +++ b/spec/sass/extend/input.sass @@ -0,0 +1,15 @@ +.error + border: 1px #f00 + background-color: #fdd + +.seriousError + @extend .error + border-width: 3px + +.criticalError + @extend .seriousError + position: fixed + top: 10% + bottom: 10% + left: 10% + right: 10% diff --git a/spec/sass/functions/expected_output.css b/spec/sass/functions/expected_output.css new file mode 100644 index 0000000000..a37b5996e9 --- /dev/null +++ b/spec/sass/functions/expected_output.css @@ -0,0 +1,2 @@ +#sidebar { + width: 240px; } diff --git a/spec/sass/functions/input.sass b/spec/sass/functions/input.sass new file mode 100644 index 0000000000..53a143ea34 --- /dev/null +++ b/spec/sass/functions/input.sass @@ -0,0 +1,8 @@ +$grid-width: 40px +$gutter-width: 10px + +@function grid-width($n) + @return $n * $grid-width + ($n - 1) * $gutter-width + +#sidebar + width: grid-width(5) \ No newline at end of file diff --git a/spec/sass/mixins/expected_output.css b/spec/sass/mixins/expected_output.css new file mode 100644 index 0000000000..057ba136fc --- /dev/null +++ b/spec/sass/mixins/expected_output.css @@ -0,0 +1,18 @@ +input { + color: blue; + background: red; } + +* html #logo { + background-image: url(/logo.gif); } + +.a + .c, .a + .b { + margin: 10px; + mix: in; } + +.a { + mix: in; } + .a + b .c, .a + b .b { + margin: 10px; } + +.a > .c, .a > .b { + margin: 10px; } diff --git a/spec/sass/mixins/input.sass b/spec/sass/mixins/input.sass new file mode 100644 index 0000000000..0a2e42c426 --- /dev/null +++ b/spec/sass/mixins/input.sass @@ -0,0 +1,35 @@ +=mixme + color: blue + +input + +mixme + background: red + +=apply-to-ie6-only + * html + @content + ++apply-to-ie6-only + #logo + background-image: url(/logo.gif) + +@mixin inc() + mix: in + +.a + + + .c, .b + margin: 10px + +inc + +.a + +inc + + b + .c, .b + margin: 10px + + +.a + > + .c, .b + margin: 10px diff --git a/spec/sass/pseudo/expected_output.css b/spec/sass/pseudo/expected_output.css new file mode 100644 index 0000000000..ad0110a29e --- /dev/null +++ b/spec/sass/pseudo/expected_output.css @@ -0,0 +1,23 @@ +::selection { + color: rebeccapurple; } + +::-webkit-selection { + color: rebeccapurple; } + +::-webkit-selection, ::selection { + color: rebeccapurple; } + +:-webkit-selection { + color: rebeccapurple; } + +:hover TD { + color: red; } + +:color red { + foo: bar; } + +:left DF { + hover-foo: bar; } + +:nth-child(2n+1) SPAN { + foo: bar; } diff --git a/spec/sass/pseudo/input.sass b/spec/sass/pseudo/input.sass new file mode 100644 index 0000000000..df436fee49 --- /dev/null +++ b/spec/sass/pseudo/input.sass @@ -0,0 +1,18 @@ +::selection + color: rebeccapurple +::-webkit-selection + color: rebeccapurple +::-webkit-selection, ::selection + color: rebeccapurple +\:-webkit-selection + color: rebeccapurple + +\:hover TD + color: red +\:color red + foo: bar +\:left DF + :hover + foo: bar +\:nth-child(2n+1) SPAN + foo: bar diff --git a/spec/sass/selectors/expected_output.css b/spec/sass/selectors/expected_output.css new file mode 100644 index 0000000000..8fe13bdcfb --- /dev/null +++ b/spec/sass/selectors/expected_output.css @@ -0,0 +1,15 @@ +.test { + foo: bar; } + .test ~ { + tilde: true; } + .test + { + adjancent: true; } + .test > { + child: true; } + .test * { + universal: true; } + .test [foo] { + attribute: true; } + +.selector-0 + .selector-1 { + color: rebeccapurple; } diff --git a/spec/sass/selectors/input.sass b/spec/sass/selectors/input.sass new file mode 100644 index 0000000000..22f1d09577 --- /dev/null +++ b/spec/sass/selectors/input.sass @@ -0,0 +1,21 @@ +.test + foo: bar + ~ + tilde: true + + + adjancent: true + > + child: true + * + universal: true + [foo] + attribute: true + +@mixin selector-2() + foo: bar + +.selector-0 + + .selector-1 + color: rebeccapurple + = selector-2 + color: yellow