bottom.js 620 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. const parsers = require("../parsers");
  3. module.exports.parse = function parse(v) {
  4. const dim = parsers.parseMeasurement(v);
  5. if (dim) {
  6. return dim;
  7. }
  8. return parsers.parseKeyword(v, ["auto"]);
  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. this._setProperty("bottom", module.exports.parse(v));
  20. },
  21. get() {
  22. return this.getPropertyValue("bottom");
  23. },
  24. enumerable: true,
  25. configurable: true
  26. };