Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added scss connect compiler

  • Loading branch information...
commit 8a7ef1ce6edd5e909b714addb58b7b8c86157717 1 parent 3660a4e
@bmavity authored
View
15 examples/blog.scss
@@ -0,0 +1,15 @@
+#main {
+ margin: 0 5.625em;
+ h5 {
+ font-size: 1em;
+ line-height: 1.25em;
+ }
+ .post {
+ text-align left;
+ ul {
+ list-style-position: inside;
+ list-style-type: circle;
+ margin: 0.625em;
+ }
+ }
+}
View
8 examples/compiler_tester.js
@@ -2,8 +2,12 @@ var sys = require('sys'),
fs = require('fs'),
compiler = require('../src/scssCompiler');
-fs.readFile(__dirname + '/input.scss', function(err, scssFile) {
+fs.readFile(__dirname + '/blog.scss', function(err, scssFile) {
compiler.compile(scssFile.toString(), function(err, css) {
- sys.puts(css);
+ if(err) {
+ sys.puts(sys.inspect(err));
+ } else {
+ sys.puts(css);
+ }
});
});
View
9 examples/tester.js
@@ -2,8 +2,13 @@ var sys = require('sys'),
fs = require('fs'),
scss = require('../src');
-fs.readFile('input.scss', function(err, scssFile) {
+fs.readFile(__dirname + '/blog.scss', function(err, scssFile) {
+ sys.puts(scssFile.toString());
scss.parse(scssFile.toString(), function(err, css) {
- sys.puts(css);
+ if(err) {
+ sys.puts(sys.inspect(err));
+ } else {
+ sys.puts(css);
+ }
});
});
View
4 src/scss.ometa
@@ -97,8 +97,8 @@ ometa Scss <: Parser {
spacedSelector = space+ selector:sel -> (' ' + sel),
fullSelector = selector:first (spacedSelector | selector)*:rest -> (first + rest.join('')),
propertyValue = '$' letterOrDigit+:val -> ('$' + val.join(''))
- | ('#' | letterOrDigit)+:val -> val.join(''),
- property = spaces letter+:prop ":" spaces propertyValue:val ";" -> ({ name: prop.join(''), val: val }),
+ | ('#' | '.' | space | letterOrDigit)+:val -> val.join(''),
+ property = spaces ('-' | letter)+:prop ":" spaces propertyValue:val ";" -> ({ name: prop.join(''), val: val }),
scssBlock = spaces fullSelector:sel "{" property*:props scssBlock*:blocks "}" -> { var b = createBlock(sel); b.addProperty(props); b.addBlock(blocks); b },
scssVariable = "$" letter+:name ":" spaces propertyValue:val ";" -> ({ name:name.join(''), val:val }),
scssFile = scssVariable*:scssVars scssBlock*:blocks -> { file.addBlocks(blocks); vars.add(scssVars); file }
Please sign in to comment.
Something went wrong with that request. Please try again.