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

Make container padding configurable on a per-breakpoint basis #19304

Closed
Mevrael opened this issue Feb 24, 2016 · 3 comments
Closed

Make container padding configurable on a per-breakpoint basis #19304

Mevrael opened this issue Feb 24, 2016 · 3 comments

Comments

@Mevrael
Copy link

Mevrael commented Feb 24, 2016

Currently there is only one variable to set $grid-gutter-width which is 30px by default, however, in modern applications on some screens (breakpoints) another gutter size and container padding would be more preferable.

I would suggest adding new map variable and mixin so .container, .row, .col-* and other grid class paddings could be easily configured. Map can be empty if there is no need in chaning spacings for different breakpoints.

Here is an example how I am changing spacers for different screens.

// default main section padding (for > xl)
$app-section-padding-y: 3rem;
$app-section-padding-x: 5rem;

// main section padding for different breakpoints down
$app-section-padding: (
  xl: (3rem, 4rem),
  lg: (2.75rem, 3.5rem),
  md: (2.5rem, 3rem),
  sm: (1.25rem, 2rem)
);


@mixin app-section {
  margin-left: auto;
  margin-right: auto;
  padding: $app-section-padding-y $app-section-padding-x;

  @each $key, $list in $app-section-padding {

    @include media-breakpoint-down($key) {
      padding: nth($list, 1) nth($list, 2);
    }

  }

};
@cvrebert
Copy link
Collaborator

The gutter portion is covered by #17481, so I'll trim this to be about container specifically.

@cvrebert cvrebert changed the title [v4] Configurable gutter and container spacing for different breakpoints Make container padding configurable on a per-breakpoint basis Feb 24, 2016
@pixelbandito
Copy link
Contributor

pixelbandito commented Oct 11, 2016

I'm going to try to pick this up with the same pattern as #17481, mentioned above.

(But if anyone else beats me to it, welcome!)

@pixelbandito
Copy link
Contributor

I have a PR going through the automated checks right now.

I chose to re-use the same gutters-per-breakpoint variable for container padding and for grid system padding.

@Mevrael Does that sound reasonable to you?

twbs-savage pushed a commit to twbs-savage/bootstrap that referenced this issue Oct 25, 2016
…kpoints

Container padding uses per-breakpoint gutter sizes, fixes twbs#19304.
@mdo mdo closed this as completed in e1fefe6 Oct 25, 2016
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