source: frontend/node_modules/cssstyle/lib/properties/fontFamily.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

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