Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed css property #10

Merged
merged 2 commits into from
May 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/template/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function () {

var util = require('util'),
className = util.format('.%s {', this.className.replace(/\s+/gi, '_')),
background = util.format(" background: url('%s');", this.background);
background = util.format(" background-image: url('%s');", this.background);

return [
"",
Expand Down
8 changes: 4 additions & 4 deletions test/spec/api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ describe('Data-uri Class', function () {

describe('#getCss' , function () {
it('should create a class with datauri background using target file name', function () {
dUri.getCss().should.equal('\n.fixture {\n background: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
dUri.getCss().should.equal('\n.fixture {\n background-image: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
});

it('should create a class with datauri background using a defined name', function () {
dUri.getCss('foobar').should.equal('\n.foobar {\n background: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
dUri.getCss('foobar').should.equal('\n.foobar {\n background-image: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
});
});
});
Expand Down Expand Up @@ -149,11 +149,11 @@ describe('Data-uri Class', function () {

describe('#getCss' , function () {
it('should create a class with datauri background using target file name', function () {
dUri.getCss().should.equal('\n.fixture {\n background: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
dUri.getCss().should.equal('\n.fixture {\n background-image: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
});

it('should create a class with datauri background using a defined name', function () {
dUri.getCss('foobar').should.equal('\n.foobar {\n background: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
dUri.getCss('foobar').should.equal('\n.foobar {\n background-image: url(\'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\');\n}');
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/spec/cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Data-uri Client', function () {
describe('generate a data-uri string into a css file', function () {

var createdFile = 'test/duality.css',
createdClass = "\n.fixture {\n background: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');\n}";
createdClass = "\n.fixture {\n background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7');\n}";

it('should not run if given css path has no compatible extension', function (done) {
var expected = 'Your css file must have extension: .css, .sass, .scss, .styl or .less\n';
Expand Down