diff options
| author | Patrick Yeo <[email protected]> | 2017-06-08 17:58:31 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-08-22 10:47:52 -0700 |
| commit | f66fa3fa2bf5973bf7a00205044a006009dba982 (patch) | |
| tree | aba72c5888f45130960c328d9f4a2f7283c1f96b | |
| parent | f7eb3c98b261930270c2f65c0e565c454d6cb647 (diff) | |
| download | bootstrap-f66fa3fa2bf5973bf7a00205044a006009dba982.tar.xz bootstrap-f66fa3fa2bf5973bf7a00205044a006009dba982.zip | |
Generate series of `.table-responsive-*` classes to accomodate overflowing tables in a variety of screen sizes
| -rw-r--r-- | scss/_tables.scss | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/scss/_tables.scss b/scss/_tables.scss index 0ef107a7b..7804db620 100644 --- a/scss/_tables.scss +++ b/scss/_tables.scss @@ -153,20 +153,26 @@ // Responsive tables // -// Add `.table-responsive` to `.table`s and we'll make them mobile friendly by -// enabling horizontal scrolling. Only applies <768px. Everything above that -// will display normally. +// Generate series of `.table-responsive-*` classes for configuring the screen +// size of where your table will overflow. .table-responsive { - @include media-breakpoint-down(md) { - display: block; - width: 100%; - overflow-x: auto; - -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 - - // Prevent double border on horizontal scroll due to use of `display: block;` - &.table-bordered { - border: 0; + @each $breakpoint in map-keys($grid-breakpoints) { + $next: breakpoint-next($breakpoint, $grid-breakpoints); + $infix: breakpoint-infix($next, $grid-breakpoints); + + &#{$infix} { + @include media-breakpoint-down($breakpoint) { + display: block; + width: 100%; + overflow-x: auto; + -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057 + + // Prevent double border on horizontal scroll due to use of `display: block;` + &.table-bordered { + border: 0; + } + } } } } |
