From f9c89a9a5d44b77c0cfd4bdde1cdd93e1eb1e770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Sat, 1 Jun 2013 19:46:24 +0200 Subject: [PATCH] More test, to get the framework. --- public/stylesheets/style.styl | 93 +++++++++++++++++++++++++++++++++++ server.js | 8 ++- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 public/stylesheets/style.styl diff --git a/public/stylesheets/style.styl b/public/stylesheets/style.styl new file mode 100644 index 0000000..6655045 --- /dev/null +++ b/public/stylesheets/style.styl @@ -0,0 +1,93 @@ +/* + * Import nib + */ +@import 'nib' + +/* + * Grab a custom font from Google + */ +@import url('http://fonts.googleapis.com/css?family=Quicksand') + +/* + * Nib provides a CSS reset + */ +global-reset() + +/* + * Store the main color and + * background color as variables + */ +main-color = #fa5b4d +background-color = #faf9f0 + +body + font-family 'Georgia' + background-color background-color + color #444 + +header + font-family 'Quicksand' + padding 50px 10px + color #fff + font-size 25px + text-align center + + /* + * Note the use of the `main-color` + * variable and the `darken` function + */ + background-color main-color + border-bottom 1px solid darken(main-color, 30%) + text-shadow 0px -1px 0px darken(main-color, 30%) + +.container + width 500px + margin 50px auto + overflow hidden + +.main-content + float left + width 300px + + p + margin-bottom 20px + +.sidebar + float left + width 200px + + .widget + + /* + * Note the lack of vendor + * prefixes here. Nib will + * add them for us + */ + border-radius 3px + border 1px solid #ccc + margin-left 20px + background-color background-color + box-shadow inset 0px 0px 0px 3px rgba(#fff, 0.8), 0px 3px 0px -2px rgba(#000, 0.1) + + h1 + font-family 'Quicksand' + margin 13px 10px 4px + padding-bottom 10px + border-bottom 1px dotted #ddd + border-radius 2px 2px 0px 0px + margin-bottom 10px + + p + font-size 13px + padding 0px 10px + margin-bottom 10px + +p + line-height 1.8 + +footer + width 500px + margin 50px auto + border-top 1px dotted #ccc + padding-top 5px + font-size 13px \ No newline at end of file diff --git a/server.js b/server.js index 5fe6617..226cb99 100644 --- a/server.js +++ b/server.js @@ -45,8 +45,14 @@ app.use(stylus.middleware( app.use(express.static(__dirname + '/public')); // Simple test call +// app.get('/', function (req, res) { +// res.send('Hi there!!'); +// }); + app.get('/', function (req, res) { - res.send('Hi there!!'); + res.render('index', + { title: 'Home' } + ); }); app.listen(3000);