Allow use of externally defined styles#143
Conversation
…ernal styles are being used instead.
986be5f to
2039500
Compare
| const overlayStyle = {...defaultStyles.overlay, ...this.props.styles.overlay}; | ||
| const sidebarStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.sidebar, ...this.props.styles.sidebar}; | ||
| const contentStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.content, ...this.props.styles.content}; | ||
| const overlayStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.overlay, ...this.props.styles.overlay}; |
There was a problem hiding this comment.
'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an identifier and instead saw 'this' (a reserved word).
Expected ')' to match '}' from line 222 and instead saw '.'.
'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option).
Unnecessary semicolon.
| const contentStyle = {...defaultStyles.content, ...this.props.styles.content}; | ||
| const overlayStyle = {...defaultStyles.overlay, ...this.props.styles.overlay}; | ||
| const sidebarStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.sidebar, ...this.props.styles.sidebar}; | ||
| const contentStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.content, ...this.props.styles.content}; |
There was a problem hiding this comment.
Class properties must be methods. Expected '(' but instead saw 'contentStyle'.
Expected '(' and instead saw '}'.
Expected an identifier and instead saw ':'.
'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an identifier and instead saw 'this' (a reserved word).
Expected ')' to match '}' from line 222 and instead saw '.'.
'function closure expressions' is only available in Mozilla JavaScript extensions (use moz option).
Expected an identifier and instead saw ';'.
| const sidebarStyle = {...defaultStyles.sidebar, ...this.props.styles.sidebar}; | ||
| const contentStyle = {...defaultStyles.content, ...this.props.styles.content}; | ||
| const overlayStyle = {...defaultStyles.overlay, ...this.props.styles.overlay}; | ||
| const sidebarStyle = {...this.props.externalStylesOnly ? {} : defaultStyles.sidebar, ...this.props.styles.sidebar}; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Expected '}' to match '{' from line 221 and instead saw '...'.
Missing semicolon.
'spread/rest operator' is only available in ES6 (use 'esversion: 6').
Expected an assignment or function call and instead saw an expression.
Unnecessary semicolon.
|
Seems reasonable, I can definitely see how this would be useful to many developers. I just have one objection with the following code:
The styles that the user has explicitly passed in through the Maybe the above code snippet should look something like this instead:
What do you think? |
Allowed internal component styles to be ignored, in the case that external styles are being used instead.