Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRefactor popupWindow.less with Aphrodite #7929
Conversation
| } | ||
| } | ||
|
|
||
| return <div | ||
| className={cx({ | ||
| popupWindow: true, | ||
| reverseExpand: styles.right !== undefined | ||
| [css(styles.popupWindow)]: true, | ||
| [css((style.right !== undefined) && styles.reverseExpand)]: true |
This comment has been minimized.
This comment has been minimized.
cezaraugusto
Apr 5, 2017
Contributor
I know it was here before but not sure what's the reason of having it? row-reverse does nothing here
| @@ -129,6 +129,7 @@ const globalStyles = { | |||
| switchNubShadow: '1px 1px 5px -2px black', | |||
| buttonShadow: '0px 1px 5px -1px rgba(0, 0, 0, 1.0)', | |||
| dialogShadow: '0px 8px 22px 0px rgba(0, 0, 0, .5)', | |||
| flyoutDialogBoxShadow: '2px 2px 8px #3b3b3b', | |||
This comment has been minimized.
This comment has been minimized.
jonathansampson
Apr 6, 2017
Collaborator
I don't think we should be using non-black hex colors for shadows. rgba handles this particular thing much better, IMHO.
This comment has been minimized.
This comment has been minimized.
luixxiul
Apr 6, 2017
Author
Contributor
Thanks for notifying. I'll replace it this with a variable later.
| @@ -69,35 +72,55 @@ class PopupWindow extends ImmutableComponent { | |||
| } | |||
|
|
|||
| render () { | |||
| let styles = {} | |||
| let style = {} | |||
| if (parseInt(this.width)) { | |||
This comment has been minimized.
This comment has been minimized.
jonathansampson
Apr 6, 2017
Collaborator
Can we avoid doing parseInt twice for this.width and this.height?
| if (parseInt(this.width)) { | ||
| styles.width = (parseInt(this.width) + 2) | ||
| style.width = (parseInt(this.width) + 2) | ||
| } | ||
| if (parseInt(this.height)) { |
This comment has been minimized.
This comment has been minimized.
jonathansampson
Apr 6, 2017
Collaborator
Can we avoid doing parseInt twice for this.width and this.height?
This comment has been minimized.
This comment has been minimized.
| padding: 0, | ||
| position: 'absolute', | ||
| zIndex: globalStyles.zindex.zindexPopupWindow, | ||
| WebkitUserSelect: 'none' |
This comment has been minimized.
This comment has been minimized.
jonathansampson
Apr 6, 2017
Collaborator
user-select (userSelect) is supported unprefixed in Blink. We should avoid using the prefixed version.
| @@ -117,6 +117,7 @@ | |||
|
|
|||
| @buttonShadow: 0px 1px 5px -1px rgba(0, 0, 0, 0.5); | |||
| @dialogShadow: 0px 8px 22px 0px rgba(0, 0, 0, .5); | |||
| @flyoutDialogBoxShadow: 2px 2px 8px #3b3b3b; | |||
This comment has been minimized.
This comment has been minimized.
jonathansampson
Apr 6, 2017
Collaborator
To echo my earlier comment; I don't think we should use non-black HEX colors for shadows. rgba handles this much better.
This comment has been minimized.
This comment has been minimized.
|
If you can address the feedback by @jonathansampson- the changes LGTM |
|
LGTM after @jonathansampson fixes |
|
rebase pls |
|
Would anyone please add another commit to fix the issues mentioned above about parseInt? Thanks! |
|
rebased, removed remaining LESS files and updated per @jonathansampson feedback. Waiting others feedback, ++ from me |
| if (this.top + this.height < window.innerHeight) { | ||
| style.top = this.top | ||
| if (top) { | ||
| if (top + this.height < window.innerHeight) { |
This comment has been minimized.
This comment has been minimized.
Auditors: @jonathansampson
|
thanks guys for helping me out :-) |
luixxiul commentedMar 28, 2017
Also add right:1em to create margin between the pop up and the window right border
Closes #7927
Auditors: @bbondy @bridiver @bsclifton @cezaraugusto @jonathansampson - I would like to ask you to review the PR as you have edit popupWindow.js some way. Thanks in advance!
Test Plan:
git rebase -ito squash commits (if needed).