-
Notifications
You must be signed in to change notification settings - Fork 52
fix(Dialog): make width responsive #2193
base: master
Are you sure you want to change the base?
Conversation
}, | ||
'@media (min-width: 1280px)': { | ||
width: v.rootWidth, | ||
}, |
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.
@codepretty can you please provide proper breakpoints? 🙏
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.
Trying to nail down the breakpoint logic with Design... Almost have it figured out.
Perf comparison
Perf tests with no regressions
Generated by 🚫 dangerJS |
rootWidthLarge: '50vw', | ||
rootWidthLargeBreakpoint: '@media (min-width: 1280px)', | ||
rootWidthMedium: '75vw', | ||
rootWidthBreakpointMedium: '@media (min-width: 768px)', |
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.
rootWidthBreakpointMedium: '@media (min-width: 768px)', | |
rootWidthMediumBreakpoint: '@media (min-width: 768px)', |
|
||
rootWidth: '90vw', | ||
rootWidthLarge: '50vw', | ||
rootWidthLargeBreakpoint: '@media (min-width: 1280px)', |
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.
I am kind a leaning more towards allowing users to specify only the px value here, not the whole string, but I am not sure. We should make that decision now, as this is the first PR that is adding breakpoints
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.
I am not sure that we should limit user there as media queries support a lot of attributes:
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
@@ -16,6 +16,13 @@ export default { | |||
gridTemplateColumns: '1fr auto', | |||
boxShadow: v.boxShadow, | |||
color: v.foregroundColor, | |||
|
|||
[v.rootWidthBreakpointMedium]: { |
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.
Shouldn't we check whether it is defined first?
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.
It's required by typings. Why we need to have additional checks there?
Fixes #2139.
This PR adds
media
selectors forDialog
to make it responsible: