mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 06:55:26 +02:00
update offsets
This commit is contained in:
parent
8bc5ae06ed
commit
65020cee65
2 changed files with 6 additions and 4 deletions
|
@ -122,10 +122,12 @@ export default class TableOfContent {
|
|||
const contentTopOffset = this.getScrollPadding();
|
||||
|
||||
/**
|
||||
* Treat section as active if it reaches the 1/5 of viewport from top
|
||||
* For example, for a window with 1006px height it will be 219px
|
||||
* Additional offset for correct calculation of active section
|
||||
*
|
||||
* Cause opening page with anchor could scroll almost
|
||||
* near to the target section and we need to add 1px to calculations
|
||||
*/
|
||||
const activationOffset = window.innerHeight / 5;
|
||||
const activationOffset = 1;
|
||||
|
||||
const detectSection = () => {
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
html {
|
||||
scroll-padding-top: calc(var(--layout-height-header) + 5vh);
|
||||
scroll-padding-top: calc(var(--layout-height-header) + 10vh);
|
||||
}
|
||||
|
||||
.docs-header {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue