Do you want to request a feature or report a bug?
Bug
ReactDOMServer.renderToString is mutating CSS Variable names that are inlined and in the --camelCase format into --kebab-caseReactDOMServer.renderToString does not mutate the CSS Variable name, and keeps it in --camelCase format[email protected] & [email protected] [email protected] & [email protected] ReactDOM.render is preserving the CSS Variable name and not mutating it. It only seems to only be an issue with ReactDOMServer.renderToStringI'd like to work on this one.
I think problem is the createMarkupForStyles function (react-dom/server/ReactPartialRenderer.js), because It runs hyphenateStyleName on custom css property so that's why CSS variable casing is mutated.
I assume solution should looks like this:
serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';
Maybe It would be better to perform check inside processStyleName function so styleName is cached as well.
Most helpful comment
I'd like to work on this one.
I think problem is the
createMarkupForStylesfunction (react-dom/server/ReactPartialRenderer.js), because It runshyphenateStyleNameon custom css property so that's why CSS variable casing is mutated.I assume solution should looks like this:
serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';Maybe It would be better to perform check inside
processStyleNamefunction so styleName is cached as well.