Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81145 views
1
'use strict';
2
3
var parsers = require('../parsers');
4
var implicitSetter = require('../parsers').implicitSetter;
5
6
module.exports.isValid = function parse(v) {
7
if (typeof v !== 'string') {
8
return false;
9
}
10
return (v === '' || v.toLowerCase() === 'transparent' || parsers.valueType(v) === parsers.TYPES.COLOR);
11
};
12
var isValid = module.exports.isValid;
13
14
var parser = function (v) {
15
if (isValid(v)) {
16
return v.toLowerCase();
17
}
18
return undefined;
19
};
20
21
module.exports.definition = {
22
set: implicitSetter('border', 'color', isValid, parser),
23
get: function () {
24
return this.getPropertyValue('border-color');
25
},
26
enumerable: true,
27
configurable: true
28
};
29
30