Skip to content

String with whitespace causes uniteless css warning #6888

@jonashaefele

Description

@jonashaefele

What is the current behavior?
Assigning a style object with content: " " to component results in a unitless CSS warning:

warning: a divtag (owner:unknown) was passed a numeric string value for CSS property content(value: ) which will be treated as a unitless number in a future version of React.

Demo Fiddle with content: ""
https://jsfiddle.net/oktkht5g/

Demo fiddle with content: ""
https://jsfiddle.net/o014p2mf/1/

What is the expected behavior?
Only throw warnings for CSS properties that need them. content could be any string or one of the following values:

normal | none | [ <string> | <uri> | <counter> | attr() | open-quote | close-quote | no-open-quote | no-close-quote ]+

Which versions of React
Tested in React 15.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions