Skip to content

Commit ce6e7f7

Browse files
author
Juan Martín García
authored
Show copy/copied state in tooltip on hover (#125)
1 parent b215643 commit ce6e7f7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

styles/components/blocks/code.scss

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,18 @@
127127
height: 2rem;
128128
width: 2rem;
129129
margin-bottom: 0;
130+
display: flex;
131+
align-items: center;
130132

131-
// Hide "copy" string that causes x-overflow.
132-
font-size: 0;
133+
span {
134+
position: absolute;
135+
right: calc(100% + .25rem);
136+
color: #ffffff;
137+
font-family: monospace;
138+
font-size: .8rem;
139+
font-weight: 400;
140+
opacity: 0;
141+
}
133142

134143
&:before {
135144
content:url('/clipboard.svg');
@@ -159,6 +168,10 @@
159168
&:before {
160169
opacity:.5;
161170
}
171+
172+
span {
173+
opacity: 1;
174+
}
162175
}
163176

164177
&:active {

0 commit comments

Comments
 (0)