-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added an ability to use different margins for different breakpoints. #964 #1016
added an ability to use different margins for different breakpoints. #964 #1016
Conversation
…rent breakpoints.
- update README; - update default value for margin into RRGL;
lib/ResponsiveReactGridLayout.jsx
Outdated
* @param {String} breakpoint Breakpoint: lg, md, sm, xs and etc. | ||
* @return {Array} | ||
*/ | ||
getMarginPaddingValue = (param: any, breakpoint: string) => { |
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 think it'll be better to extract this method into a separate function in this file. It doesn't seem like a member of the class and maybe we should rename it: 'getMarginPaddingValue' -> 'getIndentationValue'
README.md
Outdated
@@ -359,6 +359,14 @@ breakpoints: ?Object = {lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}, | |||
// # of cols. This is a breakpoint -> cols map, e.g. {lg: 12, md: 10, ...} | |||
cols: ?Object = {lg: 12, md: 10, sm: 6, xs: 4, xxs: 2}, | |||
|
|||
// # of margin. This is a breakpoint -> margin map, e.g. {lg: [10, 10], md: [10, 10], ...} or [10 , 10] |
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.
This comment is a little unclear.
Suggest:
// margin (in pixels). Can be specified either as horizontal and vertical margin, e.g. `[10, 10]` or as a breakpoint -> margin map, e.g. `{lg: [10, 10], md: [10, 10], ...}.
margin: [number, number] | {[breakpoint: $Keys<breakpoints>]: [number, number]}
lib/ResponsiveReactGridLayout.jsx
Outdated
* @return {Array} | ||
*/ | ||
|
||
function getIndentationValue(param: any, breakpoint: string) { |
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.
Unexpected any
type here
@STRML i think we should merge it |
LGTM, thanks. |
Added an ability to use different margins, containerPaddings for different breakpoints.
Fixes #964