Skip to content

Commit a3ff931

Browse files
committed
Reworked the appearance of the copy button
Changed the copy button to default to be transparent. When the MultiCodeBlock is hovered, the copy button will be visible. More hover effects added to the button itself and a simple border.
1 parent 16a8f0e commit a3ff931

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

resources/ext.multicodeblock/css/codeblock.css

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,15 @@
143143
}
144144

145145
.copy {
146+
opacity: 0;
146147
position: absolute;
147148
right: 1px;
148149
padding: .7em;
149150
display: unset;
150151
cursor: pointer;
151152
z-index: 99;
152153
line-height: 0;
154+
user-select: none;
153155
}
154156

155157
.copy.anim {
@@ -176,8 +178,20 @@
176178
}
177179

178180
.copy svg {
179-
width: 100%;
180-
height: 100%;
181+
background-color: #fafbfc;
182+
border: 1px solid;
183+
border-radius: 6px;
184+
border-color: rgba(27, 31, 35, .15);
185+
cursor: pointer;
186+
display: inline-block;
187+
padding: 5px;
188+
position: relative;
189+
vertical-align: middle;
190+
white-space: nowrap;
191+
}
192+
193+
.copy:hover svg {
194+
background-color: #f3f3f3;
181195
}
182196

183197
.copy .tooltip::after {
@@ -191,6 +205,12 @@
191205
border-color: transparent transparent #555 transparent;
192206
}
193207

208+
.multicodeblock:hover > .copy {
209+
opacity: 1;
210+
211+
transition: all .2s cubic-bezier(.3,0,.5,1);
212+
}
213+
194214
.table-header {
195215
transform: translateY(-5px);
196216
}
@@ -226,4 +246,10 @@
226246
opacity: 1;
227247
transform: scale(1);
228248
}
249+
}
250+
251+
@media screen and (max-width: 767px) {
252+
.copy {
253+
opacity: 1;
254+
}
229255
}

0 commit comments

Comments
 (0)