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

Different gutter widths by breakpoint/media query #417

Open
cphoover opened this issue Aug 14, 2018 · 5 comments
Open

Different gutter widths by breakpoint/media query #417

cphoover opened this issue Aug 14, 2018 · 5 comments

Comments

@cphoover
Copy link

Perhaps this is a dumb question, but I couldn't find the answer after a precursory look through the docs.

Is there a way to change the global gutter width at specific breakpoints? For e.g. make it a thinner sized gutter on mobile than on desktop.

TY

@cphoover cphoover changed the title Different gutter widths on mobile Different gutter widths by breakpoint/media query Aug 14, 2018
@peterramsing
Copy link
Owner

I've had this question a few times. Presently, there isn't a way to change the global gutter from mobile to desktop.


Maybe this is something I should look into adding. 🤔

@cphoover
Copy link
Author

@peterramsing If you can point me in the right direction. I might be able to take a stab at it when I have some time.

@cphoover
Copy link
Author

I would like to use Lost, but I can already can guarantee the designers on our team will adjust the gutter width on mobile, and I'm not sure where to go from there.

@olegdenisov
Copy link

how can I change gutter for different viewport globally?

@taltmann42
Copy link

For a workaround until this may be implemented, you could declare mixins that handle the different gutter sizes. Declare global variables for gutter sizes and create the mixins according to your breakpoints:

$mobile-gutter: 10px;
$desktop-gutter: 20px;

@mixin mobile-column($ratio, $cycle: 0) {
  lost-column: $ratio $cycle $mobile-gutter;
}

@mixin desktop-column($ratio, $cycle: 0) {
  @media (min-width: 800px) {
    lost-column: $ratio $desktop-gutter; 
  }
}

This is for a mobile-first approach, you can also adjust the media queries or use multiple mixins like column-only-tablet or the like.

Using these would look like this:

.some-element {
  @include mobile-column(8/12, 1);
  @include desktop-column(4/12, 2);
}

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

4 participants