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

Add a "row without gutters" class #19107

Closed
IamManchanda opened this issue Feb 7, 2016 · 15 comments
Closed

Add a "row without gutters" class #19107

IamManchanda opened this issue Feb 7, 2016 · 15 comments

Comments

@IamManchanda
Copy link

IamManchanda commented Feb 7, 2016

There are many instances when u want the grid to don't have the gutters in it .
As it just take small 8-9 lines of code then why not

.row.no-gutters {
  margin-right: 0;
  margin-left: 0;
}
.row.no-gutters > [class^="col-"],
.row.no-gutters > [class*=" col-"] {
  padding-right: 0;
  padding-left: 0;
} 

The SCSS/Less Version of the same

.row.no-gutters {
  margin-right: 0;
  margin-left: 0;

  & > [class^="col-"],
  & > [class*=" col-"] {
    padding-right: 0;
    padding-left: 0;
  }
}

The scss-lint version

.row.no-gutters {
  margin-right: 0;
  margin-left: 0;

> [class^="col-"],
> [class*=" col-"] {
    padding-right: 0;
    padding-left: 0;
  }
}

Will be great if this can be added in v4 ?

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 7, 2016

New features are no longer being allowed into v3.

@cvrebert
Copy link
Collaborator

cvrebert commented Feb 7, 2016

Duplicate of #15180, although that was only for v3.

@cvrebert cvrebert changed the title Add a no-gutters class to use it with row Add a "row without gutters" class Feb 7, 2016
@IamManchanda
Copy link
Author

Pardon that ,,, but can it be added to v4 ..
I am using this no gutter class whenever needed in my official projects from quite some time now and can tell you its a very useful method !!!
Will be a good addition for v4 if not great!

On the duplication thing , well there is not one but there are many requests for the same
which means people wants it then why not !

@kevinruscoe
Copy link
Contributor

I think that's the point of sass. Just set the padding to 0 and recompile.

@RyanZim
Copy link

RyanZim commented May 3, 2016

Perhaps you could use the existing .p-x-0 & .m-x-0.

@silvereh
Copy link

I would find it super useful as well. I never thought of doing it before and created instead no-margin and no-padding classes to override the usual row behavior.

Looking at the structure of the sass files of v4, to add it should look like this:

  • in scss/mixins/_grid-framework.scss:
    line 6, put gutter as 1st parameter in
@mixin make-grid-columns()
  • in scss/_grid.scss:
    change row declaration to:
@if $enable-grid-classes {
  .row {
    @include make-row();
  }
  .row.no-gutters {
    @include make-row(0);
    & > {
      @include make-grid-columns(0);
    }
  }
}

@cvrebert
Copy link
Collaborator

CC: @mdo for feedback

@IamManchanda
Copy link
Author

IamManchanda commented Sep 24, 2016

@mdo @cvrebert
Just wanna say that I am is using this no-gutters from around a year and this works like wonders and can be a good feature if its gets added up for Bootstrap 4.

@spdpiyush
Copy link

Waiting For The V4

@mdo mdo modified the milestone: v4.1 ideas Oct 9, 2016
@IamManchanda
Copy link
Author

IamManchanda commented Nov 1, 2016

@silvereh - I am not very good in sass ( at the moment ) ... so can you please do a pull request for the same

Update (21 Mar, 2017): Now I am good in sass/scss. 😈

@silvereh
Copy link

silvereh commented Nov 2, 2016

@IamManchanda
OK, I'll try. Though it's my first open source contribution and I'm not too confident with it so it might take me a bit of time.

@IamManchanda
Copy link
Author

@silvereh
You can try this Tutorial for the same

@garygreen
Copy link

+1 this really should be built into bootstrap. At the moment you cannot use the grid system without adding gutters (except with the .no-gutter class snippet as posted above). Would be nice to see this baked in

@SimonDegraeve
Copy link

SimonDegraeve commented Dec 22, 2016

I think the specificity of .no-gutters is not high enough. It get overwritten by the margin in the media queries.

The margin properties of .no-gutters should be marked as important or the selector should be .row.no-gutters.

@IamManchanda
Copy link
Author

IamManchanda commented Dec 24, 2016

@SimonDegraeve if you have to ask me, i will go with .row.no-gutters as using !important is not the best option in this or infact many specific scenario

mdo added a commit that referenced this issue Jul 10, 2017
fixes #15180, fixes #19107, fixes #9102, fixes #7368
XhmikosR pushed a commit that referenced this issue Apr 7, 2018
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

9 participants