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

Adding overflow visible and scroll as utilities #31343

Merged
merged 2 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scss/_utilities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $utilities: map-merge(
),
"overflow": (
property: overflow,
values: auto hidden,
values: auto hidden visible scroll,
),
"display": (
responsive: true,
Expand Down
12 changes: 10 additions & 2 deletions site/content/docs/5.0/utilities/overflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,28 @@ description: Use these shorthand utilities for quickly configuring how content o
group: utilities
---

Barebones `overflow` functionality is provided for two values by default, and they are not responsive.
Adjust the `overflow` property on the fly with four default values and classes. These classes are not responsive by default.

<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;">
<div class="overflow-hidden 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-hidden</code> on an element with set width and height dimensions.
</div>
<div class="overflow-visible 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-visible</code> on an element with set width and height dimensions.
</div>
<div class="overflow-scroll p-3 bg-light" style="max-width: 260px; max-height: 100px;">
This is an example of using <code>.overflow-scroll</code> on an element with set width and height dimensions.
</div>
</div>

{{< highlight html >}}
<div class="overflow-auto">...</div>
<div class="overflow-hidden">...</div>
<div class="overflow-visible">...</div>
<div class="overflow-scroll">...</div>
{{< /highlight >}}

Using Sass variables, you may customize the overflow utilities by changing the `$overflows` variable in `_variables.scss`.