Radium: Prefixed inline styles are not resolved

Created on 17 Jan 2018  Â·  4Comments  Â·  Source: FormidableLabs/radium

Inline styles do not generate valid CSS properties, when using the (default) prefix plugin.

const React = require("react") // v16.2.0
const Radium = require("radium") // v0.19.6
const ReactDOMServer = require("react-dom/server") // v16.2.0

const Foo = () => <div style={{display: "flex"}} />
const StyledFoo = Radium()(Foo)

ReactDOMServer.renderToString(<StyledFoo />)

The generated style (tested in RunKit) gives invalid CSS properties :

<div style="display:-webkit-box,-moz-box,-ms-flexbox,-webkit-flex,flex" … />

When it should be :

<div style="display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex" … />

According to the inline-style-prefixer documentation, array values should be resolved, using something like css-in-js-utils's resolveArrayValue, instead of joining the values by ;.

bug high priority verified

Most helpful comment

@sunny -- Thanks! We'll hopefully dig in next week!

All 4 comments

@sunny -- Would you be able to take a fork of Radium and create a failing unit test and open a work-in-progress PR? That would be great for helping us identify exactly what is going wrong. Here's the folder where our SSR tests reside: https://github.com/FormidableLabs/radium/blob/master/test/

Hey @ryan-roemer! Sure, here is a PR with a failing test -----^

This seems related to #951, which was resolved by… removing prefixes altogether.

@sunny -- Thanks! We'll hopefully dig in next week!

\o/ Thank you for the timely fix 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

exogen picture exogen  Â·  7Comments

davidebianchi picture davidebianchi  Â·  9Comments

pepjo picture pepjo  Â·  8Comments

paulwehner picture paulwehner  Â·  8Comments

zhangmengxue picture zhangmengxue  Â·  9Comments