Skip to content
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

[Grid] - Support a "container" for the grid system #472

Closed
mikeni opened this issue Aug 8, 2017 · 7 comments
Closed

[Grid] - Support a "container" for the grid system #472

mikeni opened this issue Aug 8, 2017 · 7 comments
Milestone

Comments

@mikeni
Copy link

mikeni commented Aug 8, 2017

Looking at the front page of the showcase in the docs,
https://react-md.mlaursen.com/discover-more/showcases

it seems to use materialize
https://bredariol.be/

and in
https://bredariol.be/product?
it is using react-md

I'm looking to do a fixed with container layout like the front page, is that possible out of the box with react-md?

if not, what are you guys using to achieve that? My app is primarily targeting desktop.

@fkhadra
Copy link
Contributor

fkhadra commented Aug 8, 2017

Hey @mikeni,

I'm migrating the old code base written in Phpto react-md. It will be released this month.

The home page for the new version:
screenshot from 2017-08-08 11-16-21

What do you mean by fixed with container? Centered layout ?

@mikeni
Copy link
Author

mikeni commented Aug 8, 2017

there is a max width for container at certain responsive widths, kinda like the picture you posted, you see how the 3 columns are part of a container that has a max width?

basically fixed layout

@fkhadra
Copy link
Contributor

fkhadra commented Aug 8, 2017

Indeed. I created a simple container class for that:

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (min-width: 400px) {
    .container {
        width: 85%;
        padding: 0;
    }
}

@media (min-width: 550px) {
    .container {
        width: 80%;
    }
}

I did the following:

<div className="md-grid container">
      <div className="md-cell md-cell--4">
        <div>
          <div className="md-text-center home__icon">
            <FontIcon iconClassName="fa fa-globe"/>
          </div>
          <h2 className="md-text-center">Une Découverte</h2>

          <p className="md-font-light">
            Les Passions de Péronnes proposent de vous faire découvrir des vins
            de terroirs, des vins de vignerons. Ceux-ci étant, pour la plupart,
            rencontrés lors de périples oeno-touristiques, nous racontant leurs
            vins, leurs espoirs quelques fois très fous.
          </p>
        </div>
      </div>
      <div className="md-cell md-cell--4">
        <div>
          <div className="md-text-center home__icon">
            <FontIcon iconClassName="fa fa-group"/>
          </div>
          <h2 className="md-text-center">Une Expérience Partagée</h2>
          <p className="md-font-light">
            Choisir son vin pour la bonne occasion, une joie pour certains, un
            casse-tête pour d’autres. Nous vous conseillerons donc pour vos
            accords “mets et vins”, mais aussi en fonction de vos goûts et de
            votre palais.
          </p>
        </div>
      </div>
      <div className="md-cell md-cell--4">
        <div>
          <div className="md-text-center home__icon">
            <FontIcon iconClassName="fa fa-thumbs-o-up"/>
          </div>
          <h2 className="md-text-center">Un commerce Equitable</h2>
          <p className="md-font-light">Nous trouvons un compromis ( le juste
            prix ) entre le vigneron
            devant vivre de sa production de vins et le client œnophile voulant
            acquérir “son vin” à un prix raisonnable auprès du négociant.</p>
        </div>
      </div>
    </div>

@mikeni
Copy link
Author

mikeni commented Aug 8, 2017

ah ok, I'm wondering why material frameworks usually don't have this, most are mobile focused. Material-ui, react-md, etc don't have it, but older frameworks like semantic-ui and bootstrap do

@fkhadra
Copy link
Contributor

fkhadra commented Aug 8, 2017

I don't know too.
@mlaursen what do you think if react-md had something like

.md-grid--centered{
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (min-width: 400px) {
    .md-grid--centered{
        width: 85%;
        padding: 0;
    }
}

@media (min-width: 550px) {
    .md-grid--centered{
        width: 80%;
    }
}

md-grid--centered will act as a modifier for md-grid.

<div className="md-grid md-grid--centered">
//component
</div>

Just an idea.

Edit: I can work on a PR is you want.

@mlaursen
Copy link
Owner

mlaursen commented Aug 8, 2017

I normally just use the md-text-container as my centered grids, but I do think another configurable one might be helpful.

If you can make something that will allow the breakpoints and widths to be dynamic/configurable, I'll be happy for a PR! (I'd also prefer the name md-grid--container to go with the other naming schemes if possible)

@fkhadra
Copy link
Contributor

fkhadra commented Aug 8, 2017

I forgot about md-text-container !

Thanks for the input. I'll start to think how to implement it.

@mlaursen mlaursen changed the title why does the frontpage of the showcase use materialize? [Grid] - Support a "container" for the grid system Aug 8, 2017
@mlaursen mlaursen added this to the v1.2.0 milestone Sep 6, 2017
@mlaursen mlaursen closed this as completed Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants