threepointone / glamor

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

content property: empty string (" ") becomes "px" #350

Open sdgluck opened 6 years ago

sdgluck commented 6 years ago

I am trying to create a keyframe animation that looks like this:

const cursorBlinkAnim = keyframes({
  '0%': {content: '_'},
  '100%': {content: ' '}
})

But when compiled by glamor the CSS becomes:

@keyframes animation_wzvti9{0%{content:_;}100%{content:px;}}

Using any alternative whitespace character has similar behaviour.

Just in case it's important, I am using glamorous too.

Any ideas?

martinpalmieri commented 6 years ago

Hi @sdgluck , Maybe it's too late but today I had the very same issue and I resolved it by using backticks/backquotes like this:

content: `''`,

Hope it helps.