mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 01:36:55 +01:00
Merge pull request #258 from bigchaindb/feature/code-title
output language above all code blocks
This commit is contained in:
commit
7b92d044d0
@ -10,7 +10,10 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
||||
const codeBlocks = document.querySelectorAll('.highlight')
|
||||
|
||||
codeBlocks.forEach(codeBlock => {
|
||||
const language = codeBlock.getElementsByTagName('code')[0].dataset.lang
|
||||
|
||||
codeBlock.insertAdjacentHTML('afterbegin', clipboardButton)
|
||||
codeBlock.insertAdjacentHTML('afterbegin', `<h6 class="highlight__title">${language}</h6>`)
|
||||
})
|
||||
|
||||
const buttons = document.querySelectorAll('.highlight .btn--clipboard')
|
||||
|
@ -77,17 +77,26 @@ pre {
|
||||
.btn--clipboard,
|
||||
.success__text {
|
||||
position: absolute;
|
||||
top: .1rem;
|
||||
top: $spacer * 1.65;
|
||||
right: .1rem;
|
||||
}
|
||||
|
||||
.success__text {
|
||||
top: 2rem;
|
||||
top: $spacer * 3.5;
|
||||
right: -1.5rem;
|
||||
font-size: $font-size-xs;
|
||||
}
|
||||
}
|
||||
|
||||
.highlight__title {
|
||||
margin-top: 0;
|
||||
margin-bottom: $spacer / 4;
|
||||
margin-left: $spacer / 1.5;
|
||||
font-size: $font-size-sm;
|
||||
color: $gray-light;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn--clipboard {
|
||||
padding: 0 $spacer / 2;
|
||||
box-shadow: none;
|
||||
|
Loading…
Reference in New Issue
Block a user