Skip to content

Commit

Permalink
Add grid breakpoint for 480px
Browse files Browse the repository at this point in the history
This is the col-ms purposal in twbs#10203 for v3.3.1
  • Loading branch information
sergio91pt committed Jan 19, 2015
1 parent 9a7e365 commit fe2580a
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dist/css/bootstrap-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-theme.min.css

Large diffs are not rendered by default.

213 changes: 205 additions & 8 deletions dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Bootstrap v3.3.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/

Expand Down
2 changes: 1 addition & 1 deletion dist/js/bootstrap.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions less/grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@

.make-grid(xs);

// Mid small grid
//
// Columns, offsets, pushes, and pulls for extra small devices like
// smartphones.

@media (min-width: @screen-ms-min) {
.make-grid(ms);
}


// Small grid
//
Expand Down
28 changes: 28 additions & 0 deletions less/mixins/grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@
right: percentage((@columns / @grid-columns));
}

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

@media (min-width: @screen-ms-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
.make-ms-column-offset(@columns) {
@media (min-width: @screen-ms-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-ms-column-push(@columns) {
@media (min-width: @screen-ms-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-ms-column-pull(@columns) {
@media (min-width: @screen-ms-min) {
right: percentage((@columns / @grid-columns));
}
}

// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
Expand Down
Loading

3 comments on commit fe2580a

@KevinDuganJr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just discussing with another developer the need for this and was glad to see others have requested it as well.

@rtaustin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I'm glad you've done this. I'm a little worried about editing the bootstrap.css directly. Do you have the styles in a separate sheet that we could use instead?

@sergio91pt
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rtaustin Sorry, I don't have it in a seperate css file, because the xs breakpoint must be changed to add this, and as such editing the .less files and rebuilding is the simplest and more maintainable way.

If you want to port this to a newer version, you can ignore the dist folder (css files) as those are built and not edited by hand and if you're using a customized bootstrap, you can do the same thing by editing less/bootstrap.less and re-building bootstrap.css.

Please sign in to comment.