Open Pyrolistical opened 8 years ago
👍
babel does some silly things with tagged template literals, going to simplify and try to just add support for string literal instead
added proof of concept with passing unit test: https://github.com/Pyrolistical/babel-plugin-css-in-js/tree/string-literal-poc
it('works with template literal as argument', () => {
const css = testTransformed({
from: 'var styles = cssInJS(`.foo { margin-top: -10px }`);',
to: 'var styles = { foo: "test-styles-foo" };'
});
testStyleRule(css, 'test-styles-foo', 'margin-top: -10');
});
Hi @Pyrolistical, nice work! Could you please provide a proper PR that I can merge? Also please add a few lines to the README explaining the new feature. Thanks!
I love inline-css, but I don't like the mental gymnastics I need to do to convert css into a js object.
Could we add template literal support to allow us to write more vanilla css?
for example we could convert this:
to
the output would be the same