From d164010319c08e11cf18d73c4bcd24166768529b Mon Sep 17 00:00:00 2001 From: Vitaly Harisov Date: Mon, 15 Apr 2019 23:18:41 +0300 Subject: [PATCH] Add support for 'font: 14px / 16px' --- package.json | 2 +- postcss-automath.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d43db09..3388fc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postcss-automath", - "version": "1.0.1", + "version": "1.1.0", "description": "Automatically evaluate mathematical expressions in your CSS source files, like in SASS or LESS. No special function calls needed as with `postcss-mathjs`.", "main": "postcss-automath.js", "scripts": { diff --git a/postcss-automath.js b/postcss-automath.js index 7c8805a..c439ab9 100644 --- a/postcss-automath.js +++ b/postcss-automath.js @@ -53,6 +53,7 @@ module.exports = postcss.plugin('postcss-math', function () { if (!node[nodeProp] // no value || !node[nodeProp].match(/\d/) // no numbers || !node[nodeProp].match(/\*|\+|\/|-|%/) // no math + || node.prop === 'font' && node[nodeProp].match(/\//) // font: 14px / 16px serif; || node[nodeProp].match(/^\s*calc\s*\(/) // exclude in-browser calc() statements || node[nodeProp].match(/^\d+\w*%$/)) { // exclude special case for single percentage values return;