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-XX-column() with custom width #15261

Closed
achtan opened this issue Dec 1, 2014 · 3 comments
Closed

.make-XX-column() with custom width #15261

achtan opened this issue Dec 1, 2014 · 3 comments
Labels

Comments

@achtan
Copy link

achtan commented Dec 1, 2014

now i cant create custom grid column width because the function definition is:

.make-sm-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  min-height: 1px;
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  @media (min-width: @screen-sm-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

solution with no BC's can look like this:

.make-sm-column(@columns; @gutter: @grid-gutter-width) {
  .make-sm-column-with-width(percentage((@columns / @grid-columns)), @gutter);
}

.make-sm-column-with-width(@width, @gutter: @grid-gutter-width) {
  position: relative;
  min-height: 1px;
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  @media (min-width: @screen-sm-min) {
    float: left;
    width: @width;
  }
}

(and so on for other devices xs, md...)

i am new here... is this a good approach? or am i missing something ?

@cvrebert cvrebert added the css label Dec 1, 2014
@cvrebert
Copy link
Collaborator

cvrebert commented Dec 1, 2014

Bootstrap's grid system design is based on proportional-width columns, with N columns per row.
The normal way to customize it isn't to directly set a column width like that.

@achtan
Copy link
Author

achtan commented Dec 1, 2014

yes, mostly i can live with that, but sometimes i need split row into 11 columns and than split for 15 and so on...

so imho this can by really helpful

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 1, 2014

Duplicate of #13965 then.

@cvrebert cvrebert closed this as completed Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants