diff --git a/src/backend/views/pages/blocks/header.twig b/src/backend/views/pages/blocks/header.twig index 476d646..e2e0403 100644 --- a/src/backend/views/pages/blocks/header.twig +++ b/src/backend/views/pages/blocks/header.twig @@ -1,4 +1,11 @@ + {% + include 'components/copy-button.twig' with { + ariaLabel: 'Copy Link to the ' ~ text, + class: 'block-header__copy-button', + textToCopy: '#' ~ text | urlify, + } + %} {{ text }} diff --git a/src/frontend/styles/components/page.pcss b/src/frontend/styles/components/page.pcss index c359a4c..c3846a1 100644 --- a/src/frontend/styles/components/page.pcss +++ b/src/frontend/styles/components/page.pcss @@ -125,6 +125,20 @@ pointer-events: none; } + &__copy-button { + margin-right: 8px; + color: var(--color-text-second); + opacity: 0; + } + + @media (--can-hover) { + &:hover { + .block-header__copy-button { + opacity: 1; + } + } + } + .inline-code { line-height: inherit; }