fix for scroll padding

This commit is contained in:
Elisabeth Dickinson 2021-02-26 17:19:44 +01:00
parent 780301ed2d
commit ff34556923
2 changed files with 16 additions and 14 deletions

View File

@ -96,6 +96,18 @@
margin: $margin; margin: $margin;
} }
//-- fix scroll issue
@mixin scroll-padding() {
content: '';
display: block;
width: 0;
height: 0;
padding-top: $o-header-height + 10px;
margin-top: -$o-header-height - 10px;
}
//-- has_col //-- has_col
@mixin pseudo-col(){ @mixin pseudo-col(){

View File

@ -463,27 +463,17 @@ header.o_main_header{
dt { dt {
&:before { &:before {
content: ''; @include scroll-padding()
display: block;
width: 0;
height: 0;
padding-top: $o-header-height + 10px;
margin-top: -$o-header-height - 10px;
} }
} }
section { section {
// This fixes the scroll position // BUT creates issues when buttons or links from the previous section are behind it // This fixes the scroll position // BUT creates issues when buttons or links from the previous section are behind it
/* padding-top: $o-header-height; // padding-top: $o-header-height;
margin-top: -$o-header-height; */ // margin-top: -$o-header-height; */
// adding a :before works better; // adding a :before works better;
&:before { &:before {
content: ''; @include scroll-padding()
display: block;
width: 0;
height: 0;
padding-top: $o-header-height + 10px;
margin-top: -$o-header-height - 10px;
} }
> h1 { > h1 {