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
702 B

  1. 'use strict';
  2. var TYPES = require('../parsers').TYPES;
  3. var valueType = require('../parsers').valueType;
  4. var partsRegEx = /\s*,\s*/;
  5. module.exports.isValid = function isValid(v) {
  6. if (v === '' || v === null) {
  7. return true;
  8. }
  9. var parts = v.split(partsRegEx);
  10. var len = parts.length;
  11. var i;
  12. var type;
  13. for (i = 0; i < len; i++) {
  14. type = valueType(parts[i]);
  15. if (type === TYPES.STRING || type === TYPES.KEYWORD) {
  16. return true;
  17. }
  18. }
  19. return false;
  20. };
  21. module.exports.definition = {
  22. set: function(v) {
  23. this._setProperty('font-family', v);
  24. },
  25. get: function() {
  26. return this.getPropertyValue('font-family');
  27. },
  28. enumerable: true,
  29. configurable: true,
  30. };