mirror of
https://github.com/olivierlacan/keep-a-changelog.git
synced 2025-07-31 01:34:18 +02:00
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:
parent
a506eb2f12
commit
610f52d68c
@ -117,7 +117,7 @@ set :markdown_engine, :redcarpet
|
|||||||
## Override default Redcarpet renderer in order to define a class
|
## Override default Redcarpet renderer in order to define a class
|
||||||
class CustomMarkdownRenderer < Redcarpet::Render::HTML
|
class CustomMarkdownRenderer < Redcarpet::Render::HTML
|
||||||
def doc_header
|
def doc_header
|
||||||
%Q[<nav role="navigation">#{@header}</nav>]
|
%Q[<nav role="navigation" class="toc">#{@header}</nav>]
|
||||||
end
|
end
|
||||||
|
|
||||||
def preprocess(full_document)
|
def preprocess(full_document)
|
||||||
|
@ -13,6 +13,32 @@ a
|
|||||||
a:hover
|
a:hover
|
||||||
text-decoration: underline
|
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
|
h1
|
||||||
color: #C647BF
|
color: #C647BF
|
||||||
font-size: 4.1em
|
font-size: 4.1em
|
||||||
|
Loading…
x
Reference in New Issue
Block a user