Skip to content
This repository has been archived by the owner on Nov 12, 2017. It is now read-only.

Commit

Permalink
add multi-line support for addCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkrick committed Apr 30, 2016
1 parent 8b563d6 commit e36febf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/react-look/modules/api/StyleContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class StyleContainer {
* @param {string} styles - as css string
*/
addStatic(styles) {
this._addAndEmit(this.statics, styles.replace(/\s/g, ''))
this._addAndEmit(this.statics, styles.replace(/\s+/g, ''))
}

/**
Expand Down
5 changes: 3 additions & 2 deletions packages/react-look/test/api/StyleContainer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ describe('Adding a static css string with spaces and comments', () => {
* Banner
*/
.h1 {
color: red;
color: red;
margin: 10px 10px 10px 10px;
}`
StyleContainer.addStatic(css)
expect(StyleContainer.statics.has(css.replace(/\s/g, ''))).to.eql(true)
expect(StyleContainer.statics.has(css.replace(/\s+/g, ''))).to.eql(true)
})
})

Expand Down

0 comments on commit e36febf

Please sign in to comment.