aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2018-09-18 19:54:56 -0700
committerMark Otto <[email protected]>2018-10-06 17:55:55 -0700
commit29bd5e32186b2d56b7b35a09597bfed6636d66c9 (patch)
tree02dfd7e566b0c5e1fc33b691d35885822c4ac73b
parent23015571b9644c38b6991390b787b0a252c7f864 (diff)
downloadbootstrap-29bd5e32186b2d56b7b35a09597bfed6636d66c9.tar.xz
bootstrap-29bd5e32186b2d56b7b35a09597bfed6636d66c9.zip
Add overflow-auto and overflow-hidden utilities
-rw-r--r--scss/_utilities.scss1
-rw-r--r--scss/_variables.scss6
-rw-r--r--scss/utilities/_overflow.scss5
-rw-r--r--scss/utilities/_position.scss5
-rw-r--r--site/_data/nav.yml1
-rw-r--r--site/docs/4.1/utilities/overflow.md25
6 files changed, 38 insertions, 5 deletions
diff --git a/scss/_utilities.scss b/scss/_utilities.scss
index 6c7a7cdd3..913fb852d 100644
--- a/scss/_utilities.scss
+++ b/scss/_utilities.scss
@@ -6,6 +6,7 @@
@import "utilities/embed";
@import "utilities/flex";
@import "utilities/float";
+@import "utilities/overflow";
@import "utilities/position";
@import "utilities/screenreaders";
@import "utilities/shadows";
diff --git a/scss/_variables.scss b/scss/_variables.scss
index 9ac52e3d3..79169319b 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -1001,6 +1001,12 @@ $pre-color: $gray-900 !default;
$pre-scrollable-max-height: 340px !default;
+// Utilities
+
+$overflows: auto, hidden !default;
+$positions: static, relative, absolute, fixed, sticky !default;
+
+
// Printing
$print-page-size: a3 !default;
diff --git a/scss/utilities/_overflow.scss b/scss/utilities/_overflow.scss
new file mode 100644
index 000000000..8326c3064
--- /dev/null
+++ b/scss/utilities/_overflow.scss
@@ -0,0 +1,5 @@
+// stylelint-disable declaration-no-important
+
+@each $value in $overflows {
+ .overflow-#{$value} { overflow: $value !important; }
+}
diff --git a/scss/utilities/_position.scss b/scss/utilities/_position.scss
index 9ecdeeb9b..cdf6c115f 100644
--- a/scss/utilities/_position.scss
+++ b/scss/utilities/_position.scss
@@ -1,11 +1,6 @@
// stylelint-disable declaration-no-important
// Common values
-
-// Sass list not in variables since it's not intended for customization.
-// stylelint-disable-next-line scss/dollar-variable-default
-$positions: static, relative, absolute, fixed, sticky;
-
@each $position in $positions {
.position-#{$position} { position: $position !important; }
}
diff --git a/site/_data/nav.yml b/site/_data/nav.yml
index 99cb90f84..7aa92bd28 100644
--- a/site/_data/nav.yml
+++ b/site/_data/nav.yml
@@ -62,6 +62,7 @@
- title: Flex
- title: Float
- title: Image replacement
+ - title: Overflow
- title: Position
- title: Screenreaders
- title: Shadows
diff --git a/site/docs/4.1/utilities/overflow.md b/site/docs/4.1/utilities/overflow.md
new file mode 100644
index 000000000..33f6d757f
--- /dev/null
+++ b/site/docs/4.1/utilities/overflow.md
@@ -0,0 +1,25 @@
+---
+layout: docs
+title: Overflow
+description: Use these shorthand utilities for quickly configuring how content overflows an element.
+group: utilities
+toc: true
+---
+
+Barebones `overflow` functionality is provided for two values by default, and they are not responsive.
+
+<div class="bd-example d-md-flex">
+ <div class="overflow-auto p-3 mb-3 mb-md-0 mr-md-3 bg-light" style="max-width: 260px; max-height: 100px;">
+ This is an example of using <code>.overflow-auto</code> on an element with set width and height dimensions. By design, this content will vertically scroll.
+ </div>
+ <div class="overflow-hidden p-3 bg-light" style="max-width: 260px; max-height: 100px;">
+ This is an example of using <code>.overflow-hidden</code> on an element with set width and height dimensions.
+ </div>
+</div>
+
+{% highlight html %}
+<div class="overflow-auto">...</div>
+<div class="overflow-hidden">...</div>
+{% endhighlight %}
+
+Using Sass variables, you may customize the overflow utilities by changing the `$overflows` variable in `_variables.scss`.