threepointone / glamor

inline css for react et al
MIT License
3.66k stars 199 forks source link

Using calc in css template literal gives parsing error #156

Open vramana opened 7 years ago

vramana commented 7 years ago

image

In this example, containerRule works fine but containerRuleTT doesn't parse. It gives the error

7:58:44 AM web.1 |  ERROR in ./src/components/views/Layout.js
7:58:44 AM web.1 |  Module build failed: SyntaxError: Expected ")", ",", "/", "\\", "\\s", "s", angle, frequency, function, hash, identifier, length, number, percentage, string, time, uri, or whitespace but "-" found.
7:58:44 AM web.1 |      at peg$buildStructuredError (/home/vramana/Documents/work/kisi-web/node_modules/glamor/lib/css/spec.js:5:19796)
7:58:44 AM web.1 |      at peg$parse (/home/vramana/Documents/work/kisi-web/node_modules/glamor/lib/css/spec.js:5:136231)
7:58:44 AM web.1 |      at parser (/home/vramana/Documents/work/kisi-web/node_modules/glamor/lib/css/babel.js:171:16)
7:58:44 AM web.1 |      at PluginPass.TaggedTemplateExpression (/home/vramana/Documents/work/kisi-web/node_modules/glamor/lib/css/babel.js:183:23)
7:58:44 AM web.1 |      at newFn (/home/vramana/Documents/work/kisi-web/node_modules/babel-traverse/lib/visitors.js:276:21)
7:58:44 AM web.1 |      at NodePath._call (/home/vramana/Documents/work/kisi-web/node_modules/babel-traverse/lib/path/context.js:76:18)
7:58:44 AM web.1 |      at NodePath.call (/home/vramana/Documents/work/kisi-web/node_modules/babel-traverse/lib/path/context.js:48:17)
7:58:44 AM web.1 |      at NodePath.visit (/home/vramana/Documents/work/kisi-web/node_modules/babel-traverse/lib/path/context.js:105:12)
threepointone commented 7 years ago

looks like a bug, will check.