Files
docker-docs/layouts/_default/_markup/render-codeblock.html
David Karlsson 834db3da41 css: refactor and improve styles
- Refactoring styles to prevent unwanted specificity issues by using
  tailwind directives
- Improve color consistency for code blocks and other components by
  replacing adhoc hex values with theme colors

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
2024-01-03 14:54:57 +01:00

17 lines
600 B
HTML

<div class="group relative">
<button
x-data="{ code: '{{encoding.Base64Encode .Inner}}' }"
class="material-symbols-rounded hidden group-hover:block absolute top-3 right-3 text-gray-light-300 dark:text-gray-dark-600"
title="Copy"
@click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^\$\s*/gm, ''));
$el.textContent='check_circle';
setTimeout(() => $el.textContent='content_copy', 2000);"
>
content_copy
</button>
{{ $result := transform.HighlightCodeBlock . }}
<div class="syntax-light dark:syntax-dark">
{{ $result.Wrapped }}
</div>
</div>