diff --git a/source/css/base.styl b/source/css/base.styl index dea9c93..2f4266a 100644 --- a/source/css/base.styl +++ b/source/css/base.styl @@ -221,29 +221,25 @@ figure.highlight background: rgba(200, 200, 200, 0.15) figcaption + margin: 0 !important padding: .3em .75em - text-align: left font-style: normal font-size: .8em - &:after - clear: both - content: " " - display: table + + * + color: $grey span font-weight: 500 font-family: $family-code - .fold - a - color: #9a9a9a + .level-left *:not(:last-child) + margin-right: .5em - a - float: right - margin-left: 0.5em + .level-right *:not(:first-child) + margin-left: .5em .fold - margin-right: 0.5em cursor: pointer .highlight-body diff --git a/source/js/main.js b/source/js/main.js index 6ba7333..8f219be 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -62,37 +62,46 @@ } }); - if (typeof ClipboardJS !== 'undefined' && config.article.highlight.clipboard) { + + const clipboard = config.article.highlight.clipboard; + const fold = config.article.highlight.fold.trim(); + + $('figure.highlight').each(function() { + if ($(this).find('figcaption').length) { + $(this).find('figcaption').addClass('level'); + $(this).find('figcaption').append('