Skip to content

Commit 2c4525f

Browse files
committed
CodeCopy: Use oklch colors, change font
Tweak active state to pure css
1 parent dc006f1 commit 2c4525f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

assets/css/v2/style.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,26 +1147,25 @@ li .code-block {
11471147
.code-copy-button {
11481148
background-color: white;
11491149
border: 1px solid black;
1150-
padding: 5px 10px;
1150+
padding: 4px 6px;
11511151
cursor: pointer;
1152-
font-family: "JetBrains Mono", monospace;
11531152
font-size: 12px;
11541153
color: #000;
1155-
/* display: none; */
1154+
display: none;
11561155
position: absolute;
11571156
margin-top: 8px;
11581157
right: 1rem;
1159-
--color-codeblock-shadow: #d2d2d2;
1160-
box-shadow: 0px 2px 0px var(--color-codeblock-shadow);
1158+
--color-codeblock-shadow: 0% 0 0;
1159+
box-shadow: 0px 2px 0px oklch(var(--color-codeblock-shadow) / 0.15);
11611160
}
11621161

11631162
.code-copy-button:hover {
1164-
--color-codeblock-shadow: #0096394d;
1163+
box-shadow: 0px 2px 0px oklch(var(--color-brand) / 0.3);
11651164
}
11661165

11671166
.code-copy-button:focus {
11681167
outline: none;
1169-
--color-codeblock-shadow: #009639;
1168+
box-shadow: 0px 2px 0px oklch(var(--color-brand) / 0.8);
11701169
}
11711170

11721171
.next-prev-icon {

assets/js/code-copy-v2.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const copyToClipBoard = ((clipboard) => async (button, codeBlockId) => {
2626

2727
const updateButtonState = (button, message, revertDelay, disable = false) => {
2828
button.innerHTML = message;
29-
$(button).css('box-shadow', '0px 2px 0px #009639');
3029

3130
if (disable) {
3231
button.disabled = true;
@@ -35,7 +34,6 @@ const updateButtonState = (button, message, revertDelay, disable = false) => {
3534
if (revertDelay) {
3635
setTimeout(() => {
3736
button.innerHTML = 'Copy';
38-
$(button).css('box-shadow', '0px 2px 0px var(--color-codeblock-shadow)');
3937
button.disabled = false;
4038
}, revertDelay);
4139
}

0 commit comments

Comments
 (0)