Any number of more than 10 computed values using css or styled don't get their replacements replaced.
(Sorry for yet another issue, just been stress testing Emotion recently 馃槅 )
emotion version: ^5.1.3react version: ^15.6.1See the demo repo here: https://github.com/hamlim/emotion-breaks-after-ten-computed/blob/master/src/App.js
const app = css`
background: ${'white'};
color: ${'black'};
text-decoration: ${'underline'};
display: ${'block'};
border-radius: ${'3px'};
padding: ${'25px'};
width: ${'500px'};
z-index: ${100};
font-size: ${'18px'};
text-align: ${'center'};
border: ${'solid 1px red'};
`;
The 11th computed value only shows as xxx10xxx:

Use css or styled and have 11 computed values of any kind (just template expressions will work like in the sample above)
Seems like Emotion only catches single digits when matching xxx[number]xxx.
The plugin should catch more than just single digit replacements.
Sounds like changing possibly changing this line https://github.com/tkh44/emotion/blob/master/src/babel.js#L22 to:
const re = /xxx(\S*)xxx|attr\(([^,\s)]+)(?:\s*([^,)]*)?)(?:,\s*(\S+))?\)/gm
(added an * right after the \S in-between the xxx's
This allows it to match xxx10xxx and up. But I don't have too much experience with regex pattern matching, only tested roughly here: https://regex101.com/r/tPdzC7/1 so this might act in different ways too.
Released in 5.1.4
cc @hamlim
Thanks a ton for fixing this!
Most helpful comment
Released in
5.1.4cc @hamlim