paddingBottom.js 897 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. const parsers = require("../parsers");
  3. module.exports.parse = function parse(v) {
  4. const val = parsers.parseMeasurement(v, true);
  5. if (val) {
  6. return val;
  7. }
  8. return parsers.parseKeyword(v);
  9. };
  10. module.exports.isValid = function isValid(v) {
  11. if (v === "") {
  12. return true;
  13. }
  14. return typeof module.exports.parse(v) === "string";
  15. };
  16. module.exports.definition = {
  17. set(v) {
  18. v = parsers.prepareValue(v, this._global);
  19. if (parsers.hasVarFunc(v)) {
  20. this._setProperty("padding", "");
  21. this._setProperty("padding-bottom", v);
  22. } else {
  23. this._subImplicitSetter(
  24. "padding",
  25. "bottom",
  26. v,
  27. module.exports.isValid,
  28. module.exports.parse,
  29. ["top", "right", "bottom", "left"]
  30. );
  31. }
  32. },
  33. get() {
  34. return this.getPropertyValue("padding-bottom");
  35. },
  36. enumerable: true,
  37. configurable: true
  38. };