Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use real (ruby) sass

  • Loading branch information...
commit 04a905e71603c2851d43146581df2ebd3150fc35 1 parent 7a2d96d
Visnu Pitiyanuvath authored
View
2  .gitignore
@@ -1 +1,3 @@
+.bundle
public/stylesheets/*.css
+tmp
View
1  .rvmrc
@@ -0,0 +1 @@
+rvm ree@ssh-ios
View
1  Gemfile
@@ -0,0 +1 @@
+gem 'haml'
View
9 Gemfile.lock
@@ -0,0 +1,9 @@
+GEM
+ specs:
+ haml (3.0.21)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ haml
View
8 public/stylesheets/application.sass
@@ -24,8 +24,8 @@ form
:border solid 1px hsla(0, 0%, 0%, 0.1)
:border-radius 3px
:background hsl(190, 80%, 50%) -webkit-gradient(linear, left top, left bottom, from(hsla(0, 0%, 100%, 0.8)), to(hsla(0, 0%, 80%, 0.8)))
- input[type=submit]:active, button:active
- :background hsl(190, 80%, 50%) -webkit-gradient(linear, left bottom, left top, from(hsla(0, 0%, 100%, 0.8)), to(hsla(0, 0%, 80%, 0.8)))
+ &:active
+ :background hsl(190, 80%, 50%) -webkit-gradient(linear, left bottom, left top, from(hsla(0, 0%, 100%, 0.8)), to(hsla(0, 0%, 80%, 0.8)))
#stdout
:display inline
@@ -58,9 +58,9 @@ span
:color magenta
&.e36
:color cyan
- &.e37, &.39
+ &.e37, &.e39
:color white
- &.e40, &.49
+ &.e40, &.e49
:background-color black
&.e41
:background-color red
View
20 sass.js
@@ -0,0 +1,20 @@
+module.exports = require('connect').middleware.compiler.compilers.sass;
+module.exports.compile = function(str, fn) {
+ try {
+ var sass = require('child_process').spawn('sass', ['--stdin']),
+ append = function(data) { css += data; },
+ css = '';
+ sass.stdout.on('data', append);
+ sass.stderr.on('data', append);
+ sass.on('exit', function(code) {
+ if (code === 0)
+ fn(null, css);
+ else
+ fn(new Error('sass exited with code: ' + code + '\n' + css));
+ });
+ sass.stdin.write(new Buffer(str));
+ sass.stdin.end();
+ } catch(err) {
+ fn(err);
+ }
+};
View
2  server.js
@@ -39,3 +39,5 @@ app.get('/', function(req, res) {
});
app.listen(process.env.PORT || 8000);
+
+express.compiler.compilers.sass = require('./sass');
View
2  views/layout.jade
@@ -1,7 +1,7 @@
!!! 5
html( lang: "en" )
head
- title ssh.js - ssh over websockets for iOS
+ title ssh-ios — ssh for iOS
meta( name: "viewport", content: "user-scalable=no" )
link( rel: "stylesheet", type: "text/css", href: "/stylesheets/application.css" )
body
Please sign in to comment.
Something went wrong with that request. Please try again.