diff --git a/README.md b/README.md index 1a50a39..2581003 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,51 @@ The available values of `node.type` are listed below, as well as the available p - orientation: `Object` possible types `directional` or `angular`. - colorStops: `Array` of color stops of type `literal`, `hex`, `rgb`, or `rgba`. +### radial-gradient + +- orientation: `Array` or `undefined`. `Array` of possible types `shape`, `default-radial`. +- colorStops: `Array` of color stops of type `literal`, `hex`, `rgb`, or `rgba`. + +### repeating-radial-gradient + +- orientation: `Array` or `undefined`. `Array` of possible types `shape`, `default-radial`. +- colorStops: `Array` of color stops of type `literal`, `hex`, `rgb`, or `rgba`. + +### directional + +- value: `String` possible values `left`, `top`, `bottom`, `right`. + +### angular + +- value: `Number` integer number. + +### literal + +- value: `String` literal name of the color. + +### hex + +- value: `String` hex value. + +### rgb + +- value: `Array` of length 3 of `Number`'s. + +### rgba + +- value: `Array` of length 4 or `Number`'s. + +### shape + +- style: `Object` or `undefined` possible types `extent-keyword`, `px`, `em`, `%`, or `positioning-keyword`. +- value: `String` possible values `ellipse` or `circle`. + +### default-radial + +- at: `Object` of attributes: + - x: `Object` possible types `extent-keyword`, `px`, `em`, `%`, or `positioningKeyword`. + - y: `Object` possible types `extent-keyword`, `px`, `em`, `%`, or `positioningKeyword`. + ## License (The MIT License) diff --git a/lib/parser.js b/lib/parser.js index 599a66b..53c091b 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -171,7 +171,7 @@ module.exports = (function() { var defaultPosition = matchPositioning(); if (defaultPosition) { radialType = { - type: 'default', + type: 'default-radial', at: defaultPosition }; } @@ -194,7 +194,7 @@ module.exports = (function() { var ellipse = match('shape', /^(ellipse)/i, 0); if (ellipse) { - ellipse.style = matchExtentKeyword() || matchDistance(); + ellipse.style = matchDistance() || matchExtentKeyword(); } return ellipse; @@ -308,7 +308,7 @@ module.exports = (function() { } function matchPositionKeyword() { - return match('positionKeyword', tokens.positionKeywords, 1); + return match('position-keyword', tokens.positionKeywords, 1); } function matchLength() {