Skip to content

Commit

Permalink
improve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zzq0826 committed Jul 3, 2024
1 parent 63e0bcb commit f3ea4bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/has-focused-lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("astro:page-load", () => {
const preElements = document.querySelectorAll(".expressive-code")
preElements.forEach((pre) => {
const hasTargetClass = pre.querySelector(".highlight")
const hasTargetClass = pre.querySelector(".mark")
if (hasTargetClass) {
pre.classList.add("has-focused-lines")
}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/prism-darcula.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,7 @@ code.language-css .token.selector > .token.pseudo-element {
div.expressive-code pre::-webkit-scrollbar {
height: 0;
}

.expressive-code .ec-line div.code {
border-inline-start: unset;
}

0 comments on commit f3ea4bc

Please sign in to comment.