Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
borodean committed Feb 6, 2015
2 parents 42ea7f2 + 7d2a147 commit aa5f4a4
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "0.10"

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PostCSS Assets
PostCSS Assets [![Build Status](https://travis-ci.org/borodean/postcss-assets.svg?branch=develop)](https://travis-ci.org/borodean/postcss-assets)
==============

PostCSS Assets is an asset manager for CSS. It isolates stylesheets from environmental changes, gets image sizes and inlines files.
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,7 @@ module.exports = function (options) {
});
};
};

module.exports.postcss = function (cssTree) {
module.exports()(cssTree);
}
8 changes: 8 additions & 0 deletions lib/mapFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ function CSSString (str) {
}

CSSString.prototype.toString = function () {
if (!this.quotes && (this.value.indexOf("'") !== -1 || this.value.indexOf('"') !== -1)) {
this.quotes = "'";
}

if (this.quotes === '"') {
this.quotes = "'";
}

return this.quotes + this.value + this.quotes;
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-assets",
"version": "1.1.3",
"version": "1.1.4",
"description": "PostCSS plugin to manage assets",
"author": "Vadim Borodean <[email protected]>",
"license": "MIT",
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/alpha/trapezium-mixed-quotes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions test/fixtures/cachebuster.expected.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background: url('/test/fixtures/alpha/kateryna.jpg?43');
background: url('/test/fixtures/alpha/kateryna.jpg?foo=bar&43');
background: url('/test/fixtures/alpha/kateryna.jpg?43');
background: url('/test/fixtures/alpha/kateryna.jpg?g');
background: url('/test/fixtures/alpha/kateryna.jpg?foo=bar&g');
background: url('/test/fixtures/alpha/kateryna.jpg?g');
}
5 changes: 5 additions & 0 deletions test/fixtures/inline.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
body {
background: inline('alpha/blank.gif');
background: inline( 'alpha/blank.gif' );
background: inline(alpha/trapezium.svg);
background: inline('alpha/trapezium.svg');
background: inline(alpha/trapezium-single-quotes.svg);
background: inline('alpha/trapezium-single-quotes.svg');
background: inline(alpha/trapezium-mixed-quotes.svg);
background: inline('alpha/trapezium-mixed-quotes.svg');
background: inline("alpha/trapezium-mixed-quotes.svg");
}
5 changes: 5 additions & 0 deletions test/fixtures/inline.expected.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/fixtures/resolve-spelling.expected.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body {
url('/alpha/odalisque.jpg');
background: url('/alpha/kateryna.jpg');
background: url('/alpha/kateryna.jpg');
background: url("/alpha/kateryna.jpg");
background: url('/alpha/kateryna.jpg');
background: url('/alpha/odalisque.jpg');
background: url('/alpha/kateryna_(shevchenko).jpg');
background: url('/alpha/kateryna.jpg');
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test('cachebuster', function (t) {
t.notEqual(a, b, 'busts cache');

options.cachebuster = function (path) {
return path.length.toString(16);
return path[path.length - 1];
};

compareFixtures(t, 'cachebuster', 'accepts buster function', options);
Expand Down

0 comments on commit aa5f4a4

Please sign in to comment.