Skip to content

Conversation

@ngub
Copy link
Contributor

@ngub ngub commented Apr 2, 2017

Currently it is impossible to use delimiters in styleName other than a single space symbol. The change allows to use any whitespace characters, such as a newline character which is handy if you use multiple class names in a single styleName attribute combined with ES6 string literal.

Motivation

We are using BEM along with react-css-modules (because we are not yet decided if we are ready to abandon BEM in favor of CSS Modules). So we have multiple and pretty long string in styleName and ES6 string literal come to rescue here because it allows to write it multiline (also string templates make it easier to write modifiers). Unfortunately we can't use this nifty feature, because the styleName parser recognizes a newline character as a part of a class name which leads to conflicts between code and stylesheets thus we have to write styleName strings of hundreds colons wide.

Currently it is impossible to use delimiters in styleName other than a single space symbol. The change allows to use any whitespace characters, such as a newline character which is handy if you use multiple class names in a single styleName attribute combined with ES6 string literal.
@gajus gajus merged commit b5d84c1 into gajus:master Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants