Skip to content
This repository was archived by the owner on Dec 1, 2020. It is now read-only.

Add support for 'font: 14px / 16px' #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
1 change: 1 addition & 0 deletions postcss-automath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down