diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..bdb0cabc --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.travis.yml b/.travis.yml index 4d069b5b..84cee502 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,4 @@ php: # - hhvm script: - - phpunit tests + - phpunit tests \ No newline at end of file diff --git a/README.md b/README.md index 0d09fde2..a3cd119c 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,55 @@ you can run the following command to rebuild all the tests: BUILD=true phpunit tests This will compile all the tests, and save results into `tests/outputs`. + +## (optional) Output SCSS line numbers + +Now you can output the original SCSS line numbers within the compiled CSS file for better frontend debugging. + +Works great in combination with frontend debugging tools like https://addons.mozilla.org/de/firefox/addon/firecompass-for-firebug/ + +To activate this feature you need to call `->setLineNumbers(true)` after creating a new instance of class 'compiler'. + +code sample: + + namespace Leafo\ScssPhp; + + use Leafo\ScssPhp\Server; + use \Leafo\ScssPhp\Compiler; + + require "lib/scssphp/scss.inc.php"; + + $directory = "css"; + + $scss = new Compiler(); + $scss->setLineNumbers(true); + + $server = new Server($directory, null, $scss); + $server->serve(); + + +You can also call the 'compile' method directly (without using an instance of 'server' like above) + + namespace Leafo\ScssPhp; + + use Leafo\ScssPhp\Server; + use \Leafo\ScssPhp\Compiler; + + require "lib/scssphp/scss.inc.php"; + + $scss = new Compiler(); + + //the name argument is optional + $scss->setLineNumbers(true,'anyname.scss'); + + echo $scss->compile(' + $color: #abc; + div { color: lighten($color, 20%); } + '); + + +Performance impact is around 10% when a new CSS file is compiled with line numbers, compared to the same file without line numbers. + +**important note:** this feature has only been tested with the standard formatter ('Leafo\ScssPhp\Formatter\Nested'). +Using formatters like "compact" will remove line breaks and frontend debugging tools might have trouble to output the corresponding line from the comment. + diff --git a/scss.inc.php b/scss.inc.php index a49f7c9f..9812e8ee 100644 --- a/scss.inc.php +++ b/scss.inc.php @@ -15,5 +15,6 @@ include_once __DIR__ . '/src/Parser.php'; include_once __DIR__ . '/src/Version.php'; include_once __DIR__ . '/src/Server.php'; + include_once __DIR__ . '/src/LineCommentator.php'; include_once __DIR__ . '/classmap.php'; } diff --git a/src/Compiler.php b/src/Compiler.php index ebd15d6e..a32f2542 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -14,6 +14,7 @@ use Leafo\ScssPhp\Colors; use Leafo\ScssPhp\Parser; +use Leafo\ScssPhp\LineCommentator; /** * The scss compiler and parser. @@ -99,6 +100,9 @@ class Compiler protected $formatter = 'Leafo\ScssPhp\Formatter\Nested'; + protected $lineNumbers = FALSE; + protected $fileName; + /** * Compile scss * @@ -120,6 +124,17 @@ public function compile($code, $name = null) $locale = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, 'C'); + if ($this->isLineNumbers()) { + if (!$name) { + //string given + $code = explode("\n", $code); + $code = LineCommentator::insertLineComments($code, $this->getFileName()); + } else { + //filepath given + $code = LineCommentator::insertLineComments(file($name), $name); + } + } + $this->parser = new Parser($name); $tree = $this->parser->parse($code); @@ -797,7 +812,16 @@ protected function compileChild($child, $out) ); break; case 'comment': - if ($out->type == 'root') { + + if (isset($out->type) && $out->type == 'root') { + $this->compileComment($child); + break; + } + + //do not nest line comments into the parrent block + //for further information on the issue see https://github.com/leafo/scssphp/issues/228 + + if (strpos($child[1], '/* line ') !==FALSE) { $this->compileComment($child); break; } @@ -1959,6 +1983,11 @@ protected function importFile($path, $out) $tree = $this->importCache[$realPath]; } else { $code = file_get_contents($path); + + if ($this->isLineNumbers()) { + $code = LineCommentator::insertLineComments(file($path), $path); + } + $parser = new Parser($path, false); $tree = $parser->parse($code); $this->parsedFiles[] = $path; @@ -3003,4 +3032,45 @@ public function throwError($msg = null) throw new \Exception($msg); } -} + + /* + * check if line number feature is active + * @return boolean + */ + public function isLineNumbers() + { + return $this->lineNumbers; + } + + /** + * use this function to turn line numbers on + * @param boolean $lineNumbers + * @param string $filename + * @return boolean + */ + public function setLineNumbers($lineNumbers, $filename = NULL) + { + $this->lineNumbers = $lineNumbers; + + if ($filename) { + $this->setFileName($filename); + } + } + + /** + * @return string + */ + public function getFileName() + { + return $this->fileName; + } + + /** + * @param string $fileName + */ + public function setFileName($fileName) + { + $this->fileName = $fileName; + } + +} \ No newline at end of file diff --git a/src/LineCommentator.php b/src/LineCommentator.php new file mode 100644 index 00000000..2f894ab6 --- /dev/null +++ b/src/LineCommentator.php @@ -0,0 +1,269 @@ +'; + + const function_indicator = '@function'; + const return_indicator = '@return'; + + const mixin_indicator = '@mixin'; + + const include_indicator = '@include'; + + const if_statement_indicator = '@if'; + const else_statement_indicator = '@else'; + + const loop_indicator_for = "@for"; + const loop_indicator_while = "@while"; + const loop_indicator_each = "@each"; + + const map_indicator = 'map_get'; + + //we use this to indicate that we are currently looping within a multiline comment + static protected $inside_multiline; + + /* insert line number as commentary within the SCSS file + * + * @return string; + */ + + static function insertLineComments($scss, $filepath = '') + { + $lines = $scss; + $new_scss_content = array(); + + $filepath = str_replace('\\', '/', $filepath); + + foreach ($lines as $linenumber => $line) { + + $line = trim($line); + $nextline = trim(next($lines)); + + //check if empty + if (empty($line)) { + continue; + } + + //check if line is a commment + if (self::isComment($line) || self::$inside_multiline) { + $new_scss_content[] = $line; + continue; + } + + //write line numbers for selectors only to reduce overhead + if ( + self::isSelector($line, $nextline) == FALSE || + self::isFunction($line) == TRUE || + self::isMixin($line) == TRUE || + self::isInclude($line) == TRUE || + self::isCondition($line) == TRUE || + self::isLoop($line) == TRUE || + self::isMap($line) == TRUE + ) { + $new_scss_content[] = $line; + continue; + } + + //output line commment + $new_scss_content[] = self::comment_indicator_start . ' line ' . ($linenumber + 1) . ', ' . $filepath . ' ' . self::comment_indicator_end; + $new_scss_content[] = $line; + } + + return implode("\n", $new_scss_content); + } + + /* + * looking for selector block: + * the opening bracket could be in the same line or in the next one (since we've cleaned empty lines) + * also we don't want to confuse a selector block with a property block or write the comment above the bracket + * itself (in case it's in a new line) + * + * @return boolean + */ + + static function isSelector($line, $nextline = NULL) + { + if ( + (strpos($line, self::block_indicator_start) !== FALSE || strpos($nextline, self::block_indicator_start) === 0) + && strpos($line, self::block_indicator_start) !== 0 + ) { + return true; + } + + return false; + + } + + /* + * ignore mixins. mixins will spread inside selectors after compilation + * + * @return: boolean + */ + + static function isMixin($line) + { + if (strpos($line, self::mixin_indicator) !== FALSE) { + return true; + } + + return false; + } + + /* + * ignore functions + * + * @return: boolean + */ + + static function isFunction($line) + { + if + ( + strpos($line, self::function_indicator) !== FALSE || + strpos($line, self::return_indicator) !== FALSE + ) { + return true; + } + + return false; + + } + + /* + * ignore include + * + * @return: boolean + */ + + static function isInclude($line) + { + if (strpos($line, self::include_indicator) !== FALSE) { + return true; + } + + return false; + + } + + /* + * dont't put a line number above if statement, since it will result in an empty line within the + * compiled scss + * + * @return boolean + */ + + static function isCondition($line) + { + if + ( + strpos($line, self::if_statement_indicator) !== FALSE || + strpos($line, self::else_statement_indicator) !== FALSE + ) { + return true; + } + + return false; + + } + + /* + * dont't put a line number above loops, since it will result in an empty line within the + * compiled scss + * + * @return boolean + */ + + static function isLoop($line) + { + if + ( + strpos($line, self::loop_indicator_for) !== FALSE || + strpos($line, self::loop_indicator_each) !== FALSE || + strpos($line, self::loop_indicator_while) !== FALSE + ) { + return true; + } + + return false; + } + + /* + * we don't want to mess around with existing comments since this can easily lead to parsing errors. + * + * @return boolean + */ + + static function isComment($line) + { + /* a comment has started, but did not end in the same line */ + if (strpos($line, self::comment_indicator_start) !== FALSE && strpos($line, self::comment_indicator_end) === FALSE) { + self::$inside_multiline = TRUE; + return true; + + /* check for comment to end */ + } else if (strpos($line, self::comment_indicator_end) !== FALSE) { + self::$inside_multiline = FALSE; + return true; + } + + /*same check for html comments within scss.. just in case someone is having a bad day + scssphp will remove this tags later on, but still has a problem with it if we wrap an CSS commentary around it*/ + + if (strpos($line, self::html_comment_indicator_start) !== FALSE && strpos($line, self::html_comment_indicator_end) === FALSE) { + self::$inside_multiline = TRUE; + return true; + + } else if (strpos($line, self::comment_indicator_end) !== FALSE) { + self::$inside_multiline = FALSE; + return true; + } + + return false; + } + + /* + * we don't want to confuse map_get statements with selectors + * this could happen fairly easy when the scss contains map_get statements + * that select the value by index (e.g. color: map_get($map, 'color#{2}')), because + * of the curly brackets. + * + * in case the selector and the map_get statement are all in one line, you will not + * receive a line commentary for that particularly line. + * + * @return boolean + */ + + static function isMap($line) + { + if (strpos($line, self::map_indicator) !== FALSE) { + return true; + } + + return false; + } + +} \ No newline at end of file diff --git a/tests/InputTest.php b/tests/InputTest.php index 09c4d127..c34464ef 100644 --- a/tests/InputTest.php +++ b/tests/InputTest.php @@ -3,6 +3,7 @@ namespace Leafo\ScssPhp\Tests; use Leafo\ScssPhp\Compiler; +use Leafo\ScssPhp\LineCommentator; // Runs all the tests in inputs/ and compares their output to ouputs/ @@ -21,6 +22,9 @@ class InputTest extends \PHPUnit_Framework_TestCase protected static $inputDir = 'inputs'; protected static $outputDir = 'outputs'; + protected static $line_number_suffix = '_numbered'; + + public function setUp() { $this->scss = new Compiler(); @@ -32,6 +36,7 @@ public function setUp() */ public function testInputFile($inFname, $outFname) { + if (getenv('BUILD')) { return $this->buildInput($inFname, $outFname); } @@ -40,12 +45,43 @@ public function testInputFile($inFname, $outFname) $this->fail("$outFname is missing, consider building tests with BUILD=true"); } + $input = file_get_contents($inFname); $output = file_get_contents($outFname); $this->assertEquals($output, $this->scss->compile($input)); } + /* + * run all tests with line numbering + */ + + /** + * @dataProvider fileNameProvider + */ + + public function testLineNumbering($inFname, $outFname) { + + $outPath = self::lineNumberOutPath($outFname); + + //insert line numbers + $scss = LineCommentator::insertLineComments(file($inFname), self::fileName($inFname)); + + if (getenv('BUILD')) { + //write css + $css = $this->scss->compile($scss); + file_put_contents($outPath, $css); + } + + if (!is_readable($outPath)) { + $this->fail("$outPath is missing, consider building tests with BUILD=true"); + } + + $output = file_get_contents($outPath); + + $this->assertEquals($output, $this->scss->compile($scss)); + } + public function fileNameProvider() { return array_map( @@ -88,6 +124,7 @@ public static function outputNameFor($input) return __DIR__ . '/' . $out; } + public static function buildTests($pattern) { $files = self::findInputNames($pattern); @@ -95,4 +132,32 @@ public static function buildTests($pattern) foreach ($files as $file) { } } + + /* + * return output filename inlcuding line_number_suffix + * + * @return string + */ + + + public static function lineNumberOutPath($outFname) { + + $outFname = preg_replace("/.css$/", self::$line_number_suffix.'.css', self::fileName($outFname)); + + return __DIR__ .'/'.self::$outputDir . '/' . $outFname; + } + + + /* + * return filename from path + * + * @return string + */ + + + public static function fileName($path) { + + $filename = explode('/',$path); + return end($filename); + } } diff --git a/tests/outputs/builtins_numbered.css b/tests/outputs/builtins_numbered.css new file mode 100644 index 00000000..dc40ebfd --- /dev/null +++ b/tests/outputs/builtins_numbered.css @@ -0,0 +1,130 @@ +/* line 2, builtins.scss */ +#color { + color: #22ea18; + red: 34; + green: 234; + blue: 24; + color: rgba(1, 2, 4, 0.5); + a1: 1; + a2: 0.5; + mix: #020304; + rgba: rgba(170, 119, 204, 0.4); + rgba: rgba(170, 119, 204, 0.4); + green: 139; } +/* line 21, builtins.scss */ +#hsl { + color: #79c653; + color: rgba(121, 198, 83, 0.5); + hue: 100deg; + sat: 50%; + lig: 55%; } +/* line 30, builtins.scss */ +#more-color { + light: #7e3d9e; + dark: #432154; + sat: #632782; + desat: #5e3871; + gray: #545454; + comp: #48792f; + inv: #9fd086; } +/* line 44, builtins.scss */ +#more-more-color { + op: 0.5; + opacify: rgba(1, 2, 3, 0.6); + opacify: rgba(1, 2, 3, 0.6); + transparentize: rgba(1, 2, 3, 0.4); + transparentize: rgba(1, 2, 3, 0.4); + transparentize: rgba(52, 130, 3, 0.9); } +/* line 56, builtins.scss */ +#more-more-more-color { + color: rgba(65, 110, 79, 0.4); + color: rgba(20, 255, 216, 0); + color: rgba(55, 100, 69, 0.4); + color: rgba(0, 255, 213, 0); + color: rgba(145, 10, 10, 0); + color: rgba(5, 10, 10, 0); + color: rgba(145, 145, 145, 0); + color: rgba(5, 5, 5, 0); + color: #000A0A0A; + color: #FFAABBCC; } +/* line 74, builtins.scss */ +#string { + color: hello what is going on; + color: "yeah"; + color: "I do?"; } +/* line 81, builtins.scss */ +#number { + color: 250%; + color: 3; + color: 3; + color: 4; + top: 10px; + top: 1ex; + width: 200%; + bottom: 10px; + padding: 3em 1in 96px 72pt; } +/* line 94, builtins.scss */ +#list { + len: 3; + len: 1; + n: hello; + hello: one, two, three, hello; + hello: one, two, three, hello, world, what, is, going; + hello: one, two, three, hello; + index: 2; + index: false; + index: 3; + index: 1; + index: false; + index: 1; + index: false; + index: 2; + index: 2; + index: 1; + world: one, two, three, great, job; + world: one, two, three, great job; + cool: one two three great job; + cool: great job one two three; + zip: 1px solid, 2px dashed; + zip: 1px solid red, 2px dashed green; } + +/* line 115, builtins.scss */ +/* line 129, builtins.scss */ +#introspection { + t: number; + t: string; + t: string; + t: bool; + t: color; + t: color; + t: list; + u: ""; + u: "px"; + u: "em"; + l: true; + l: false; + c: true; + c: false; + c: true; + c: true; + c: false; + c: true; } +/* line 153, builtins.scss */ +#if { + color: yes; + color: no; + color: yes; + color: yes; } +/* line 160, builtins.scss */ +.transparent { + r: 0; + g: 0; + b: 0; + a: 0; } +/* line 167, builtins.scss */ +.alpha { + a: 1; + a: 1; + a: 1; + a: 0.5; + a: alpha(currentColor); } diff --git a/tests/outputs/comments_numbered.css b/tests/outputs/comments_numbered.css new file mode 100644 index 00000000..9ffe49c7 --- /dev/null +++ b/tests/outputs/comments_numbered.css @@ -0,0 +1,32 @@ +/** what the heck **/ +/** + Here is a block comment + **/ +/*hello*/ +div { + /*yeah*/ + border: 1px solid red; + /* another property */ + color: url('http://mage-page.com'); + string: "hello /* this is not a comment */"; + world: "// neither is this"; + string: 'hello /* this is not a comment */'; + /*what if this is a comment */ + world: '// neither is this'; + what-ever: 100px; + background: url(); + /*this is not a comment?*/ } +/* line 31, comments.scss */ +.dummy { + color: blue; } +/* comment 1 */ +/* line 36, comments.scss */ +a { + /* comment 2 */ + /* comment 3 */ + color: red; + /* comment 4 */ + background-color: red; + /* comment 5 */ + /* comment 6 */ } +/* comment 7 */ diff --git a/tests/outputs/compass_extract_numbered.css b/tests/outputs/compass_extract_numbered.css new file mode 100644 index 00000000..8a1bd422 --- /dev/null +++ b/tests/outputs/compass_extract_numbered.css @@ -0,0 +1,51 @@ +/* line 224, compass_extract.scss */ +#test-0 { + unit: false; + unit: true; + rhythm: 1.5em; + size: 1; + size: 1; + size: 1; + size: 2; + size: 2; } + /* line 117, compass_extract.scss */ +/* line 236, compass_extract.scss */ +#test-1 { + margin-top: 7.5em; + padding-top: 9em; + padding-bottom: 10.5em; + margin-bottom: 0em; } + +/* line 142, compass_extract.scss */ + /* line 117, compass_extract.scss */ + /* line 117, compass_extract.scss */ + /* line 117, compass_extract.scss */ + +/* line 157, compass_extract.scss */ + /* line 117, compass_extract.scss */ +/* line 240, compass_extract.scss */ +#test-2 { + border-style: solid; + border-width: 0.0625em; + padding: 1.4375em; } + +/* line 196, compass_extract.scss */ + /* line 117, compass_extract.scss */ +/* line 244, compass_extract.scss */ +#test-3 { + border-top-style: solid; + border-top-width: 0.0625em; + padding-top: 1.4375em; + border-bottom-style: solid; + border-bottom-width: 0.0625em; + padding-bottom: 1.4375em; } + +/* line 184, compass_extract.scss */ + /* line 117, compass_extract.scss */ + +/* line 188, compass_extract.scss */ + +/* line 184, compass_extract.scss */ + /* line 117, compass_extract.scss */ + +/* line 188, compass_extract.scss */ diff --git a/tests/outputs/content_numbered.css b/tests/outputs/content_numbered.css new file mode 100644 index 00000000..10a0beae --- /dev/null +++ b/tests/outputs/content_numbered.css @@ -0,0 +1,38 @@ +/* line 3, content.scss */ +/* line 8, content.scss */ + * html #logo { + background-image: url(/logo.gif); } +/* line 20, content.scss */ +.colors { + background-color: blue; + color: white; + border-color: blue; } +/* line 26, content.scss */ +@media only screen and (max-width: 480px) { + /* line 32, content.scss */ + body { + color: red; } } +/* line 36, content.scss */ +#sidebar { + width: 300px; } + +/* line 26, content.scss */ + @media only screen and (max-width: 480px) { + #sidebar { + width: 100px; } } +/* line 46, content.scss */ +@media only screen and (min-width: 40em) { + /* line 51, content.scss */ + .grid-1 { + width: 100%; } + .grid-2 { + width: 100%; } } +/* line 46, content.scss */ +@media only screen and (min-width: 40em) { + /* line 58, content.scss */ + .grid-1 { + width: 100%; } + + /* line 58, content.scss */ + .grid-2 { + width: 100%; } } diff --git a/tests/outputs/content_with_function_numbered.css b/tests/outputs/content_with_function_numbered.css new file mode 100644 index 00000000..a107e172 --- /dev/null +++ b/tests/outputs/content_with_function_numbered.css @@ -0,0 +1,3 @@ +/* line 13, content_with_function.scss */ +body { + padding: 1 px; } diff --git a/tests/outputs/default_args_numbered.css b/tests/outputs/default_args_numbered.css new file mode 100644 index 00000000..32d65ad7 --- /dev/null +++ b/tests/outputs/default_args_numbered.css @@ -0,0 +1,4 @@ +/* line 11, default_args.scss */ +div { + height: red; + margin: 100px; } diff --git a/tests/outputs/directives_numbered.css b/tests/outputs/directives_numbered.css new file mode 100644 index 00000000..2cb1a404 --- /dev/null +++ b/tests/outputs/directives_numbered.css @@ -0,0 +1,94 @@ +@charset "hello-world"; +/* line 4, directives.scss */ +@page :left { +/* line 5, directives.scss */ + div { + color: red; } } +/* line 10, directives.scss */ +@page test { +/* line 11, directives.scss */ + @media yes { + /* line 12, directives.scss */ + div { + color: red; } + + /* line 16, directives.scss */ } } +/* line 24, directives.scss */ +@media something { + /* line 25, directives.scss */ + @page { + /* line 26, directives.scss */ + @media else { + /* line 27, directives.scss */ + div { + height: 200px; } } } } +/* line 35, directives.scss */ +div { + color: red; } + +/* line 37, directives.scss */ + @page yeah { +/* line 38, directives.scss */ + div pre { + height: 20px; } } +/* line 44, directives.scss */ +@font-face { + color: red; + height: 20px; } +/* line 50, directives.scss */ +@keyframes 'bounce' { +/* line 51, directives.scss */ + from { + top: 100px; + animation-timing-function: ease-out; } +/* line 56, directives.scss */ + 25% { + top: 50px; + animation-timing-function: ease-in; } +/* line 61, directives.scss */ + 50% { + top: 100px; + animation-timing-function: ease-out; } +/* line 66, directives.scss */ + 75% { + top: 75px; + animation-timing-function: ease-in; } +/* line 71, directives.scss */ + to { + top: 100px; } } +/* line 76, directives.scss */ +@-webkit-keyframes flowouttoleft { +/* line 77, directives.scss */ + 0% { + -webkit-transform: translateX(0) scale(1); } +/* line 78, directives.scss */ + 60%, 70% { + -webkit-transform: translateX(0) scale(0.7); } +/* line 79, directives.scss */ + 100% { + -webkit-transform: translateX(-100%) scale(0.7); } } +/* line 82, directives.scss */ +div { + animation-name: 'diagonal-slide'; + animation-duration: 5s; + animation-iteration-count: 10; } +/* line 88, directives.scss */ +@keyframes 'diagonal-slide' { +/* line 90, directives.scss */ + from { + left: 0; + top: 0; } +/* line 95, directives.scss */ + to { + left: 100px; + top: 100px; } } + +@document url(http://www.w3.org/), +url-prefix(http://www.w3.org/Style/), +domain(mozilla.org), +/* line 105, directives.scss */ +regexp("https:.*") { +/* line 107, directives.scss */ + body { + color: purple; + background: yellow; } } diff --git a/tests/outputs/extends_numbered.css b/tests/outputs/extends_numbered.css new file mode 100644 index 00000000..b7c5eb8a --- /dev/null +++ b/tests/outputs/extends_numbered.css @@ -0,0 +1,127 @@ +/* line 2, extends.scss */ +error, pre seriousError, span seriousError, other, hello { + border: 1px #f00; + background-color: #fdd; } +/* line 7, extends.scss */ +/* line 8, extends.scss */ + pre seriousError, span seriousError { + font-size: 20px; } +/* line 14, extends.scss */ +hello { + color: green; } + +/* line 17, extends.scss */ + hello div { + margin: 10px; } +/* line 22, extends.scss */ +.cool, .me { + color: red; } +/* line 26, extends.scss */ +.blue, .me { + color: purple; } +/* line 30, extends.scss */ +/* line 34, extends.scss */ + +/* line 35, extends.scss */ + +a:hover, .hoverlink, #demo .overview .fakelink:hover { + text-decoration: underline; } +/* line 40, extends.scss */ +div.hello.world.hmm, pre div.okay.span.world.hmm, pre #butt .umm div.sure.span.world.hmm, #butt .umm pre div.sure.span.world.hmm, code div.okay.span.world.hmm, code #butt .umm div.sure.span.world.hmm, #butt .umm code div.sure.span.world.hmm { + color: blue; } +/* line 44, extends.scss */ +/* line 45, extends.scss */ + /* line 51, extends.scss */ + +.xxxxx .xxxxx .xxxxx, code .xxxxx .xxxxx, code code .xxxxx, code code code, code .xxxxx code, .xxxxx code .xxxxx, .xxxxx code code, .xxxxx .xxxxx code { + color: green; } +/* line 55, extends.scss */ +code { + color: red; } +/* line 63, extends.scss */ +.alpha, .beta, .gama { + color: red; } +/* line 67, extends.scss */ +.beta, .gama { + color: white; } +/* line 72, extends.scss */ +.gama { + color: blue; } +/* line 79, extends.scss */ +#admin .tabbar a, #admin .tabbar #demo .overview .fakelink, #demo .overview #admin .tabbar .fakelink { + font-weight: bold; } +/* line 80, extends.scss */ +/* line 82, extends.scss */ + +a1 b1 c1 d1, x1 y1 z1 w1 b1 c1 d1 { + color: red; } +/* line 83, extends.scss */ +/* line 85, extends.scss */ + +a2 b2 c2 d2, a2 x2 y2 z2 w2 c2 d2, x2 y2 z2 a2 w2 c2 d2 { + color: red; } +/* line 86, extends.scss */ +/* line 89, extends.scss */ + +a3 b3 c3 d3, a3 b3 x3 y3 z3 w3 d3, x3 y3 z3 a3 b3 w3 d3 { + color: red; } +/* line 90, extends.scss */ +/* line 93, extends.scss */ + +a4 b4 c4 d4, a4 b4 c4 x4 y4 z4 w4, x4 y4 z4 a4 b4 c4 w4 { + color: red; } +/* line 94, extends.scss */ +/* line 98, extends.scss */ + +#butt .yeah .okay, #butt .yeah .umm .sure, #butt .umm .yeah .sure { + font-weight: bold; } +/* line 99, extends.scss */ +/* line 101, extends.scss */ + +a9 b9 s9 t9 v9, a9 b9 s9 t9 x9 y9 z9, a9 b9 x9 y9 s9 t9 z9 { + color: red; } +/* line 103, extends.scss */ +/* line 109, extends.scss */ + +@media print { + /* line 110, extends.scss */ + horse, man { + color: blue; } } +/* line 115, extends.scss */ +man { + color: red; } +/* line 123, extends.scss */ +wassup { + color: blue; } +/* line 128, extends.scss */ +/* line 129, extends.scss */ + .foo .wassup { + color: blue; } +/* line 137, extends.scss */ +#something, .x, .y { + color: red; } +/* line 141, extends.scss */ +/* line 145, extends.scss */ + +/* line 151, extends.scss */ + +/* line 152, extends.scss */ + /* line 156, extends.scss */ + +.nav-justified, .nav-tabs.nav-justified { + text-align: justify; } + +.btn:hover, .edit .actions button:hover, .edit .new .actions button:hover, .btn:active, .edit .actions button:active, .edit .new .actions button:active, .btn.active, .edit .actions button.active, .edit .new .actions button.active, .btn.disabled, .edit .actions button.disabled, .edit .new .actions button.disabled, .btn[disabled], .edit .actions button[disabled], .edit .new .actions button[disabled] { + color: red; } + +/* line 166, extends.scss */ +/* line 169, extends.scss */ +/* line 170, extends.scss */ + .edit .actions button { + float: right; } +/* line 175, extends.scss */ +/* line 176, extends.scss */ + /* line 177, extends.scss */ + .edit .new .actions { + padding: 0; } + /* line 180, extends.scss */ diff --git a/tests/outputs/filter_effects_numbered.css b/tests/outputs/filter_effects_numbered.css new file mode 100644 index 00000000..a5eef6d3 --- /dev/null +++ b/tests/outputs/filter_effects_numbered.css @@ -0,0 +1,21 @@ +/* line 1, filter_effects.scss */ +#number { + -webkit-filter: grayscale(1) sepia(0.5) saturate(0.1) invert(1) opacity(0.5) brightness(0.5) contrast(0.5); } +/* line 11, filter_effects.scss */ +#percentage { + -webkit-filter: grayscale(100%) sepia(50%) saturate(10%) invert(100%) opacity(50%) brightness(50%) contrast(50%); } +/* line 21, filter_effects.scss */ +#misc { + -webkit-filter: hue-rotate(90deg) blur(10px) drop-shadow(10px -16px 30px purple); } +/* line 37, filter_effects.scss */ +#decimal { + opacity: 0.5; + filter: alpha(opacity=50, style=1); } +/* line 41, filter_effects.scss */ +#percent { + opacity: 0.5; + filter: alpha(opacity=50); } +/* line 45, filter_effects.scss */ +.row { + background-color: #071c23; + color: #2284a1; } diff --git a/tests/outputs/functions_numbered.css b/tests/outputs/functions_numbered.css new file mode 100644 index 00000000..abe573ca --- /dev/null +++ b/tests/outputs/functions_numbered.css @@ -0,0 +1,27 @@ +/* line 10, functions.scss */ +div { + color: 14px; + sum: 23; } +/* line 33, functions.scss */ +div { + hello: 10 55; + hello: 1010 55; + hello: "hello 10 and 55"; } +/* line 44, functions.scss */ +del { + color: 1000; } +/* line 48, functions.scss */ +div { + hello: "hello foo and bar"; + hello: "hello bar and default"; + hello: "hello Alice, Bob, Tom"; } +/* line 61, functions.scss */ +.foo { + test2: -moz-art; } +/* line 77, functions.scss */ +/* line 67, functions.scss */ + div span { + height: 3px; } +/* line 87, functions.scss */ +div { + width: 2; } diff --git a/tests/outputs/ie7_numbered.css b/tests/outputs/ie7_numbered.css new file mode 100644 index 00000000..1dfe7ab0 --- /dev/null +++ b/tests/outputs/ie7_numbered.css @@ -0,0 +1,9 @@ +/* line 2, ie7.scss */ +#foo:before { + content: counter(item,".") ": "; } +/* line 6, ie7.scss */ +#bar:before { + content: counter(item,"."); } +/* line 10, ie7.scss */ +#fu:before { + content: counter(item); } diff --git a/tests/outputs/if_numbered.css b/tests/outputs/if_numbered.css new file mode 100644 index 00000000..921baab7 --- /dev/null +++ b/tests/outputs/if_numbered.css @@ -0,0 +1,22 @@ +/* line 10, if.scss */ +div { + color: blue; } +/* line 16, if.scss */ +pre { + val-1: "red"; + val-2: "blue"; + val-3: "blue"; + val-4: "red"; + val-5: "red"; } +/* line 25, if.scss */ +span { + color: blue; + height: 10px; + width: 20px; } +/* line 47, if.scss */ +div { + color: blue; + border-color: green; } +/* line 67, if.scss */ +del { + thing: no; } diff --git a/tests/outputs/if_on_null_numbered.css b/tests/outputs/if_on_null_numbered.css new file mode 100644 index 00000000..d7e5d5f7 --- /dev/null +++ b/tests/outputs/if_on_null_numbered.css @@ -0,0 +1,3 @@ +/* line 6, if_on_null.scss */ +body { + background-color: "red"; } diff --git a/tests/outputs/import_numbered.css b/tests/outputs/import_numbered.css new file mode 100644 index 00000000..747ab27a --- /dev/null +++ b/tests/outputs/import_numbered.css @@ -0,0 +1,27 @@ +@import "foo.css"; +@import "foo" screen; +@import "http://foo.com/bar"; +@import url(foo); +div { + height: 200px; + color: red; } +/* line 9, import.scss */ +pre { + color: red; } + pre div { + height: 200px; + color: red; } +/* line 14, import.scss */ +code div { + height: 200px; + color: red; } + code div { + height: 200px; + color: red; } + +#partial { + color: blue; } +/* line 20, import.scss */ +body { + color: #7c2; + background: gray; } diff --git a/tests/outputs/interpolation_numbered.css b/tests/outputs/interpolation_numbered.css new file mode 100644 index 00000000..f2b650e8 --- /dev/null +++ b/tests/outputs/interpolation_numbered.css @@ -0,0 +1,105 @@ +/* line 2, interpolation.scss */ +div { + color: redwhite blue; + color: red white blue; + color: red whiteblue; + color: redwhiteblue; + color: ummyeahwhat; + color: stacked; + font-size: 10px/something; + font-size: 10px / something; + test: "whatworldwrong"; + test: "whatworldwrong"; + test: "whatworldwrong"; + test: "what"world"wrong"; + hi: "what is 16 end"; } + +/* line 3, interpolation.scss */ + +/* line 4, interpolation.scss */ + +/* line 5, interpolation.scss */ + +/* line 6, interpolation.scss */ + +/* line 7, interpolation.scss */ + +/* line 8, interpolation.scss */ + +/* line 10, interpolation.scss */ + +/* line 11, interpolation.scss */ + +/* line 13, interpolation.scss */ + +/* line 14, interpolation.scss */ + +/* line 15, interpolation.scss */ + +/* line 16, interpolation.scss */ + +/* line 18, interpolation.scss */ +/* line 24, interpolation.scss */ +/* line 27, interpolation.scss */ + pre var { + color: red; } + +/* line 31, interpolation.scss */ + pre var dad { + color: red; } + +/* line 35, interpolation.scss */ + pre bedvardad { + color: red; } +/* line 40, interpolation.scss */ +/* line 42, interpolation.scss */ + cool .thing-1 { + color: red; } + cool .thing-2 { + color: red; } + cool .thing-3 { + color: red; } + cool .thing-4 { + color: red; } + cool .thing-5 { + color: red; } +/* line 48, interpolation.scss */ +abcde { + color: red; } +/* line 52, interpolation.scss */ +#hello, .world { + color: red; } +/* line 56, interpolation.scss */ +#abchelloyeah, .coolworldyes { + color: red; } +/* line 62, interpolation.scss */ +div.element:nth-child(2n) { + display: none; } +/* line 69, interpolation.scss */ +div { + hello: world; + coolhello: world; + helloone: world; + twohelloone: world; + oneabtwo: cool; + hello-world: red; + hello-mold: white; + hello-hello: blue; } + +/* line 71, interpolation.scss */ + +/* line 72, interpolation.scss */ + +/* line 73, interpolation.scss */ + +/* line 74, interpolation.scss */ + +/* line 76, interpolation.scss */ + +/* line 78, interpolation.scss */ + +/* line 79, interpolation.scss */ + +/* line 80, interpolation.scss */ + +/* line 81, interpolation.scss */ diff --git a/tests/outputs/keyword_args_numbered.css b/tests/outputs/keyword_args_numbered.css new file mode 100644 index 00000000..501ae411 --- /dev/null +++ b/tests/outputs/keyword_args_numbered.css @@ -0,0 +1,7 @@ +/* line 8, keyword_args.scss */ +pre { + out: alpha fort three palace; } +/* line 19, keyword_args.scss */ +div { + hello: 5; + world: -5; } diff --git a/tests/outputs/list_numbered.css b/tests/outputs/list_numbered.css new file mode 100644 index 00000000..e8701f9f --- /dev/null +++ b/tests/outputs/list_numbered.css @@ -0,0 +1,8 @@ +/* line 4, list.scss */ +div { + padding: 10px 20px 30px 40px; + margin: 0 10px 10px 10px; + background: linear-gradient(black, white); } +/* line 13, list.scss */ +p { + background: linear-gradient(red, blue); } diff --git a/tests/outputs/looping_numbered.css b/tests/outputs/looping_numbered.css new file mode 100644 index 00000000..9e12ec7e --- /dev/null +++ b/tests/outputs/looping_numbered.css @@ -0,0 +1,46 @@ +/* line 2, looping.scss */ +div { + color: what; + color: is; + color: this; + font: what; + font: is; + font: this; + background: what; + background: is; + background: this; + border: what; + border: is; + border: this; } +/* line 23, looping.scss */ +span { + color: 0; + color: 1; + color: 2; + color: 3; + color: 4; + color: 5; + color: 6; + color: 7; + color: 8; + color: 9; + color: 10; } +/* line 31, looping.scss */ +pre { + color: 1; + color: 2; + color: 3; + color: 4; + height: 1; + height: 2; + height: 3; + height: 4; + height: 5; + cool: 10; + cool: 9; + cool: 8; + cool: 7; + cool: 6; + cool: 5; + cool: 4; + cool: 3; } diff --git a/tests/outputs/media_numbered.css b/tests/outputs/media_numbered.css new file mode 100644 index 00000000..af3d1028 --- /dev/null +++ b/tests/outputs/media_numbered.css @@ -0,0 +1,171 @@ +/* line 3, media.scss */ +@media { + /* line 4, media.scss */ + div { + color: blue; } } +/* line 6, media.scss */ +@media what { + /* line 7, media.scss */ + div { + color: blue; } } +/* line 10, media.scss */ +@media (cool) { + /* line 11, media.scss */ + div { + color: blue; } } +/* line 13, media.scss */ +@media (cool: blue) { + /* line 14, media.scss */ + div { + color: blue; } } +/* line 17, media.scss */ +@media hello and (world) and (butt: man) { + /* line 18, media.scss */ + div { + color: blue; } } +/* line 23, media.scss */ +@media (max-width: 940px) { + color: red; } +/* line 28, media.scss */ +@media not hello and (world) { + color: blue; + + /* line 30, media.scss */ + pre { + color: blue; } + + /* line 34, media.scss */ } + @media butt and (world) { + color: red; + + /* line 36, media.scss */ + div { + color: red; } } +/* line 42, media.scss */ +@media a, b { + /* line 43, media.scss */ } +/* line 48, media.scss */ +@media a { + /* line 49, media.scss */ } +/* line 54, media.scss */ +@media a, b { + /* line 55, media.scss */ } +/* line 64, media.scss */ +div { + color: blue; } + +/* line 66, media.scss */ + @media screen and (-webkit-min-device-pixel-ratio: 1.5) { + /* line 67, media.scss */ + div .sidebar { + width: 500px; } } +/* line 81, media.scss */ +div { + position: absolute; } + +/* line 84, media.scss */ + @media screen { + div { + top: 0; + bottom: 8em; + color: red; } + /* line 87, media.scss */ + div p { + margin: 5px; } + /* line 76, media.scss */ + div .success { + color: green; } } +/* line 95, media.scss */ +.button { + width: 300px; + height: 100px; + background: #eee; } + +/* line 100, media.scss */ + .button :hover { + background: #aaa; } + +/* line 104, media.scss */ + @media only screen and (max-width: 300px) { + .button { + width: 100px; + height: 100px; } } +/* line 110, media.scss */ +code { + position: absolute; } + +/* line 112, media.scss */ + @media screen { + code { + height: 10px; } + /* line 113, media.scss */ + code pre { + height: 20px; } } +/* line 120, media.scss */ +/* line 121, media.scss */ + @media screen { + /* line 122, media.scss */ } + @media screen and (color: blue) { + dt { + height: 10px; } } +/* line 129, media.scss */ +@media screen { + /* line 130, media.scss */ + .screen { + width: 12px; } + + /* line 133, media.scss */ } + @media only screen { + /* line 134, media.scss */ + .only-screen { + height: 11px; } } +/* line 140, media.scss */ +@media only screen { + /* line 141, media.scss */ + .only-screen { + width: 14px; } + + /* line 144, media.scss */ } + @media only screen { + /* line 145, media.scss */ + .only-screen { + height: 16px; } } +/* line 151, media.scss */ +@media not screen { + /* line 152, media.scss */ } +/* line 159, media.scss */ +@media not screen { + /* line 160, media.scss */ } + @media print { + /* line 161, media.scss */ + .only-print { + height: 12px; } } +/* line 167, media.scss */ +@media screen { + /* line 168, media.scss */ } + @media screen { + /* line 169, media.scss */ + .only-print { + height: 12px; } } +/* line 175, media.scss */ +@media not screen { + /* line 176, media.scss */ } +/* line 183, media.scss */ +@media not screen { + /* line 184, media.scss */ } + @media not screen { + /* line 185, media.scss */ + .not-screen { + height: 15px; } } +/* line 191, media.scss */ +@media only screen { + /* line 192, media.scss */ } +/* line 199, media.scss */ +@media only screen { + /* line 200, media.scss */ } + @media only screen and (color: blue) { + /* line 201, media.scss */ } + @media only screen and (color: blue) and (width: 13) { + /* line 202, media.scss */ + .only-screen { + height: 15px; } } diff --git a/tests/outputs/mixins_numbered.css b/tests/outputs/mixins_numbered.css new file mode 100644 index 00000000..63988fce --- /dev/null +++ b/tests/outputs/mixins_numbered.css @@ -0,0 +1,111 @@ +/* line 9, mixins.scss */ +div { + color: blue; + color: red; } + +/* line 4, mixins.scss */ + div pre { + height: 200px; } +/* line 26, mixins.scss */ +span { + color: blue; } + +/* line 17, mixins.scss */ + span div { + height: 20px; } +/* line 30, mixins.scss */ +html { + height: 43px; } +/* line 39, mixins.scss */ +del { + height: 20px; } +/* line 52, mixins.scss */ +div { + color: white; + color: blue; + color: white; } +/* line 62, mixins.scss */ +div { + background-image: linear-gradient(left top, red, green); } +/* line 72, mixins.scss */ +div { + -moz-box-shadow: 10px 10px 5px #888; + -webkit-box-shadow: 10px 10px 5px #888; + box-shadow: 10px 10px 5px #888; + -moz-box-shadow: inset 10px 10px #888, -10px -10px #f4f4f4; + -webkit-box-shadow: inset 10px 10px #888, -10px -10px #f4f4f4; + box-shadow: inset 10px 10px #888, -10px -10px #f4f4f4; } +/* line 81, mixins.scss */ +/* line 82, mixins.scss */ + div p { + color: red; + color: blue; } + /* line 83, mixins.scss */ + div p .class { + color: red; } + /* line 17, mixins.scss */ + div p .class div { + height: 20px; } + /* line 17, mixins.scss */ + div p div { + height: 20px; } + /* line 89, mixins.scss */ + div p .top { + top: 0; } + /* line 92, mixins.scss */ + div p .top div { + color: red; } +/* line 103, mixins.scss */ +div.mixin-content-simple { + color: red; } +/* line 109, mixins.scss */ +div.mixin-content-with-arg { + background: blue; + color: red; } +/* line 109, mixins.scss */ +div.mixin-content-with-arg { + background: purple; + height: 20px; } +/* line 103, mixins.scss */ +div.mixin-content-simple { + height: 43px; } +/* line 103, mixins.scss */ +div.mixin-content-simple { + color: orange; } + +/* line 17, mixins.scss */ + div.mixin-content-simple div { + height: 20px; } +/* line 109, mixins.scss */ +div.mixin-content-with-arg { + background: purple; + height: 43px; } +/* line 109, mixins.scss */ +div.mixin-content-with-arg { + background: purple; + color: orange; } + +/* line 17, mixins.scss */ + div.mixin-content-with-arg div { + height: 20px; } +/* line 156, mixins.scss */ +#please-wait { + background: url(/images/logo.png); + position: absolute; + top: 1em; + right: 0; + bottom: 3em; + left: 4em; } +/* line 168, mixins.scss */ +div.parameter-name-scope { + -webkit-transform: translateX(50px); } + +/* line 161, mixins.scss */ +/* line 174, mixins.scss */ +@-webkit-keyframes change-color { +/* line 181, mixins.scss */ + 0% { + color: green; } +/* line 182, mixins.scss */ + 100% { + color: red; } } diff --git a/tests/outputs/nesting_numbered.css b/tests/outputs/nesting_numbered.css new file mode 100644 index 00000000..39cdf5a7 --- /dev/null +++ b/tests/outputs/nesting_numbered.css @@ -0,0 +1,33 @@ +div: blue; +/* line 3, nesting.scss */ +body { + color: red; } +/* line 8, nesting.scss */ +div { + color: red; + height: yes; } + +/* line 12, nesting.scss */ + div pre { + color: blue; } +/* line 21, nesting.scss */ +div { + font: 10px hello world; + font-size: 10px; + font-color: blue; + border-left: 1px solid blue; + border-right: 2px dashed green; } + +/* line 22, nesting.scss */ + +/* line 27, nesting.scss */ +/* line 34, nesting.scss */ +#nested-nesting { + bar: baz; + bang-bop: bar; + bang-bip: 1px; + bang-blat-baf: bort; } + +/* line 36, nesting.scss */ + +/* line 39, nesting.scss */ diff --git a/tests/outputs/null_numbered.css b/tests/outputs/null_numbered.css new file mode 100644 index 00000000..30df309b --- /dev/null +++ b/tests/outputs/null_numbered.css @@ -0,0 +1,36 @@ +/* line 2, null.scss */ +.div { + one: null; + one: world; + one: NULL world; + one: a, b; + two: a, b; } +/* line 12, null.scss */ +p:before { + content: "I ate pies!"; } + +/* line 13, null.scss */ +/* line 31, null.scss */ +.foo { + -webkit-border-radius: 10; + border-radius: 10; } + +/* line 26, null.scss */ + +/* line 27, null.scss */ +/* line 35, null.scss */ +.fu { + -webkit-border-radius: 20; + border-radius: 20; } + +/* line 26, null.scss */ + +/* line 27, null.scss */ +/* line 39, null.scss */ +.bar { + -webkit-border-top-left-radius: 30; + border-top-left-radius: 30; } + +/* line 26, null.scss */ + +/* line 27, null.scss */ diff --git a/tests/outputs/operators_numbered.css b/tests/outputs/operators_numbered.css new file mode 100644 index 00000000..c4110d8c --- /dev/null +++ b/tests/outputs/operators_numbered.css @@ -0,0 +1,170 @@ +/* line 3, operators.scss */ +body { + color: 8; + color: 16; + height: 10px/10px; + color: 6px; + color: 5px; + bottom: 2px; + top: 1.5em; + left: -1cm; + top: 6.29921; } +/* line 15, operators.scss */ +div { + color: false; + color: true; + color: true; + color: false; + color: what > 3; } +/* line 25, operators.scss */ +#units { + test: 2.5748in; + test: 13mm; + test: 4em; + test: 11mm; + test: 1.1cm; } +/* line 33, operators.scss */ +#modulo { + test: 1; + test: 1cm; } +/* line 38, operators.scss */ +#colors { + color: #ff0203; + color: #fe0000; + color: rgba(3, 8, 15, 0.5); + color: rgba(5, 7, 10, 0.5); + color: rgba(2, 4, 6, 0.5); + color: rgba(0, 1, 1, 0.5); + color: rgba(3, 4, 5, 0.5); + color: rgba(0, 0, 1, 0.5); + color: #22f; + color: false; + color: true; + color: true; + color: false; } +/* line 59, operators.scss */ +#preserve { + hello: what -going; + hello: what - going; } +/* line 64, operators.scss */ +#strings { + hello: what -going; + hello: whatgoing; + hello: whatgoing; + hello: whatgoing; + hello: whatgoing; + hello: "whatgoing"; + hello: goingwhat; + hello: "whatwhat"; } +/* line 77, operators.scss */ +#negation { + a: -60; + b: -90; + b: -90; } +/* line 84, operators.scss */ +#bools-fail { + and: false and two; + and: one and two; + and: one and false; + or: false or two; + or: one or two; + or: one or false; } +/* line 94, operators.scss */ +#bools { + and: false; + and: two; + and: false; + or: two; + or: one; + or: one; } +/* line 105, operators.scss */ +#nots-fail { + not: false2; + not: not false; + not: not 0; + not: not 1; + not: not ""; + not: not hello; } +/* line 114, operators.scss */ +#nots { + not: false2; + not: true; + not: false; + not: false; + not: false; + not: false; } +/* line 123, operators.scss */ +#string-test { + str: true; + str: false; + str: true; + str: true; + str: xhellohellofalse; + str: true; } + +/* line 131, operators.scss */ + +/* line 133, operators.scss */ +/* line 139, operators.scss */ +#special { + cancel-unit: 1; } +/* line 146, operators.scss */ +.row .a { + margin: -0.5em; } +/* line 147, operators.scss */ +.row .b { + margin: -0.5em; } +/* line 148, operators.scss */ +.row .c { + margin: -0.5em; } +/* line 149, operators.scss */ +.row .d { + margin: -0.5em; } +/* line 150, operators.scss */ +.row .e { + margin: 0 -0.5em; } +/* line 152, operators.scss */ +.alt .a { + margin: -0.5em; } +/* line 153, operators.scss */ +.alt .b { + margin: -0.5em; } +/* line 154, operators.scss */ +.alt .c { + margin: -0.5em; } +/* line 155, operators.scss */ +.alt .d { + margin: 0 -1em / 2; } +/* line 156, operators.scss */ +.alt .e { + margin: 0 -0.5em; } +/* line 158, operators.scss */ +.row .f { + margin: -2em; } +/* line 159, operators.scss */ +.row .g { + margin: -2em; } +/* line 160, operators.scss */ +.row .h { + margin: -2em; } +/* line 161, operators.scss */ +.row .i { + margin: -2em; } +/* line 162, operators.scss */ +.row .j { + margin: 0 -2em; } +/* line 164, operators.scss */ +.alt .f { + margin: -2em; } +/* line 165, operators.scss */ +.alt .g { + margin: -2em; } +/* line 166, operators.scss */ +.alt .h { + margin: -2em; } +/* line 167, operators.scss */ +.alt .i { + margin: 0 -2em; } +/* line 168, operators.scss */ +.alt .j { + margin: 0 -2em; } diff --git a/tests/outputs/parsing_comments_numbered.css b/tests/outputs/parsing_comments_numbered.css new file mode 100644 index 00000000..0085190e --- /dev/null +++ b/tests/outputs/parsing_comments_numbered.css @@ -0,0 +1,55 @@ +/* comment 1 */ +/* line 2, parsing_comments.scss */ +a { + /* comment 2 */ + color: red; + /* comment 3 */ + /* comment 4 */ } +/* comment 5 */ +/*! comment 1 */ +/* line 10, parsing_comments.scss */ +b { + /*! comment 2 */ + color: red; + /*! comment 3 */ + /*! comment 4 */ } +/*! comment 5 */ +/* + * multi-line comment 1 + */ +/* line 20, parsing_comments.scss */ +c { + /* + * multi-line comment 2 + */ + color: red; + /* + * multi-line comment 3 + */ + /* + * multi-line comment 4 + */ } +/* + * multi-line comment 5 + */ +/*! + * multi-line comment 1 + */ +/* line 38, parsing_comments.scss */ +d { + /*! + * multi-line comment 2 + */ + color: red; + /*! + * multi-line comment 3 + */ + /*! + * multi-line comment 4 + */ } +/*! + * multi-line comment 5 + */ +/* line 54, parsing_comments.scss */ +e { + color: red; } diff --git a/tests/outputs/placeholder_selector_numbered.css b/tests/outputs/placeholder_selector_numbered.css new file mode 100644 index 00000000..2c01113f --- /dev/null +++ b/tests/outputs/placeholder_selector_numbered.css @@ -0,0 +1,11 @@ +/* line 1, placeholder_selector.scss */ +p a.notice span, p a.error span, #context a.notice span, #context a.error span { + color: blue; + font-weight: bold; + font-size: 2em; } +/* line 7, placeholder_selector.scss */ +/* line 9, placeholder_selector.scss */ +/* line 13, placeholder_selector.scss */ +p { + padding: 2em; } +/* line 18, placeholder_selector.scss */ diff --git a/tests/outputs/scss_css_numbered.css b/tests/outputs/scss_css_numbered.css new file mode 100644 index 00000000..46fa83ea --- /dev/null +++ b/tests/outputs/scss_css_numbered.css @@ -0,0 +1,799 @@ +@import "foo.css"; +@import 'foo.css'; +@import url("foo.css"); +@import url('foo.css'); +@import url(foo.css); +@import "foo.css" screen; +@import "foo.css" screen, print; +@charset "UTF-8"; +/* line 1, scss_css.scss */ +[foo~=bar] { + a: b; } +/* line 5, scss_css.scss */ +[foo^=bar] { + a: b; } +/* line 9, scss_css.scss */ +[foo$=bar] { + a: b; } +/* line 13, scss_css.scss */ +[foo*=bar] { + a: b; } +/* line 17, scss_css.scss */ +[foo|=en] { + a: b; } +/* line 21, scss_css.scss */ +foo { + a: 2; + b: 2.3em; + c: 50%; + d: "fraz bran"; + e: flanny-blanny-blan; + f: url(http://sass-lang.com); + h: #abc; } +/* line 32, scss_css.scss */ +selector { + property: value; + property2: value; } +/* line 37, scss_css.scss */ +sel { + p: v; } +/* line 39, scss_css.scss */ +.foo { + /* Foo + Bar + Baz */ + a: b; } +/* line 46, scss_css.scss */ +.foo { + /* Foo + Bar + Baz */ + a: b; } + +.foo { + /* Foo + Bar */ + a: b; } + +.foo { + /* Foo + Bar + Baz */ + a: b; } +/* line 64, scss_css.scss */ +@foo { + a: b; +/* line 65, scss_css.scss */ + rule { + a: b; } } +/* line 71, scss_css.scss */ +@foo { + a: b; } + +@bar { + a: b; +/* line 72, scss_css.scss */ } + +@foo "bar" +/* line 77, scss_css.scss */ +foo { + a: 12px calc(100%/3 - 2*1em - 2*1px); + b: 12px -moz-calc(100%/3 - 2*1em - 2*1px); + b: 12px -webkit-calc(100%/3 - 2*1em - 2*1px); + b: 12px -foobar-calc(100%/3 - 2*1em - 2*1px); } +/* line 84, scss_css.scss */ +foo { + bar: baz; } + +bar { + bar: baz; } + +baz { + bar: baz; } +/* + * foo + */ +/* line 94, scss_css.scss */ +bar { + baz: bang; } +/* line 97, scss_css.scss */ +E, F { + a: b; } +/* line 101, scss_css.scss */ +E F, G H { + a: b; } +/* line 105, scss_css.scss */ +E > F, G > H { + a: b; } +/* This is a CSS comment. */ +.one { + color: green; } +/* Another comment */ +/* The following should not be used: + .two {color: red;} */ +.three { + color: green; + /* color: red; */ } +/** + .four {color: red;} */ +/* line 116, scss_css.scss */ +.five { + color: green; } +/**/ +/* line 118, scss_css.scss */ +.six { + color: green; } +/*********/ +/* line 120, scss_css.scss */ +.seven { + color: green; } +/* a comment **/ +/* line 122, scss_css.scss */ +.eight { + color: green; } +/* line 125, scss_css.scss */ +foo { + a: \foo bar; + b: foo\ bar; + c: \2022 \0020; + d: foo\\bar; + e: foo\"\'bar; } +/* line 133, scss_css.scss */ +foo { + a: "\foo bar"; + b: "foo\ bar"; + c: "\2022 \0020"; + d: "foo\\bar"; + e: "foo\"'bar"; } +/* line 141, scss_css.scss */ +foo { + _name: val; + *name: val; + :name: val; + .name: val; + #name: val; + name/**/: val; + name/*\**/: val; + name: val; } + +@foo "bar" ; +/* line 154, scss_css.scss */ +foo { + a: -moz-element(#foo); + b: -webkit-element(#foo); + b: -foobar-element(#foo); } +/* line 160, scss_css.scss */ +/* line 162, scss_css.scss */ + +@foo ; +/* line 168, scss_css.scss */ +foo { + bar: baz; } +/* line 173, scss_css.scss */ +/* line 175, scss_css.scss */ + +/* line 179, scss_css.scss */ + +0% { + a: b; } +/* line 183, scss_css.scss */ +60% { + a: b; } +/* line 187, scss_css.scss */ +100% { + a: b; } +/* line 191, scss_css.scss */ +12px { + a: b; } +/* line 195, scss_css.scss */ +"foo" { + a: b; } +/* line 199, scss_css.scss */ +foo { + a: 12px expression(1 + (3 / Foo.bar("baz" + "bang") + function() {return 12;}) % 12); } + +/* line 200, scss_css.scss */ +/* line 203, scss_css.scss */ +:foo("bar") { + a: b; } +/* line 207, scss_css.scss */ +:foo(bar) { + a: b; } +/* line 211, scss_css.scss */ +:foo(12px) { + a: b; } +/* line 215, scss_css.scss */ +:foo(+) { + a: b; } +/* line 219, scss_css.scss */ +:foo(-) { + a: b; } +/* line 223, scss_css.scss */ +:foo(+"bar") { + a: b; } +/* line 227, scss_css.scss */ +:foo(-++--baz-"bar"12px) { + a: b; } +/* line 231, scss_css.scss */ +foo { + a: foo-bar(12); + b: -foo-bar-baz(13, 14 15); } + +@import "foo.css" screen, print and (foo: 0); +@import "foo.css" screen, only print, screen and (foo: 0); +/* line 254, scss_css.scss */ +foo { + a: foo !important; + b: foo bar !important; + b: foo, bar !important; } +/* line 260, scss_css.scss */ +foo { + a: -moz-bar-baz; + b: foo -o-bar-baz; } + +foo { + a: d; + /* b; c: */ } + +foo { + a : d; + /*: b; c */ } +/* Foo + * Bar */ +/* line 275, scss_css.scss */ +.foo { + /* Foo + * Bar */ } +/* line 280, scss_css.scss */ +[foo] { + a: b; } +/* line 284, scss_css.scss */ +[foo="bar"] { + a: b; } +/* line 288, scss_css.scss */ +[foo~="bar"] { + a: b; } +/* line 292, scss_css.scss */ +[foo^="bar"] { + a: b; } +/* line 296, scss_css.scss */ +[foo$="bar"] { + a: b; } +/* line 300, scss_css.scss */ +[foo*="bar"] { + a: b; } +/* line 304, scss_css.scss */ +[foo|="en"] { + a: b; } +/* line 308, scss_css.scss */ +:root { + a: b; } +/* line 312, scss_css.scss */ +:nth-child(n) { + a: b; } +/* line 316, scss_css.scss */ +:nth-last-child(n) { + a: b; } +/* line 320, scss_css.scss */ +:nth-of-type(n) { + a: b; } +/* line 324, scss_css.scss */ +:nth-last-of-type(n) { + a: b; } +/* line 328, scss_css.scss */ +:first-child { + a: b; } +/* line 332, scss_css.scss */ +:last-child { + a: b; } +/* line 336, scss_css.scss */ +:first-of-type { + a: b; } +/* line 340, scss_css.scss */ +:last-of-type { + a: b; } +/* line 344, scss_css.scss */ +:only-child { + a: b; } +/* line 348, scss_css.scss */ +:only-of-type { + a: b; } +/* line 352, scss_css.scss */ +:empty { + a: b; } +/* line 356, scss_css.scss */ +:link { + a: b; } +/* line 360, scss_css.scss */ +:visited { + a: b; } +/* line 364, scss_css.scss */ +:active { + a: b; } +/* line 368, scss_css.scss */ +:hover { + a: b; } +/* line 372, scss_css.scss */ +:focus { + a: b; } +/* line 376, scss_css.scss */ +:target { + a: b; } +/* line 380, scss_css.scss */ +:lang(fr) { + a: b; } +/* line 384, scss_css.scss */ +:enabled { + a: b; } +/* line 388, scss_css.scss */ +:disabled { + a: b; } +/* line 392, scss_css.scss */ +:checked { + a: b; } +/* line 396, scss_css.scss */ +::first-line { + a: b; } +/* line 400, scss_css.scss */ +::first-letter { + a: b; } +/* line 404, scss_css.scss */ +::before { + a: b; } +/* line 408, scss_css.scss */ +::after { + a: b; } +/* line 412, scss_css.scss */ +.warning { + a: b; } +/* line 416, scss_css.scss */ +#myid { + a: b; } +/* line 420, scss_css.scss */ +:not(s) { + a: b; } +/* line 424, scss_css.scss */ +@media all { + /* line 425, scss_css.scss */ + rule1 { + prop: val; } + + /* line 428, scss_css.scss */ + rule2 { + prop: val; } } +/* line 432, scss_css.scss */ +@media screen, print { + /* line 433, scss_css.scss */ + rule1 { + prop: val; } + + /* line 436, scss_css.scss */ + rule2 { + prop: val; } } +/* line 440, scss_css.scss */ +@media screen and (-webkit-min-device-pixel-ratio: 0) { + a: b; } +/* line 444, scss_css.scss */ +@media only screen, print and (foo: 0px) and (bar: flam(12px solid)) { + a: b; } +/* line 448, scss_css.scss */ +:-moz-any(h1, h2, h3) { + a: b; } +/* line 452, scss_css.scss */ +:-moz-any(.foo) { + a: b; } +/* line 456, scss_css.scss */ +:-moz-any(foo bar, .baz > .bang) { + a: b; } + +@-moz-document url(http://www.w3.org/), +url-prefix(http://www.w3.org/Style/), +domain(mozilla.org), +/* line 463, scss_css.scss */ +regexp("^https:.*") { +/* line 464, scss_css.scss */ + .foo { + a: b; } } +/* line 468, scss_css.scss */ +foo { + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000); + filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000); } +/* line 473, scss_css.scss */ +foo { + filter: alpha(opacity=20); + filter: alpha(opacity=20, enabled=true); + filter: blaznicate(foo=bar, baz=bang bip, bart=#fa4600); } +/* line 479, scss_css.scss */ +@foo bar { + a: b; } +/* line 482, scss_css.scss */ +@bar baz { + c: d; } + +@foo bar; +@bar baz; +/* Foo +* Bar */ +/* Baz +* Bang */ +/* line 496, scss_css.scss */ +.foo { + /* Foo + * Bar */ + /* Baz + * Bang */ } +/* line 503, scss_css.scss */ +.foo { + /* Foo Bar */ + /* Baz Bang */ } + +@namespace "http://www.w3.org/Profiles/xhtml1-strict"; +@namespace url(http://www.w3.org/Profiles/xhtml1-strict); +@namespace html url("http://www.w3.org/Profiles/xhtml1-strict"); +/* line 513, scss_css.scss */ +[foo|bar=baz] { + a: b; } +/* line 517, scss_css.scss */ +[*|bar=baz] { + a: b; } +/* line 521, scss_css.scss */ +[foo|bar|=baz] { + a: b; } +/* line 525, scss_css.scss */ +foo|E { + a: b; } +/* line 529, scss_css.scss */ +*|E { + a: b; } +/* line 533, scss_css.scss */ +foo|* { + a: b; } +/* line 537, scss_css.scss */ +*|* { + a: b; } +/* line 541, scss_css.scss */ +:not(foo|bar) { + a: b; } +/* line 545, scss_css.scss */ +:not(*|bar) { + a: b; } +/* line 549, scss_css.scss */ +:not(foo|*) { + a: b; } +/* line 553, scss_css.scss */ +:not(*|*) { + a: b; } +/* line 557, scss_css.scss */ +:not(#blah) { + a: b; } +/* line 561, scss_css.scss */ +:not(.blah) { + a: b; } +/* line 565, scss_css.scss */ +:not([foo]) { + a: b; } +/* line 569, scss_css.scss */ +:not([foo^="bar"]) { + a: b; } +/* line 573, scss_css.scss */ +:not([baz|foo~="bar"]) { + a: b; } +/* line 577, scss_css.scss */ +:not(:hover) { + a: b; } +/* line 581, scss_css.scss */ +:not(:nth-child(2n + 3)) { + a: b; } +/* line 585, scss_css.scss */ +:not(:not(#foo)) { + a: b; } +/* line 589, scss_css.scss */ +:not(a#foo.bar) { + a: b; } +/* line 593, scss_css.scss */ +:not(#foo .bar > baz) { + a: b; } +/* line 597, scss_css.scss */ +:not(h1, h2, h3) { + a: b; } +/* line 605, scss_css.scss */ +foo { + a: "bang 1 bar bip"; } + +/* line 606, scss_css.scss */ +/* line 609, scss_css.scss */ +:nth-child(-n) { + a: b; } +/* line 613, scss_css.scss */ +:nth-child(+n) { + a: b; } +/* line 617, scss_css.scss */ +:nth-child(even) { + a: b; } +/* line 621, scss_css.scss */ +:nth-child(odd) { + a: b; } +/* line 625, scss_css.scss */ +:nth-child(50) { + a: b; } +/* line 629, scss_css.scss */ +:nth-child(-50) { + a: b; } +/* line 633, scss_css.scss */ +:nth-child(+50) { + a: b; } +/* line 637, scss_css.scss */ +:nth-child(2n+3) { + a: b; } +/* line 641, scss_css.scss */ +:nth-child(2n-3) { + a: b; } +/* line 645, scss_css.scss */ +:nth-child(+2n-3) { + a: b; } +/* line 649, scss_css.scss */ +:nth-child(-2n+3) { + a: b; } +/* line 653, scss_css.scss */ +:nth-child(-2n+ 3) { + a: b; } +/* line 657, scss_css.scss */ +:nth-child( 2n + 3) { + a: b; } +/* line 661, scss_css.scss */ +foo { + a: foo bar baz; + b: foo, #abc, -12; + c: 1px/2px/-3px; + d: foo bar, baz/bang; } +/* line 668, scss_css.scss */ +@page { + prop1: val; + prop2: val; } +/* line 673, scss_css.scss */ +@page flap { + prop1: val; + prop2: val; } +/* line 678, scss_css.scss */ +@page :first { + prop1: val; + prop2: val; } +/* line 683, scss_css.scss */ +@page flap:first { + prop1: val; + prop2: val; } +/* line 688, scss_css.scss */ +.foo { + /* Foo */ + a: b; } +/* line 693, scss_css.scss */ +.foo { + /* Foo + * Bar */ + a: b; } +/* Foo */ +/* line 699, scss_css.scss */ +.foo { + a: b; } +/* Foo + * Bar */ +.foo { + a: b; } + +.foo #bar:baz(/* bang )*/ bip) { + /* .a #foo */ + a: b; } +/* line 712, scss_css.scss */ +> E { + a: b; } +/* line 716, scss_css.scss */ ++ E { + a: b; } +/* line 720, scss_css.scss */ +~ E { + a: b; } +/* line 724, scss_css.scss */ +> > E { + a: b; } +/* line 728, scss_css.scss */ +>> E { + a: b; } +/* line 732, scss_css.scss */ +E* { + a: b; } +/* line 736, scss_css.scss */ +E*.foo { + a: b; } +/* line 740, scss_css.scss */ +E*:hover { + a: b; } + +E, F { + a: b; } + +/* line 745, scss_css.scss */ + +E F { + a: b; } + +/* line 750, scss_css.scss */ + +E, F G, H { + a: b; } + +/* line 755, scss_css.scss */ +/* line 759, scss_css.scss */ +body { + /* + //comment here + */ } +/* line 766, scss_css.scss */ +E > F { + a: b; } +/* line 768, scss_css.scss */ +E ~ F { + a: b; } +/* line 770, scss_css.scss */ +E + F { + a: b; } +/* line 772, scss_css.scss */ +* { + a: b; } +/* line 776, scss_css.scss */ +E { + a: b; } +/* line 780, scss_css.scss */ +E[foo] { + a: b; } +/* line 784, scss_css.scss */ +E[foo="bar"] { + a: b; } +/* line 788, scss_css.scss */ +E[foo~="bar"] { + a: b; } +/* line 792, scss_css.scss */ +E[foo^="bar"] { + a: b; } +/* line 796, scss_css.scss */ +E[foo$="bar"] { + a: b; } +/* line 800, scss_css.scss */ +E[foo*="bar"] { + a: b; } +/* line 804, scss_css.scss */ +E[foo|="en"] { + a: b; } +/* line 808, scss_css.scss */ +E:root { + a: b; } +/* line 812, scss_css.scss */ +E:nth-child(n) { + a: b; } +/* line 816, scss_css.scss */ +E:nth-last-child(n) { + a: b; } +/* line 820, scss_css.scss */ +E:nth-of-type(n) { + a: b; } +/* line 824, scss_css.scss */ +E:nth-last-of-type(n) { + a: b; } +/* line 828, scss_css.scss */ +E:first-child { + a: b; } +/* line 832, scss_css.scss */ +E:last-child { + a: b; } +/* line 836, scss_css.scss */ +E:first-of-type { + a: b; } +/* line 840, scss_css.scss */ +E:last-of-type { + a: b; } +/* line 844, scss_css.scss */ +E:only-child { + a: b; } +/* line 848, scss_css.scss */ +E:only-of-type { + a: b; } +/* line 852, scss_css.scss */ +E:empty { + a: b; } +/* line 856, scss_css.scss */ +E:link { + a: b; } +/* line 860, scss_css.scss */ +E:visited { + a: b; } +/* line 864, scss_css.scss */ +E:active { + a: b; } +/* line 868, scss_css.scss */ +E:hover { + a: b; } +/* line 872, scss_css.scss */ +E:focus { + a: b; } +/* line 876, scss_css.scss */ +E:target { + a: b; } +/* line 880, scss_css.scss */ +E:lang(fr) { + a: b; } +/* line 884, scss_css.scss */ +E:enabled { + a: b; } +/* line 888, scss_css.scss */ +E:disabled { + a: b; } +/* line 892, scss_css.scss */ +E:checked { + a: b; } +/* line 896, scss_css.scss */ +E::first-line { + a: b; } +/* line 900, scss_css.scss */ +E::first-letter { + a: b; } +/* line 904, scss_css.scss */ +E::before { + a: b; } +/* line 908, scss_css.scss */ +E::after { + a: b; } +/* line 912, scss_css.scss */ +E.warning { + a: b; } +/* line 916, scss_css.scss */ +E#myid { + a: b; } +/* line 920, scss_css.scss */ +E:not(s) { + a: b; } +/* line 924, scss_css.scss */ +E F { + a: b; } +/* line 928, scss_css.scss */ +E > F { + a: b; } +/* line 932, scss_css.scss */ +E + F { + a: b; } +/* line 936, scss_css.scss */ +E ~ F { + a: b; } +/* line 940, scss_css.scss */ +@supports (a: b) and (c: d) or (not (d: e)) and ((not (f: g)) or (not ((h: i) and (j: k)))) { +/* line 941, scss_css.scss */ + .foo { + a: b; } } +/* line 947, scss_css.scss */ +@-prefix-supports (a: b) and (c: d) or (not (d: e)) and ((not (f: g)) or (not ((h: i) and (j: k)))) { +/* line 948, scss_css.scss */ + .foo { + a: b; } } +/* line 954, scss_css.scss */ +foo { + foo: bar; + #baz: bang; + #bip: bop; } +/* line 960, scss_css.scss */ +foo { + a: -2; + b: -2.3em; + c: -50%; + d: -foo(bar baz); } +/* line 967, scss_css.scss */ +foo { + a: -0.5em; + b: 0.5em; + c: -foo(12px); + d: +foo(12px); } +/* line 977, scss_css.scss */ +foo { + -moz-foo-bar: blat; + -o-flat-blang: wibble; } +/* line 982, scss_css.scss */ +foo { + a: foo(); + b: bar baz-bang() bip; } diff --git a/tests/outputs/selectors_numbered.css b/tests/outputs/selectors_numbered.css new file mode 100644 index 00000000..e945befb --- /dev/null +++ b/tests/outputs/selectors_numbered.css @@ -0,0 +1,360 @@ +/* line 1, selectors.scss */ +* { + color: blue; } +/* line 2, selectors.scss */ +E { + color: blue; } +/* line 4, selectors.scss */ +E:not(:link) { + color: blue; } +/* line 5, selectors.scss */ +E:not(:link):not(:visited) { + color: blue; } +/* line 6, selectors.scss */ +E:not(:link, :visited) { + color: blue; } +/* line 7, selectors.scss */ +E:matches(:hover, :focus) { + color: blue; } +/* line 9, selectors.scss */ +E.warning { + color: blue; } +/* line 10, selectors.scss */ +E#id { + color: blue; } +/* line 11, selectors.scss */ +E[foo] { + color: blue; } +/* line 12, selectors.scss */ +E[foo="barbar"] { + color: blue; } +/* line 13, selectors.scss */ +E[foo="barbar" i] { + color: blue; } +/* line 14, selectors.scss */ +E[foo~="hello#$@%@$#^"] { + color: blue; } +/* line 15, selectors.scss */ +E[foo^="color: green;"] { + color: blue; } +/* line 16, selectors.scss */ +E[foo$="239023"] { + color: blue; } +/* line 17, selectors.scss */ +E[foo*="29302"] { + color: blue; } +/* line 18, selectors.scss */ +E[foo|="239032"] { + color: blue; } +/* line 20, selectors.scss */ +[foo] { + color: blue; } +/* line 21, selectors.scss */ +[foo] .helloWorld { + color: blue; } +/* line 22, selectors.scss */ +[foo].helloWorld { + color: blue; } +/* line 23, selectors.scss */ +[foo="barbar"] { + color: blue; } +/* line 24, selectors.scss */ +[foo~="hello#$@%@$#^"] { + color: blue; } +/* line 25, selectors.scss */ +[foo^="color: green;"] { + color: blue; } +/* line 26, selectors.scss */ +[foo$="239023"] { + color: blue; } +/* line 27, selectors.scss */ +[foo*="29302"] { + color: blue; } +/* line 28, selectors.scss */ +[foo|="239032"] { + color: blue; } +/* line 30, selectors.scss */ +E:dir(ltr) { + color: blue; } +/* line 31, selectors.scss */ +E:lang(en) { + color: blue; } +/* line 32, selectors.scss */ +E:lang(en, fr) { + color: blue; } +/* line 34, selectors.scss */ +E:any-link { + color: blue; } +/* line 35, selectors.scss */ +E:link { + color: blue; } +/* line 36, selectors.scss */ +E:visited { + color: blue; } +/* line 37, selectors.scss */ +E:local-link { + color: blue; } +/* line 38, selectors.scss */ +E:local-link(0) { + color: red; } +/* line 39, selectors.scss */ +E:local-link(1) { + color: white; } +/* line 40, selectors.scss */ +E:local-link(2) { + color: red; } +/* line 41, selectors.scss */ +E:target { + color: blue; } +/* line 42, selectors.scss */ +E:scope { + color: blue; } +/* line 44, selectors.scss */ +E:current { + color: blue; } +/* line 45, selectors.scss */ +E:current(:link) { + color: blue; } +/* line 46, selectors.scss */ +E:past { + color: blue; } +/* line 47, selectors.scss */ +E:future { + color: blue; } +/* line 49, selectors.scss */ +E:active { + color: blue; } +/* line 50, selectors.scss */ +E:hover { + color: blue; } +/* line 51, selectors.scss */ +E:focus { + color: blue; } +/* line 52, selectors.scss */ +E:enabled { + color: blue; } +/* line 53, selectors.scss */ +E:disabled { + color: blue; } +/* line 54, selectors.scss */ +E:indeterminate { + color: blue; } +/* line 55, selectors.scss */ +E:default { + color: blue; } +/* line 56, selectors.scss */ +E:in-range { + color: blue; } +/* line 57, selectors.scss */ +E:out-of-range { + color: blue; } +/* line 58, selectors.scss */ +E:required { + color: blue; } +/* line 59, selectors.scss */ +E:optional { + color: blue; } +/* line 60, selectors.scss */ +E:read-only { + color: blue; } +/* line 61, selectors.scss */ +E:read-write { + color: blue; } +/* line 63, selectors.scss */ +E:root { + color: blue; } +/* line 64, selectors.scss */ +E:empty { + color: blue; } +/* line 65, selectors.scss */ +E:first-child { + color: blue; } +/* line 66, selectors.scss */ +E:nth-child(odd) { + color: blue; } +/* line 67, selectors.scss */ +E:nth-child(2n+1) { + color: blue; } +/* line 68, selectors.scss */ +E:nth-child(5) { + color: blue; } +/* line 69, selectors.scss */ +E:last-child { + color: blue; } +/* line 70, selectors.scss */ +E:nth-last-child(-n+2) { + color: blue; } +/* line 71, selectors.scss */ +E:only-child { + color: blue; } +/* line 72, selectors.scss */ +E:first-of-type { + color: blue; } +/* line 73, selectors.scss */ +E:nth-of-type(2n) { + color: blue; } +/* line 74, selectors.scss */ +E:last-of-type { + color: blue; } +/* line 75, selectors.scss */ +E:nth-last-of-type(n) { + color: blue; } +/* line 76, selectors.scss */ +E:only-of-type { + color: blue; } +/* line 77, selectors.scss */ +E:nth-match(odd) { + color: blue; } +/* line 78, selectors.scss */ +E:nth-last-match(odd) { + color: blue; } +/* line 80, selectors.scss */ +E:column(n) { + color: blue; } +/* line 81, selectors.scss */ +E:nth-column(n) { + color: blue; } +/* line 82, selectors.scss */ +E:nth-last-column(n) { + color: blue; } +/* line 84, selectors.scss */ +E F { + color: blue; } +/* line 85, selectors.scss */ +E > F { + color: blue; } +/* line 86, selectors.scss */ +E + F { + color: blue; } +/* line 87, selectors.scss */ +E ~ F { + color: blue; } +/* line 88, selectors.scss */ +E /foo/ F { + color: blue; } +/* line 89, selectors.scss */ +E! > F { + color: blue; } +/* line 92, selectors.scss */ +[foo|att=val] { + color: blue; } +/* line 93, selectors.scss */ +[*|att] { + color: yellow; } +/* line 94, selectors.scss */ +[|att] { + color: green; } +/* line 95, selectors.scss */ +[att] { + color: green; } +/* line 98, selectors.scss */ +E::first-line { + color: blue; } +/* line 99, selectors.scss */ +E::first-letter { + color: blue; } +/* line 100, selectors.scss */ +E::before { + color: blue; } +/* line 101, selectors.scss */ +E::after { + color: blue; } +/* line 104, selectors.scss */ +E::choices { + color: blue; } +/* line 105, selectors.scss */ +E::value { + color: blue; } +/* line 106, selectors.scss */ +E::repeat-index { + color: blue; } +/* line 107, selectors.scss */ +E::repeat-item { + color: blue; } +/* line 109, selectors.scss */ +E:first { + color: blue; } +/* line 110, selectors.scss */ +E:first-line { + color: blue; } +/* line 111, selectors.scss */ +E:first-letter { + color: blue; } +/* line 112, selectors.scss */ +E:before { + color: blue; } +/* line 113, selectors.scss */ +E:after { + color: blue; } +/* line 114, selectors.scss */ +E:checked { + color: blue; } +/* line 115, selectors.scss */ +E:invalid { + color: blue; } +/* line 116, selectors.scss */ +E:valid { + color: blue; } +/* line 117, selectors.scss */ +E:left { + color: blue; } +/* line 118, selectors.scss */ +E:right { + color: blue; } +/* line 121, selectors.scss */ +E:any(ol) { + color: blue; } +/* line 122, selectors.scss */ +E::selection { + color: blue; } +/* line 126, selectors.scss */ +div { + font: something; + font-size: 30em; } + +/* line 127, selectors.scss */ + div font:something { + size: 30em; } + +/* line 131, selectors.scss */ +/* line 139, selectors.scss */ +/* line 140, selectors.scss */ + .something.world { + color: blue; } + +/* line 144, selectors.scss */ + .something .mold { + height: 200px; } + +/* line 148, selectors.scss */ + .dog .something { + color: blue; } +/* line 153, selectors.scss */ +/* line 154, selectors.scss */ + .dad .simple .wolf { + color: blue; } + +/* line 158, selectors.scss */ + .rad.simple.bad { + color: blue; } +/* line 164, selectors.scss */ +/* line 165, selectors.scss */ + /* line 166, selectors.scss */ + .something div .what.world { + color: blue; } +/* line 172, selectors.scss */ +/* line 173, selectors.scss */ + div.foo div { + color: blue; } +/* line 178, selectors.scss */ +/* line 179, selectors.scss */ + /* line 180, selectors.scss */ + /* line 181, selectors.scss */ + .nice-fonts .main .message div .title, .nice-fonts div .message div .title { + font-size: 24px; } +/* line 189, selectors.scss */ +.escape\% { + color: red; } +/* line 193, selectors.scss */ +.escape-plan\% { + color: green; } diff --git a/tests/outputs/values_numbered.css b/tests/outputs/values_numbered.css new file mode 100644 index 00000000..a10e3b50 --- /dev/null +++ b/tests/outputs/values_numbered.css @@ -0,0 +1,38 @@ +/* line 2, values.scss */ +#values { + color: #eee; + color: #eee; + height: 20px; + width: 80%; + color: "hello world"; + height: url("http://google.com"); + dads: url(http://leafo.net); + padding: 10px 10px 10px 10px, 3px 3px 3px; + textblock: "This is a \ +multiline block \ +/* line 13, values.scss */ +#not { color: #eee;}"; + margin: 4, 3, 1; + content: "This is a \ +multiline string."; + border-radius: -1px -1px -1px black; } +/* line 20, values.scss */ +#subtraction { + lit: 10 -11; + lit: -1; + lit: -1; + lit: -1; + var: -90; + var: -90; + var: -90; + var: -90; } +/* line 34, values.scss */ +#special { + a: 12px expression(1 + (3 / Foo.bar("baz" + "bang") + function() {return 12;}) % 12); } + +/* line 35, values.scss */ +/* line 38, values.scss */ +#unary { + b: 0.5em; + c: -foo(12px); + d: +foo(12px); } diff --git a/tests/outputs/variables_numbered.css b/tests/outputs/variables_numbered.css new file mode 100644 index 00000000..9a000844 --- /dev/null +++ b/tests/outputs/variables_numbered.css @@ -0,0 +1,28 @@ +cool: 100px; +/* line 4, variables.scss */ +div { + height: red, two, three; } +/* line 10, variables.scss */ +div { + num: 1000; } +/* line 15, variables.scss */ +div { + num: 2000; } +/* line 23, variables.scss */ +pre { + color: blue; } +/* line 31, variables.scss */ +del { + color: red; } + +/* line 34, variables.scss */ + /* line 36, variables.scss */ + del div pre { + color: red; } +/* line 50, variables.scss */ +body { + font-family: Arial; + font-family: Helvetica Neue; + font-family: "Helvetica Neue"; + font-family: Helvetica, Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }