Skip to content

Instantly share code, notes, and snippets.

@jameswilson
Last active August 17, 2020 14:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jameswilson/a797467fac5faf06825985ccc2846990 to your computer and use it in GitHub Desktop.
Integrate Drupal 8 Toolbar w/ Bootstrap Fixed Top Nav
libraries-extend:
# Improve interoperability between MyTheme and the Drupal admin toolbar.
toolbar/toolbar:
- mytheme/toolbar
toolbar:
css:
theme:
css/toolbar.css: {}
@media only screen and (max-width: 976px) {
.toolbar-fixed .navbar.fixed-top {
top: 39px !important;
}
.toolbar-fixed.toolbar-horizontal.toolbar-tray-open:not(.toolbar-loading) .navbar.fixed-top {
top: 79px !important;
}
}
@media only screen and (min-width: 977px) and (max-width: 1024px) {
.toolbar-fixed .navbar.fixed-top {
top: 39px !important;
}
.toolbar-fixed.toolbar-horizontal.toolbar-tray-open .navbar.fixed-top {
top: 79px !important;
}
}
/* Ensure navbar scrolls when toolbar is also configured to scroll on smaller screens or when loading. */
@media only screen and (max-width: 1024px) {
.toolbar-loading .navbar.fixed-top,
.toolbar-vertical:not(.toolbar-fixed) .navbar.fixed-top {
position: absolute;
top: 39px;
}
}
@media only screen and (min-width: 1025px) {
.toolbar-fixed:not(.toolbar-loading) .navbar.fixed-top {
top: 39px !important;
}
.toolbar-fixed.toolbar-horizontal.toolbar-tray-open:not(.toolbar-loading) .navbar.fixed-top {
top: 79px !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment