From cd396ada133caa39542ef78d411ffa4e9c31bfd8 Mon Sep 17 00:00:00 2001 From: Yeray Diaz Diaz Date: Sat, 20 Jan 2018 21:24:26 +0000 Subject: [PATCH] Remove addition of `clicky` class to body and animations. (#1387) --- mkdocs/themes/mkdocs/css/base.css | 27 +-------------------------- mkdocs/themes/mkdocs/js/base.js | 7 +------ 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/mkdocs/themes/mkdocs/css/base.css b/mkdocs/themes/mkdocs/css/base.css index ea9f2e90..34de0b67 100644 --- a/mkdocs/themes/mkdocs/css/base.css +++ b/mkdocs/themes/mkdocs/css/base.css @@ -39,13 +39,7 @@ ul.nav .main { /* * The code below adds some padding to the top of the current anchor target so * that, when navigating to it, the header isn't hidden by the navbar at the - * top. This is especially complicated because we want to *remove* the padding - * after navigation so that hovering over the header shows the permalink icon - * correctly. Thus, we create a CSS animation to remove the extra padding after - * a second. We have two animations so that navigating to an anchor within the - * page always restarts the animation. - * - * See for more details. + * top. */ :target::before { content: ""; @@ -53,25 +47,6 @@ ul.nav .main { margin-top: -75px; height: 75px; pointer-events: none; - animation: 0s 1s forwards collapse-anchor-padding-1; -} - -.clicky :target::before { - animation-name: collapse-anchor-padding-2; -} - -@keyframes collapse-anchor-padding-1 { - to { - margin-top: 0; - height: 0; - } -} - -@keyframes collapse-anchor-padding-2 { - to { - margin-top: 0; - height: 0; - } } h1 { diff --git a/mkdocs/themes/mkdocs/js/base.js b/mkdocs/themes/mkdocs/js/base.js index 0001d7f5..0fac4bc7 100644 --- a/mkdocs/themes/mkdocs/js/base.js +++ b/mkdocs/themes/mkdocs/js/base.js @@ -78,12 +78,7 @@ $(document).ready(function() { $('body').scrollspy({ target: '.bs-sidebar', -}); - -/* Toggle the `clicky` class on the body when clicking links to let us - retrigger CSS animations. See ../css/base.css for more details. */ -$('a').click(function(e) { - $('body').toggleClass('clicky'); + offset: 100 }); /* Prevent disabled links from causing a page reload */