feat: reduce top margin to viewport of sticky sidebar (#388)

pull/490/head
n0099 2022-03-27 00:19:52 +08:00 committed by GitHub
parent 30204e0394
commit 1dffb0e459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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');