mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 16:14:04 +02:00
Update offcanvas example for IE support
- Replaces CSS variables with their appropriate hex values - Fixes the broken navbar transition by moving from 2D translates to using position - Fix broken IE navbar toggler placement with some utilities (not necessary anywhere else, but necessary given flexbox quirks)
This commit is contained in:
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
<body class="bg-light">
|
<body class="bg-light">
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-md fixed-top navbar-dark bg-dark">
|
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
|
||||||
<a class="navbar-brand" href="#">Offcanvas navbar</a>
|
<a class="navbar-brand mr-auto mr-lg-0" href="#">Offcanvas navbar</a>
|
||||||
<button class="navbar-toggler p-0 border-0" type="button" data-toggle="offcanvas">
|
<button class="navbar-toggler p-0 border-0" type="button" data-toggle="offcanvas">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@@ -7,27 +7,25 @@ body {
|
|||||||
padding-top: 56px;
|
padding-top: 56px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767.98px) {
|
@media (max-width: 991.98px) {
|
||||||
.offcanvas-collapse {
|
.offcanvas-collapse {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 56px; /* Height of navbar */
|
top: 56px; /* Height of navbar */
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
left: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 1rem;
|
padding-right: 1rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
background-color: var(--gray-dark);
|
background-color: #343a40;
|
||||||
transition: visibility .3s ease-in-out, -webkit-transform .3s ease-in-out;
|
transition-timing-function: ease-in-out;
|
||||||
transition: visibility .3s ease-in-out, transform .3s ease-in-out;
|
transition-duration: .3s;
|
||||||
transition: visibility .3s ease-in-out, transform .3s ease-in-out, -webkit-transform .3s ease-in-out;
|
transition-property: left, visibility;
|
||||||
-webkit-transform: translateX(100%);
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
}
|
||||||
.offcanvas-collapse.open {
|
.offcanvas-collapse.open {
|
||||||
|
left: 0;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
-webkit-transform: translateX(-1rem);
|
|
||||||
transform: translateX(-1rem); /* Account for horizontal padding on navbar */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,21 +54,21 @@ body {
|
|||||||
padding-top: .75rem;
|
padding-top: .75rem;
|
||||||
padding-bottom: .75rem;
|
padding-bottom: .75rem;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
color: var(--secondary);
|
color: #6c757d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-underline .nav-link:hover {
|
.nav-underline .nav-link:hover {
|
||||||
color: var(--blue);
|
color: #007bff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-underline .active {
|
.nav-underline .active {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--gray-dark);
|
color: #343a40;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-white-50 { color: rgba(255, 255, 255, .5); }
|
.text-white-50 { color: rgba(255, 255, 255, .5); }
|
||||||
|
|
||||||
.bg-purple { background-color: var(--purple); }
|
.bg-purple { background-color: #6f42c1; }
|
||||||
|
|
||||||
.border-bottom { border-bottom: 1px solid #e5e5e5; }
|
.border-bottom { border-bottom: 1px solid #e5e5e5; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user