aboutsummaryrefslogtreecommitdiff
path: root/docs/layout/overview.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-05-26 22:28:09 -0700
committerMark Otto <[email protected]>2017-05-26 22:28:09 -0700
commit6c3f833076a9fa68601741e3e21bd07ad79b7d8a (patch)
treefe016946d77f9ffff15bbe9cdc593fd098b5bcc7 /docs/layout/overview.md
parentc581564a780974c6430ac5897740006f623f2277 (diff)
parent5d7db507396275fcda96935aff47b09e1d79ddc1 (diff)
downloadbootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.tar.xz
bootstrap-6c3f833076a9fa68601741e3e21bd07ad79b7d8a.zip
Merge branch 'v4-docs-streamlined' of https://github.com/twbs/bootstrap into v4-docs-streamlined
Diffstat (limited to 'docs/layout/overview.md')
-rw-r--r--docs/layout/overview.md49
1 files changed, 37 insertions, 12 deletions
diff --git a/docs/layout/overview.md b/docs/layout/overview.md
index 3e6c7e7e0..ee21b70f2 100644
--- a/docs/layout/overview.md
+++ b/docs/layout/overview.md
@@ -6,11 +6,16 @@ group: layout
redirect_from: "/layout/"
---
-Bootstrap includes several components and options for laying out your project, including wrapping containers, a powerful grid system, a flexible media object, and responsive utility classes.
+Bootstrap includes several components and options for laying out your project, including wrapping containers, a powerful flexbox grid system, a flexible media object, and responsive utility classes.
+
+## Contents
+
+* Will be replaced with the ToC, excluding the "Contents" header
+{:toc}
## Containers
-Containers are the most basic layout element in Bootstrap and are **required when using our grid system**. Choose from a responsive, fixed-width container (meaning its `max-width` changes at each breakpoint) or fluid-width (meaning it's `100%` wide all the time).
+Containers are the most basic layout element in Bootstrap and are **required when using our default grid system**. Choose from a responsive, fixed-width container (meaning its `max-width` changes at each breakpoint) or fluid-width (meaning it's `100%` wide all the time).
While containers *can* be nested, most layouts do not require a nested container.
@@ -47,16 +52,16 @@ Use `.container-fluid` for a full width container, spanning the entire width of
## Responsive breakpoints
-Since Bootstrap is developed to be mobile first, we use a handful of [media queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.
+Since Bootstrap is developed to be mobile first, we use a handful of [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) to create sensible breakpoints for our layouts and interfaces. These breakpoints are mostly based on minimum viewport widths and allow us to scale up elements as the viewport changes.
Bootstrap primarily uses the following media query ranges—or breakpoints—in our source Sass files for our layout, grid system, and components.
{% highlight scss %}
-// Extra small devices (portrait phones, less than 544px)
+// Extra small devices (portrait phones, less than 576px)
// No media query since this is the default in Bootstrap
-// Small devices (landscape phones, 544px and up)
-@media (min-width: 544px) { ... }
+// Small devices (landscape phones, 576px and up)
+@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
@@ -88,8 +93,8 @@ Since we write our source CSS in Sass, all our media queries are available via S
We occasionally use media queries that go in the other direction (the given screen size *or smaller*):
{% highlight scss %}
-// Extra small devices (portrait phones, less than 544px)
-@media (max-width: 543px) { ... }
+// Extra small devices (portrait phones, less than 576px)
+@media (max-width: 575px) { ... }
// Small devices (landscape phones, less than 768px)
@media (max-width: 767px) { ... }
@@ -116,11 +121,11 @@ Once again, these media queries are also available via Sass mixins:
We also have media between the breakpoint's minimum and maximum widths for only the given screen size:
{% highlight scss %}
-// Extra small devices (portrait phones, less than 544px)
-@media (max-width: 543px) { ... }
+// Extra small devices (portrait phones, less than 576px)
+@media (max-width: 575px) { ... }
-// Small devices (landscape phones, 544px and up)
-@media (min-width: 544px) and (max-width: 767px) { ... }
+// Small devices (landscape phones, 576px and up)
+@media (min-width: 576px) and (max-width: 767px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991px) { ... }
@@ -155,3 +160,23 @@ The Sass mixin for the above example look like that shown beneath:
{% highlight scss %}
@include media-breakpoint-between(md, lg) { ... }
{% endhighlight %}
+
+## Z-index
+
+Several Bootstrap components utilize `z-index`, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale in Bootstrap that's been designed to properly layer navigation, tooltips and popovers, modals, and more.
+
+We don't encourage customization of these values; should you change one, you likely need to change them all.
+
+```scss
+$zindex-dropdown-backdrop: 990 !default;
+$zindex-navbar: 1000 !default;
+$zindex-dropdown: 1000 !default;
+$zindex-navbar-fixed: 1030 !default;
+$zindex-navbar-sticky: 1030 !default;
+$zindex-modal-backdrop: 1040 !default;
+$zindex-modal: 1050 !default;
+$zindex-popover: 1060 !default;
+$zindex-tooltip: 1070 !default;
+```
+
+Background elements—like the backdrops that allow click-dismissing—tend to reside on a lower `z-index`s, while navigation and popovers utilize higher `z-index`s to ensure they overlay surrounding content.