From 0f075612d979c8b3370698c143da223e9fe4cd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?iBug=20=E2=99=A6?= Date: Fri, 4 Oct 2019 22:59:44 +0800 Subject: [PATCH] LCS cherry-pick 3b3da46 Show a permalink anchor when hovering over headings in main content (#2251) * Implement heading permalinks, close #2246 Thanks to jekyll/jekyll for CSS. Link anchor is visible when the mouse hovers over the title line. * Build the updated _main.js --- _sass/_page.scss | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/_sass/_page.scss b/_sass/_page.scss index e1e2f237940c..0ea9ab2a9a9b 100644 --- a/_sass/_page.scss +++ b/_sass/_page.scss @@ -60,7 +60,26 @@ border-bottom: 1px solid $border-color; } - p, li, dl { + h1, h2, h3, h4, h5, h6 { + .header-link { + position: relative; + left: 0.5em; + opacity: 0; + font-size: 0.8em; + -webkit-transition: opacity 0.2s ease-in-out 0.1s; + -moz-transition: opacity 0.2s ease-in-out 0.1s; + -o-transition: opacity 0.2s ease-in-out 0.1s; + transition: opacity 0.2s ease-in-out 0.1s; + } + + &:hover .header-link { + opacity: 1; + } + } + + p, + li, + dl { font-size: 1em; }