File tree Expand file tree Collapse file tree
backend/views/pages/blocks
frontend/styles/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<div class =" block-code" >
2- <div class =" block-code__content" >{{ code | escape }}</div >
2+ <div class =" block-code__wrapper" >
3+ <div class =" block-code__content" >{{ code | escape }}</div >
4+ </div >
5+ {%
6+ include ' components/copy-button.twig' with {
7+ ariaLabel : ' Copy Code to Clipboard' ,
8+ class : ' block-code__copy-button' ,
9+ textToCopy : code | escape ,
10+ }
11+ %}
312</div >
4-
Original file line number Diff line number Diff line change 149149 * ==================
150150 */
151151.block-code {
152- @apply --text-code-block ;
153- @apply --squircle ;
152+ position : relative;
153+
154+ &:hover {
155+ .block-code__copy-button {
156+ opacity : 1 ;
157+ }
158+ }
159+
160+ & __wrapper {
161+ @apply --text-code-block ;
162+ @apply --squircle ;
163+ }
154164
155165 & __content {
156166 display : inline-block !important ;
169179 }
170180 }
171181
182+ & __copy-button {
183+ position : absolute;
184+ top : 10 px ;
185+ right : 10 px ;
186+ opacity : 0 ;
187+ }
188+
172189 .hljs-params {
173190 color : var (--color-code-params );
174191 }
You can’t perform that action at this time.
0 commit comments