Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

FIX: use stylus nodes api to properly inject url literal #13

Merged
merged 1 commit into from

2 participants

@LAMF

The stylus extension function used within both express example projects is not working.

The background image style is rendering incorrectly as a quoted string.

#break
{
  background-image: 'url("/images/v0.1/background.png")';
}

Stylus provides a Literal object from the nodes API that can correct this and make it look as follows.

#break {
  background-image: url("/images/background.png");
}
@serby
Owner

Nice one. Thanks.

@serby serby merged commit 92ee669 into serby:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 22, 2013
  1. @LAMF
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −1  examples/express-mapped/app.js
  2. +1 −1  examples/express/app.js
View
2  examples/express-mapped/app.js
@@ -17,7 +17,7 @@ versionator.createMapFromPath(__dirname + '/public', function(error, staticFileM
.set('warn', true)
.set('compress', true)
.define('versionPath', function(urlPath) {
- return 'url(' + mappedVersion.versionPath(urlPath) + ')';
+ return new stylus.nodes.Literal('url(' + mappedVersion.versionPath(urlPath) + ')');
});
}
View
2  examples/express/app.js
@@ -22,7 +22,7 @@ app.configure(function(){
.set('warn', true)
.set('compress', true)
.define('versionPath', function(urlPath) {
- return 'url(' + basic.versionPath(urlPath) + ')';
+ return new stylus.nodes.Literal('url(' + basic.versionPath(urlPath) + ')');
});
}
Something went wrong with that request. Please try again.