react-grid-system icon indicating copy to clipboard operation
react-grid-system copied to clipboard

Add ability to change gridColumns per Container

Open samsonovkirill opened this issue 4 years ago • 6 comments

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.

samsonovkirill avatar Sep 19 '19 19:09 samsonovkirill

Are there any updates on this? I'm looking for this functionality for my project as well

mryechkin avatar Apr 03 '20 16:04 mryechkin

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.

samsonovkirill avatar Apr 05 '20 18:04 samsonovkirill

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!

gerbenmeyer avatar Apr 19 '20 11:04 gerbenmeyer

And also has merge conflicts now :)

gerbenmeyer avatar Mar 07 '21 08:03 gerbenmeyer

Wow :) Update, I think generic CustomConfigurationContext over custom grid configuration is definitely better idea.

samsonovkirill avatar Mar 07 '21 08:03 samsonovkirill

Any updates?

matheusslg avatar Aug 31 '21 14:08 matheusslg