react-grid-system
react-grid-system copied to clipboard
Add ability to change gridColumns per Container
Sometimes it's convenient to change gridColumns value on Container rather then per project globally, if it make sense I have a small solution of this problem based on the same idea with a gutter context but Provider is created on Container level and consumes gridColumn on Column level, if there is no gridColumn prop specified in Container the default value from config is applied. Example:
<Container fluid style={{ lineHeight: '32px' }} gridColumns={13}>
<Row debug>
<Col lg={7} debug>1 of 2</Col>
<Col lg={6} debug>2 of 2</Col>
</Row>
</Container>
Row consumes value from nearest Container Provider.
Are there any updates on this? I'm looking for this functionality for my project as well
Are there any updates on this? I'm looking for this functionality for my project as well
Hello, Mykhaylo! I made a PR but unfortunately maintainers don't wanna to accept this changes. You can fork and use it on your own.
It's true that I have been rather busy lately :smiley:. This is indeed a very good idea, but I would prefer a CustomConfigurationContext
over a CustomGridColumnsContext
, so that not only gridColumns can be changed per Container
, but all global configuration settings. And even more awesome (and generic) would be if the CustomConfigurationContext
also replaces GutterWidthContext
, so one can also overrule all global confguration per Row
. So if we can move to such a context, I'll definitely merge it!
And also has merge conflicts now :)
Wow :) Update, I think generic CustomConfigurationContext over custom grid configuration is definitely better idea.
Any updates?