Match radial gradients

This commit is contained in:
Rafael Caricio 2014-09-06 20:38:10 +02:00
parent d6c91b4757
commit da4f2bed43
2 changed files with 19 additions and 2 deletions

View file

@ -70,10 +70,21 @@ module.exports = (function() {
'linear-gradient',
tokens.linearGradient,
matchLinearOrientation) ||
matchGradient(
'repeating-linear-gradient',
tokens.repeatingLinearGradient,
matchLinearOrientation);
matchLinearOrientation) ||
matchGradient(
'radial-gradient',
tokens.radialGradient,
matchRadialOrientation) ||
matchGradient(
'repeating-radial-gradient',
tokens.repeatingRadialGradient,
matchRadialOrientation);
}
function matchGradient(gradientType, pattern, orientationMatcher) {
@ -117,6 +128,9 @@ module.exports = (function() {
matchAngle();
}
function matchRadialOrientation() {
}
function matchSideOrCorner() {
return match('directional', tokens.sideOrCorner, 1);
}

View file

@ -201,7 +201,9 @@ describe('gradient-parser.js', function () {
describe('parse linear gradients', function() {
[
'linear-gradient',
'repeating-linear-gradient'
'radial-gradient',
'repeating-linear-gradient',
'repeating-radial-gradient'
].forEach(function(gradient) {
describe('parse ' + gradient + ' gradient', function() {
beforeEach(function() {
@ -215,4 +217,5 @@ describe('gradient-parser.js', function () {
});
});
});
});