throw new InvalidPropertyError('Missing font values at ' + formatPosition(property.all[property.position][1][2][0]) + '. Ignoring.');
}
- if (values.length == 1 && (validator.isFontKeyword(values[0][1]) || validator.isPrefixed(values[0][1]))) {
- values[0][1] = Marker.INTERNAL + values[0][1];
+ if (values.length == 1 && values[0][1] == 'inherit') {
style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values;
return components;
}
- if (values.length == 1 && values[0][1] == 'inherit') {
+ if (values.length == 1 && (validator.isFontKeyword(values[0][1]) || validator.isGlobal(values[0][1]) || validator.isPrefixed(values[0][1]))) {
+ values[0][1] = Marker.INTERNAL + values[0][1];
style.value = variant.value = weight.value = stretch.value = size.value = height.value = family.value = values;
return components;
}
assert.deepEqual(components[6].value, [['property-value', '-clean-css-icon']]);
}
},
+ 'unset font': {
+ 'topic': function () {
+ return _breakUp([
+ [
+ 'property',
+ ['property-name', 'font'],
+ ['property-value', 'unset']
+ ]
+ ]);
+ },
+ 'has 7 components': function (components) {
+ assert.lengthOf(components, 7);
+ },
+ 'has font-style': function (components) {
+ assert.equal(components[0].name, 'font-style');
+ assert.deepEqual(components[0].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has font-variant': function (components) {
+ assert.equal(components[1].name, 'font-variant');
+ assert.deepEqual(components[1].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has font-weight': function (components) {
+ assert.equal(components[2].name, 'font-weight');
+ assert.deepEqual(components[2].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has font-stretch': function (components) {
+ assert.equal(components[3].name, 'font-stretch');
+ assert.deepEqual(components[3].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has font-size': function (components) {
+ assert.equal(components[4].name, 'font-size');
+ assert.deepEqual(components[4].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has line-height': function (components) {
+ assert.equal(components[5].name, 'line-height');
+ assert.deepEqual(components[5].value, [['property-value', '-clean-css-unset']]);
+ },
+ 'has font-family': function (components) {
+ assert.equal(components[6].name, 'font-family');
+ assert.deepEqual(components[6].value, [['property-value', '-clean-css-unset']]);
+ }
+ },
'system font with vendor prefix': {
'topic': function () {
return _breakUp([