Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
use real (ruby) sass
Browse files Browse the repository at this point in the history
  • Loading branch information
Visnu Pitiyanuvath committed Oct 3, 2010
1 parent 7a2d96d commit 04a905e
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1 +1,3 @@
.bundle
public/stylesheets/*.css
tmp
1 change: 1 addition & 0 deletions .rvmrc
@@ -0,0 +1 @@
rvm ree@ssh-ios
1 change: 1 addition & 0 deletions Gemfile
@@ -0,0 +1 @@
gem 'haml'
9 changes: 9 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,9 @@
GEM
specs:
haml (3.0.21)

PLATFORMS
ruby

DEPENDENCIES
haml
8 changes: 4 additions & 4 deletions public/stylesheets/application.sass
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions 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);
}
};
2 changes: 2 additions & 0 deletions server.js
Expand Up @@ -39,3 +39,5 @@ app.get('/', function(req, res) {
});

app.listen(process.env.PORT || 8000);

express.compiler.compilers.sass = require('./sass');
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 04a905e

Please sign in to comment.