From 5166ffbf25e6dd58afdae343cff8de73cffc5eee Mon Sep 17 00:00:00 2001 From: VadimMakishvili Date: Tue, 25 Jul 2023 19:50:11 +0300 Subject: [PATCH] up --- styles/mixins.scss | 3 +-- styles/yfm.scss | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/styles/mixins.scss b/styles/mixins.scss index c4911e6d..195bb92a 100644 --- a/styles/mixins.scss +++ b/styles/mixins.scss @@ -11,8 +11,7 @@ list-style: none; } -@mixin fixAnchorPosition($offset: 0px) { - // Works with scroll-padding-top (see /styles/default.css) +@mixin setHeadingPadding($offset: 0px) { padding-top: calc(var(--dc-header-height, #{$headerHeight}) - #{$offset}); } diff --git a/styles/yfm.scss b/styles/yfm.scss index a69fa05b..dc3ebf52 100644 --- a/styles/yfm.scss +++ b/styles/yfm.scss @@ -110,7 +110,7 @@ // The margin is summed up. So, we need to take 15px away from the header margin-top h1, h2 { - @include fixAnchorPosition(calc(#{$headerMarginTopLarge} - #{$blockMarginBottomMedium})); + @include setHeadingPadding(calc(#{$headerMarginTopLarge} - #{$blockMarginBottomMedium})); margin-bottom: $blockMarginBottomLarge; } @@ -118,7 +118,7 @@ h4, h5, h6 { - @include fixAnchorPosition(calc(#{$headerMarginTopMedium} - #{$blockMarginBottomMedium})); + @include setHeadingPadding(calc(#{$headerMarginTopMedium} - #{$blockMarginBottomMedium})); } // Use 0px for the top offset of the header if it is the first child element, @@ -130,7 +130,7 @@ h5, h6 { &:first-child { - @include fixAnchorPosition(); + @include setHeadingPadding(); } } @@ -169,7 +169,7 @@ & + h4, & + h5, & + h6 { - @include fixAnchorPosition(#{$headerMarginTopLarge}); + @include setHeadingPadding(#{$headerMarginTopLarge}); } }