diff --git a/assets/sass/content.scss b/assets/sass/content.scss index 1a03fc8..8a93c03 100644 --- a/assets/sass/content.scss +++ b/assets/sass/content.scss @@ -48,6 +48,54 @@ pre { padding: 1rem; border-radius: 5px; overflow-x: auto; + position: relative; +} + +.code-block-wrapper { + position: relative; + margin-bottom: 1.5rem; +} + +.copy-code-button { + position: absolute; + top: 8px; + right: 6px; + + width: 20px ; + height: 20px; + + padding: 0; + margin: 0; + + background: transparent; + border: none; + + display: flex; + align-items: center; + justify-content: center; + + cursor: pointer; + color: currentColor; + + z-index: 20; +} + +.copy-code-button svg { + width: 14px ; + height: 14px ; + display: block; +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; } details { @@ -58,5 +106,5 @@ details { } details[open] { - border-color: 1px solid var(--text-color); + border-color: var(--text-color); } diff --git a/assets/sass/global.scss b/assets/sass/global.scss index c0dfe14..96c5097 100644 --- a/assets/sass/global.scss +++ b/assets/sass/global.scss @@ -30,6 +30,7 @@ pre, code { font-family: Monaco, "Ubuntu Mono", Inconsolata, Consolas, monospace; } + pre { line-height: 1.4em; } @@ -57,4 +58,4 @@ em { &:focus { transform: translateY(0%); } -} +} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 429e9a6..36b1a1f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -24,6 +24,7 @@ +
@@ -45,6 +46,9 @@