Emotion: Incorrect output for empty 'content' in object style

Created on 4 Apr 2018  路  1Comment  路  Source: emotion-js/emotion

  • emotion version: 8.0.2.5
  • react version: 16.2.0

Relevant code.

const Box = styled('div')({
  display: 'flex',
  content: '',  
  justifyContent: 'center',
  alignItems: 'center',
  backgroundColor: 'darkorchid',
  width: 48,
  height: 48,
  padding: '4px 4px 8px 8px',
  margin: '8 16',
  backgroundClip: 'content-box',
});

What you did:
Set empty content.

What happened:
CSS contained content:px;
screen shot 2018-04-03 at 9 53 33 pm
See: https://codesandbox.io/s/211j8m743n

Problem description:
Empty content is being treated like a pixel value and output becomes malformed.

Suggested solution:
I haven't looked at the source.

Most helpful comment

Actually, I just discovered that this works content: '" "'. While this does make sense to me, the output seems unexpected still.

>All comments

Actually, I just discovered that this works content: '" "'. While this does make sense to me, the output seems unexpected still.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stolinski picture stolinski  路  37Comments

yonatanmn picture yonatanmn  路  29Comments

jamiewinder picture jamiewinder  路  24Comments

tkh44 picture tkh44  路  29Comments

jfrolich picture jfrolich  路  29Comments