You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.0 KiB

  1. 'use strict';
  2. var shorthandSetter = require('../parsers').shorthandSetter;
  3. var shorthandGetter = require('../parsers').shorthandGetter;
  4. var shorthand_for = {
  5. 'border-width': require('./borderWidth'),
  6. 'border-style': require('./borderStyle'),
  7. 'border-color': require('./borderColor'),
  8. };
  9. var myShorthandSetter = shorthandSetter('border', shorthand_for);
  10. var myShorthandGetter = shorthandGetter('border', shorthand_for);
  11. module.exports.definition = {
  12. set: function(v) {
  13. if (v.toString().toLowerCase() === 'none') {
  14. v = '';
  15. }
  16. myShorthandSetter.call(this, v);
  17. this.removeProperty('border-top');
  18. this.removeProperty('border-left');
  19. this.removeProperty('border-right');
  20. this.removeProperty('border-bottom');
  21. this._values['border-top'] = this._values.border;
  22. this._values['border-left'] = this._values.border;
  23. this._values['border-right'] = this._values.border;
  24. this._values['border-bottom'] = this._values.border;
  25. },
  26. get: myShorthandGetter,
  27. enumerable: true,
  28. configurable: true,
  29. };