Created
March 19, 2019 13:46
-
-
Save desero/1eedebbc4339193e57656acc9fd72945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Sticky from 'sticky-js' | |
| const sticky = new Sticky('.sticky') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="toc" data-sticky-container> | |
| <aside class="toc-content sticky"> | |
| {{ if .Params.toc }} | |
| <p class="b">What's on this Page</p> | |
| {# thanks to https://stackoverflow.com/a/50919835 #} | |
| {{ .TableOfContents | replaceRE "<ul>[[:space:]]*<li>[[:space:]]*<ul>" "<ul>" | replaceRE "</ul>[[:space:]]*</li>[[:space:]]*</ul>" "</ul>" | safeHTML }} | |
| {{ end }} | |
| {# ... #} | |
| </aside> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cyan: #0092FF; | |
| .toc-content { | |
| width: 100%; | |
| padding-top: 20px; | |
| .b { | |
| font-weight: 700; | |
| } | |
| a { | |
| font-size: 14px; | |
| line-height: 20px; | |
| text-decoration: none; | |
| &:hover { | |
| text-decoration: underline; | |
| .particle { | |
| text-decoration: none; | |
| } | |
| } | |
| } | |
| nav { | |
| border-left: 3px solid lighten($cyan, 55%); | |
| margin-top: 20px; | |
| padding-left: 20px; | |
| } | |
| ul { | |
| list-style: none; | |
| margin-bottom: 20px; | |
| li { | |
| margin-bottom: 10px; | |
| line-height: 20px; | |
| } | |
| ul { | |
| margin-left: 10px; | |
| margin-top: 10px; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment