From a42a8f9ffdfd7142add1939036e50b88d344ace6 Mon Sep 17 00:00:00 2001 From: fsy0718 Date: Sat, 21 Apr 2018 19:59:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(source):=20=E5=A2=9E=E5=8A=A0=E5=AF=B9rpx?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- parser.jison | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 87a42ab..6412455 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "reduce-css-calc", + "name": "@jfkued/reduce-css-calc", "version": "2.1.4", "description": "Reduce CSS calc() function to the maximum", "keywords": [ diff --git a/parser.jison b/parser.jison index d7749e8..a01e574 100644 --- a/parser.jison +++ b/parser.jison @@ -30,6 +30,7 @@ ([0-9]+("."[0-9]*)?|"."[0-9]+)ex\b return 'EXS'; ([0-9]+("."[0-9]*)?|"."[0-9]+)ch\b return 'CHS'; ([0-9]+("."[0-9]*)?|"."[0-9]+)rem\b return 'REMS'; +([0-9]+("."[0-9]*)?|"."[0-9]+)rpx\b return 'RPXS'; ([0-9]+("."[0-9]*)?|"."[0-9]+)vw\b return 'VWS'; ([0-9]+("."[0-9]*)?|"."[0-9]+)vh\b return 'VHS'; ([0-9]+("."[0-9]*)?|"."[0-9]+)vmin\b return 'VMINS'; @@ -93,6 +94,7 @@ expression | EXS { $$ = { type: 'ExValue', value: parseFloat($1), unit: 'ex' }; } | CHS { $$ = { type: 'ChValue', value: parseFloat($1), unit: 'ch' }; } | REMS { $$ = { type: 'RemValue', value: parseFloat($1), unit: 'rem' }; } + | RPXS { $$ = { type: 'RpxValue', value: parseFloat($1), unit: 'rpx' }; } | VHS { $$ = { type: 'VhValue', value: parseFloat($1), unit: 'vh' }; } | VWS { $$ = { type: 'VwValue', value: parseFloat($1), unit: 'vw' }; } | VMINS { $$ = { type: 'VminValue', value: parseFloat($1), unit: 'vmin' }; }