From 1ce2c24fa45fad93a6b0ee5746b057ffd32ee007 Mon Sep 17 00:00:00 2001 From: arotter Date: Wed, 18 Mar 2015 09:51:45 +0100 Subject: [PATCH] added builder-stylus plugin and changed to stylus format --- client/boot/component.json | 2 +- client/boot/style.styl | 37 ++++++++++++++++++++++++++++ client/item-presenter/component.json | 2 +- client/item-presenter/style.styl | 22 +++++++++++++++++ component-builder.coffee | 3 ++- package.json | 4 ++- 6 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 client/boot/style.styl create mode 100644 client/item-presenter/style.styl diff --git a/client/boot/component.json b/client/boot/component.json index eb3eefd..24101a1 100644 --- a/client/boot/component.json +++ b/client/boot/component.json @@ -5,7 +5,7 @@ "component/keyname": "*" }, "scripts": ["index.coffee"], - "styles": ["style.css"], + "styles": ["style.styl"], "locals": [ "item", "item-presenter" diff --git a/client/boot/style.styl b/client/boot/style.styl new file mode 100644 index 0000000..30bc049 --- /dev/null +++ b/client/boot/style.styl @@ -0,0 +1,37 @@ +* + box-sizing border-box + +body + padding 50px + font 14px Helvetica + +input[type=text] + padding 10px + width 400px + border-radius 3px + border 1px solid #eee + border-top-color #ddd + +ul + margin 0 + padding 0 + width 400px + +#content + width 400px + position relative + +#links + position absolute + top 5px + right 0 + font-size 12px + a + display inline-block + text-decoration none + margin 0 3px + color #0dbdff + &:hover + color #29cbff + border-bottom 1px solid #ddd + diff --git a/client/item-presenter/component.json b/client/item-presenter/component.json index bb95e0a..1f34515 100644 --- a/client/item-presenter/component.json +++ b/client/item-presenter/component.json @@ -7,7 +7,7 @@ "index.coffee" ], "styles": [ - "style.css" + "style.styl" ], "templates": [ "template.html" diff --git a/client/item-presenter/style.styl b/client/item-presenter/style.styl new file mode 100644 index 0000000..3cc8a6c --- /dev/null +++ b/client/item-presenter/style.styl @@ -0,0 +1,22 @@ +.item + margin 0 + padding 5px 0 + list-style none + border-bottom 1px dotted #eee + &:hover + background #fbfbfb + .x + color #acacac + font-size 10px + text-decoration none + float right + border-radius 3px + margin-right 2px + padding 3px 5px + &:hover + background #eee + &.complete + label + text-decoration line-through + color #acacac + diff --git a/component-builder.coffee b/component-builder.coffee index 159fef8..2cb752e 100644 --- a/component-builder.coffee +++ b/component-builder.coffee @@ -2,6 +2,7 @@ fs = require('fs') resolve = require('component-resolver') build = require('component-builder') coffee = require('builder-coffee-script') +stylus = require('builder-stylus') mkdirp = require('mkdirp') OUTPUT = 'build' @@ -25,7 +26,7 @@ resolve process.cwd(), { install: true, out: REMOTES}, (err, tree) -> # only include `.css` files from components' `.styles` field build.styles(tree) - .use('styles', build.plugins.css()) + .use('styles', build.plugins.css(), stylus()) .end (err, string) -> if err throw err diff --git a/package.json b/package.json index 9d813c5..52662f1 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,11 @@ "builder-coffee-script": "^0.2.0", "coffee-script": "^1.9.1", "component-builder": "^1.2.1", + "component-resolver": "*", "express": "^4.10.1", "mkdirp": "^0.5.0", - "morgan": "^1.4.1" + "morgan": "^1.4.1", + "builder-stylus": "git+https://github.com/andirotter/builder-stylus.git" }, "scripts": { "server": "coffee server/index.coffee"