From 1dffb0e4592e116444a2a7f0d9e4911b158dd1a4 Mon Sep 17 00:00:00 2001 From: n0099 Date: Sun, 27 Mar 2022 00:19:52 +0800 Subject: [PATCH] feat: reduce top margin to viewport of sticky sidebar (#388) --- inc/theme-core.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/theme-core.php b/inc/theme-core.php index 975aece..ded7d16 100644 --- a/inc/theme-core.php +++ b/inc/theme-core.php @@ -84,8 +84,11 @@ function theme_autoload() } "); if (kratos_option('g_sticky', false)) { - $sticky_css = ".sticky-sidebar{position: sticky;top: 25px;height:100%}"; - wp_add_inline_style('kratos', $sticky_css); + wp_add_inline_style('kratos', '.sticky-sidebar { + position: sticky; + top: 8px; + height: 100%; + }'); } // js wp_deregister_script('jquery');