Skip to content

Commit

Permalink
Added dummyimage service (service: dummyimage)
Browse files Browse the repository at this point in the history
  • Loading branch information
awayken committed Jun 14, 2016
1 parent aeff611 commit 81d2ab6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 1.2.0

* Added grayscale placekitten (service: placekittengray)
* Added dummyimage service (service: dummyimage)

# 1.1.0

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Supported services:
* [placehold.it](https://placehold.it)
* [placekitten](https://placekitten.com)
* [placekittengray](https://placekitten.com)
* [dummyimage](https://dummyimage.com)


## Usage
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var getPlaceholdURL = function( width, height, service ) {
return 'https://placekitten.com/' + width + '/' + height;
} else if ( service === 'placekittengray' ) {
return 'https://placekitten.com/g/' + width + '/' + height;
} else if ( service === 'dummyimage' ) {
return 'https://dummyimage.com/' + width + 'x' + height;
} else {
return 'https://placehold.it/' + width + 'x' + height;
}
Expand Down
8 changes: 8 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ var tests = [
service: 'placekittengray'
}
},
{
message: 'should add dummyimage placeholder',
fixture: 'h1 { background: placehold(400, 400); }',
expected: 'h1 { background: url("https://dummyimage.com/400x400"); }',
options: {
service: 'dummyimage'
}
},
{
message: 'should prefer placehold.it placeholder',
fixture: 'h1 { background: placehold(400, 400); }',
Expand Down

0 comments on commit 81d2ab6

Please sign in to comment.