Skip to content

Commit

Permalink
New: V1.0.0 Fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
yisibl committed Dec 3, 2018
1 parent 23c6637 commit 5a649ef
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.0 - 2018-12-03
* Updates to PostCSS 7
* Allow double quotes to be used #4

# 0.0.2 - 2017-07-12

* Keep only padding-top
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ gulp.task('test', function() {

gulp.task('default', ['test'])

gulp.task('watch', function () {
gulp.watch(files, ['test'])
gulp.task('watch', function() {
gulp.watch(files, ['test'])
})
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = postcss.plugin('postcss-layout', function(opts) {

function processRatioValue(css, rule, decl) {
var ratio = null
var re = /['']?(((?:\d*\.?\d*)?)(?:\:|\|)(\d+))['']?/g
var re = /[''""]?(((?:\d*\.?\d*)?)(?:\:|\|)(\d+))[''""]?/g

ratio = decl.value
ratio = ratio.replace(re, function(match, r, x, y) {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-aspect-ratio-mini",
"version": "0.0.2",
"version": "1.0.0",
"description": "A PostCSS plugin to fix an element's dimensions to an aspect ratio.",
"main": "index.js",
"scripts": {
Expand All @@ -26,11 +26,11 @@
},
"homepage": "https://github.com/yisibl/postcss-aspect-ratio-mini",
"dependencies": {
"postcss": "^6.0.0"
"postcss": "^7.0.6"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-postcss": "^6.0.1",
"gulp-postcss": "^8.0.0",
"gulp-shell": "^0.5.2",
"gulp-tape": "0.0.7",
"tap-diff": "^0.1.1",
Expand Down
3 changes: 3 additions & 0 deletions test/fixtures/double-quote.actual.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.aspect-box:before {
padding-top: 56.25%
}
3 changes: 3 additions & 0 deletions test/fixtures/double-quote.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.aspect-box {
aspect-ratio: "16:9";
}
3 changes: 3 additions & 0 deletions test/fixtures/double-quote.expected.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.aspect-box:before {
padding-top: 56.25%
}
5 changes: 5 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ test('damo', function(t) {
compareFixtures(t, 'damo', 'should equal')
t.end()
})

test('double-quote', function(t) {
compareFixtures(t, 'double-quote', 'should equal')
t.end()
})

0 comments on commit 5a649ef

Please sign in to comment.