-
Notifications
You must be signed in to change notification settings - Fork 53
fix(Popup): styles for dark and HC Teams themes #1121
Changes from 2 commits
e80333a
828d275
d955bdd
a3d0983
aa5f7e5
e213705
f4d9fe4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PopupContentVariables } from '../../../teams/components/Popup/popupContentVariables' | ||
|
||
export default (siteVars: any): Partial<PopupContentVariables> => ({ | ||
borderColor: siteVars.colors.black, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PopupVariables } from '../../../teams/components/Popup/popupVariables' | ||
|
||
export default (siteVars: any): Partial<PopupVariables> => ({ | ||
color: siteVars.colors.white, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { PopupVariables } from '../../../teams/components/Popup/popupVariables' | ||
|
||
export default (siteVars: any): Partial<PopupVariables> => ({ | ||
color: siteVars.colors.white, | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ const popupStyles: ComponentSlotStylesInput<PopupProps, PopupVariables> = { | |
popup: ({ variables }): ICSSInJSStyle => ({ | ||
zIndex: variables.zIndex, | ||
position: 'absolute', | ||
color: variables.contentColor, | ||
background: variables.contentBackgroundColor, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since now we have relevant styles for Dark and HC themes, can we add a few screenshot tests for these themes for relevant Popup examples? It'd be great to add some steps too, but that can be in different PR, something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, will take as a follow-up |
||
}), | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,12 @@ export interface PopupVariables { | |
[key: string]: string | number | ||
|
||
zIndex: number | ||
contentColor: string | ||
contentBackgroundColor: string | ||
} | ||
|
||
export default (siteVars: any): PopupVariables => ({ zIndex: 1000 }) | ||
export default (siteVars: any): PopupVariables => ({ | ||
zIndex: 1000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how did we come up with this value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure, agreed to use the one that has worked for us back then :) Low numbers might put Popup design at risk, as there might be some client's components that rely on some elements shown on top of the others, and |
||
contentColor: siteVars.bodyColor, | ||
contentBackgroundColor: siteVars.bodyBackground, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why we moved the background style from the
PopupContent
to thePopup
? I'd prefer to see them in it's own component styles, rather then in the popup, especially because they are not anyhow dependent on some props from thePopup
component.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - the reason is that we want to see the background and foreground colors being applied to the popup's content irregardless of what is rendered as popup content. Previously we have introduced proper styles only for the cases when
PopupContent
was rendered at thecontent
slot - however, in case if user would render plain content there, there won't be any background/foreground styles applied at all. Thus, the following codewould result in the presentation that was mentioned in the PR's description:
However, what client really wants here is proper basic styles applied even if plain content is provided to the slot:
That's why the variables were moved - note that with that we are not limiting client in overriding styles for the content in case if necessary (so, if
content
provides its own styles forbackground
andcolor
, then those will be used)