summaryrefslogtreecommitdiff
path: root/school/node_modules/cssstyle/lib/properties/width.js
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/cssstyle/lib/properties/width.js')
-rw-r--r--school/node_modules/cssstyle/lib/properties/width.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/school/node_modules/cssstyle/lib/properties/width.js b/school/node_modules/cssstyle/lib/properties/width.js
new file mode 100644
index 0000000..a8c365d
--- /dev/null
+++ b/school/node_modules/cssstyle/lib/properties/width.js
@@ -0,0 +1,24 @@
+'use strict';
+
+var parseMeasurement = require('../parsers').parseMeasurement;
+
+function parse(v) {
+ if (String(v).toLowerCase() === 'auto') {
+ return 'auto';
+ }
+ if (String(v).toLowerCase() === 'inherit') {
+ return 'inherit';
+ }
+ return parseMeasurement(v);
+}
+
+module.exports.definition = {
+ set: function(v) {
+ this._setProperty('width', parse(v));
+ },
+ get: function() {
+ return this.getPropertyValue('width');
+ },
+ enumerable: true,
+ configurable: true,
+};