Navigation Menu

Skip to content

Commit

Permalink
Fixed hsla value regexp.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Nov 30, 2016
1 parent f48d10b commit b24993d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/tools.js
Expand Up @@ -1497,7 +1497,7 @@

_rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,

_hslaRegExp: /hsla?\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,
_hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,

/**
* Parses `value` used as a `background` property shorthand and returns information as an object.
Expand Down
4 changes: 2 additions & 2 deletions tests/core/tools/style.js
Expand Up @@ -48,9 +48,9 @@
},

'test style.parse._findColor hsla': function() {
var ret = this.parse._findColor( 'hsl(10,30%,30%) hsla(10,30%,30%,1)' );
var ret = this.parse._findColor( 'hsl(10,30%,30%) hsla(10,30%,30%,1) hsla( 90.5, 10%, 10%, 1)' );

arrayAssert.itemsAreEqual( [ 'hsl(10,30%,30%)', 'hsla(10,30%,30%,1)' ], ret );
arrayAssert.itemsAreEqual( [ 'hsl(10,30%,30%)', 'hsla(10,30%,30%,1)', 'hsla( 90.5, 10%, 10%, 1)' ], ret );
},

'test style.parse._findColor predefined': function() {
Expand Down

0 comments on commit b24993d

Please sign in to comment.