-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compensate anchors for fixed navbar, use vp-mixins for flex
* navbar-height calculation moved to common_variables.scss * body padding-top for fixed navbar moved to compensate_fixed_navbar.scss * content anchors won't scroll behind fixed navbar anmyore, via compensate_fixed_navbar.scss * use vendor-prefix mixins for flexbox styles
- Loading branch information
Showing
3 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Bootswatch 4 Scss | ||
* common variables used in all layouts | ||
*/ | ||
|
||
$navbar-height: ($nav-link-height + $navbar-padding-y * 2); |
29 changes: 29 additions & 0 deletions
29
themes/Bootswatch4_Scss/_common/compensate_fixed_navbar.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* Bootswatch 4 Scss | ||
* compensations for fixed navbar | ||
* required when the main navbar has the css class 'fixed-top' | ||
*/ | ||
|
||
$body-padding-top: 2rem; | ||
|
||
// additional padding-top to the body element | ||
body { | ||
padding-top: calc( #{$navbar-height} + $body-padding-top ); | ||
} | ||
|
||
// Prevent targeted anchors hiding behind fixed header navbar | ||
|
||
// default compensation | ||
.GPAREA a[name]:not([href]), | ||
.GPAREA a[id]:not([href]) { | ||
margin-top: calc( ( #{$navbar-height} + #{$body-padding-top} ) * -1 ); | ||
padding-top: calc( #{$navbar-height} + #{$body-padding-top} ); | ||
z-index: -5; | ||
} | ||
|
||
// compensation when logged-in | ||
// with support for HideAdminUI plugin https://github.com/juek/HideAdminUI | ||
html:not(.override_admin_style) body.gpAdmin .GPAREA a[name]:not([href]), | ||
html:not(.override_admin_style) body.gpAdmin .GPAREA a[id]:not([href]) { | ||
margin-top: calc( ( #{$navbar-height} + #{$body-padding-top} + 29px ) * -1 ); | ||
padding-top: calc( #{$navbar-height} + #{$body-padding-top} + 29px ); | ||
} |