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 elements: full width on small screens, small width on large screens? #144

Open
mikeriley131 opened this issue Jan 12, 2017 · 10 comments

Comments

@mikeriley131
Copy link

Just checking out Milligram for the first time. Maybe I'm missing something, but how do I have a grid column be 100% on small screens and then switch to 50% on large screens? Is that built into the CSS with a class that I'm not seeing or do I have to override that in my project?

@guillaumemolter
Copy link

guillaumemolter commented Jan 20, 2017

Thanks for bringing this to my attention @mikeriley131 . I was about to start using Milligram on a project but that's a big missing feature. It's not too hard to manually add it, but isn't the purpose of a css framework that you don't need to do this by hand :-).

@cjpatoilo
Copy link
Member

cjpatoilo commented Jan 28, 2017

Hi guys @mikeriley131 @guillaumemolter

Currently Milligram does not support this functionality but I liked the idea. Initially Milligram was built with the purpose of being the simplest framework, defining only the minimum of possible styles. So it does not have so many features easily found in large frameworks.

I'll think of something but if you have any idea how we could implement this functionality and want to submit a PR, feel free.

Thank you for sharing your thoughts with us.

@guillaumemolter
Copy link

@cjpatoilo I hear you and I agree that's exactly what I liked about Milligram...just the bare minimum...but for me this a basic and essential responsive design feature.

@mikeriley131
Copy link
Author

OK, thanks @cjpatoilo. Happy to create a PR, just wanted to make sure I wasn't missing something first.

@guillaumemolter
Copy link

@mikeriley131 happy to help, review PR, etc...

@CSuttie
Copy link

CSuttie commented Mar 8, 2017

Created pull request 155 to add the responsive grid feature: #155

Demo at http://codepen.io/csuttie/pen/BWQMwM

@Lilja
Copy link

Lilja commented Apr 2, 2017

I played around with a media query, bear with me. I'm a guy who likes back-end stuff and plays around with Linux most of my time so take my front-end development with a grain of salt. Also I haven't done anything in any css pre-processor.

@media (min-width: 495px) and (max-width:800px) {
    .row .column[class*=" column-"] {
        max-width: 100%;
    }
}

It matches a .row with a .column in the child or grand-child(why would you want even want an element in between of .row and .column?) which is followed by a .column-* where the * is a wild-card.

What do you think?

remarks : 495 pixels is the limit because that's the minimal resized amount chrome allowed me. 800px has no significant remark.

@promatik
Copy link
Contributor

@cjpatoilo oi!
I think @Lilja code snippet is a must have in milligram, my suggestion would be to place a .responsive class in the columns we want to be full width in mobile, although they are set to some %.

@media (max-width: 40rem) {
    .row .column.responsive[class*=" column-"] {
        margin-left: 0;
        max-width: 100%;
    }
}

So in mobile screens, this:
image

would become this:

image

@cjpatoilo cjpatoilo self-assigned this May 20, 2020
@Zaid-Parkar
Copy link

Hello Sir,
I would like to contribute to this project,
I am new to hacktoctoberfest and this would be a great beginning.
Thank you...

@promatik
Copy link
Contributor

Hello Sir, I would like to contribute to this project, I am new to hacktoctoberfest and this would be a great beginning. Thank you...

@Zaid-Parkar that's off topic, please send a message directly to cjpatoilo.

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

7 participants