diff --git a/src/decorators/border.js b/src/decorators/border.js index 37bf05d..bfe50eb 100644 --- a/src/decorators/border.js +++ b/src/decorators/border.js @@ -200,6 +200,30 @@ class Border extends Sides { ] }); } + + + /** + * If the given amount is a number this method calls width(amount). + * If amount is instanceof BorderDefinition it will set the BorderDefinition + * to all sides. + * If neither it will do nothing and return this Border object. + * + * @inheritdoc + * @override + * @param {number|BorderDefinition} amount value to set for all directions + * @returns {typeof Sides} this + */ + all(amount) { + if(amount instanceof Number){ + return this.width(amount); + } + + if(amount instanceof BorderDefinition){ + return super.all(amount); + } + + return this; + } } /**