Style table of contents

I want it to be unobtrusive and useful for people who need it but
out of the way of anyone else.
This commit is contained in:
Olivier Lacan 2017-04-17 16:22:25 +02:00
parent a506eb2f12
commit 610f52d68c
2 changed files with 27 additions and 1 deletions

View File

@ -117,7 +117,7 @@ set :markdown_engine, :redcarpet
## Override default Redcarpet renderer in order to define a class
class CustomMarkdownRenderer < Redcarpet::Render::HTML
def doc_header
%Q[<nav role="navigation">#{@header}</nav>]
%Q[<nav role="navigation" class="toc">#{@header}</nav>]
end
def preprocess(full_document)

View File

@ -13,6 +13,32 @@ a
a:hover
text-decoration: underline
.toc
position: fixed
z-index: 9999
top: 10%
left: 0
ul
padding: 0 0 0 1em
list-style-type: decimal-leading-zero
li
padding-left: 1em
line-height: 2
a
padding: 0 1em
line-height: 2
display: none
li:hover
color: $color-sand
background: $color-black
li:hover a
color: $color-sand
font-weight: bold
background-color: $color-black
display: inline-block
h1
color: #C647BF
font-size: 4.1em