Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81145 views
1
'use strict';
2
3
var implicitSetter = require('../parsers').implicitSetter;
4
5
// the valid border-styles:
6
var styles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];
7
8
module.exports.isValid = function parse(v) {
9
return typeof v === 'string' && (v === '' || styles.indexOf(v) !== -1);
10
};
11
var isValid = module.exports.isValid;
12
13
var parser = function (v) {
14
if (isValid(v)) {
15
return v.toLowerCase();
16
}
17
return undefined;
18
};
19
20
module.exports.definition = {
21
set: implicitSetter('border', 'style', isValid, parser),
22
get: function () {
23
return this.getPropertyValue('border-style');
24
},
25
enumerable: true,
26
configurable: true
27
};
28
29