Skip to content

Commit 879fc7c

Browse files
committed
fix: round three, improved highlighting effect over code blocks and removed more instances of purple mouse fever
1 parent d1d2fa4 commit 879fc7c

File tree

1 file changed

+38
-17
lines changed

1 file changed

+38
-17
lines changed

docs/.vitepress/theme/style.css

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -720,19 +720,46 @@ code:hover {
720720
}
721721
}
722722

723-
/* Hover effect for light mode */
724-
:not(pre) > code:hover {
725-
background-color: rgba(45, 50, 60, 0.98) !important;
726-
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25),
727-
0 0 3px rgba(255, 255, 255, 0.1) !important;
728-
transform: translateY(-1px);
729-
transition: all 0.2s ease !important;
723+
/* Explicitly prevent hover color change for ALL code blocks with higher specificity */
724+
.vp-doc [class*='language-'] code:hover,
725+
div[class*='language-'] code:hover,
726+
pre[class*='language-'] code:hover {
727+
background-color: transparent !important;
728+
color: var(--vp-code-color) !important;
729+
-webkit-text-fill-color: var(--vp-code-color) !important;
730+
transform: none !important;
731+
box-shadow: none !important;
732+
border-color: transparent !important;
733+
}
734+
735+
/* Additional specific prevention with maximum specificity for shell/bash/ssh code blocks */
736+
.vp-doc .language-bash code:hover,
737+
.vp-doc .language-ssh code:hover,
738+
.vp-doc .language-sh code:hover,
739+
div.language-bash code:hover,
740+
div.language-ssh code:hover,
741+
div.language-sh code:hover,
742+
pre.language-bash code:hover,
743+
pre.language-ssh code:hover,
744+
pre.language-sh code:hover,
745+
.language-sh code:hover,
746+
.language-sh .line:hover,
747+
.language-sh span:hover {
748+
background-color: transparent !important;
749+
color: inherit !important;
750+
-webkit-text-fill-color: inherit !important;
751+
transform: none !important;
752+
box-shadow: none !important;
753+
border-color: transparent !important;
730754
}
731755

732-
p code:hover, li code:hover {
733-
background-color: var(--vp-c-brand-1) !important;
734-
color: white !important;
735-
-webkit-text-fill-color: white !important;
756+
/* Override any other hover effects for code blocks */
757+
.vp-doc pre *:hover,
758+
.shiki *:hover,
759+
.vp-code *:hover {
760+
background-color: inherit !important;
761+
color: inherit !important;
762+
-webkit-text-fill-color: inherit !important;
736763
}
737764

738765
@media (prefers-color-scheme: dark) {
@@ -750,10 +777,4 @@ p code:hover, li code:hover {
750777
border-radius: 8px;
751778
overflow-x: auto;
752779
}
753-
}
754-
755-
.language-bash code:hover {
756-
background-color: initial !important;
757-
color: initial !important;
758-
-webkit-text-fill-color: initial !important;
759780
}

0 commit comments

Comments
 (0)