Browse Source

FIX,IMPRO,REFA: overriding all function for border

dev-feat-component_preview
chris 2 months ago
parent
commit
aa65dc1e54
  1. 24
      src/decorators/border.js

24
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;
}
} }
/** /**

Loading…
Cancel
Save