Skip to content

Commit

Permalink
Move margin left for line number if the row is meant to be highlighted
Browse files Browse the repository at this point in the history
  • Loading branch information
croossin committed Dec 29, 2023
1 parent 9ca2611 commit d67b2af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ function CodeBlock({
)}
<div className="px-4">
{showLineNumbers && (
<span className="mr-4 select-none">{i + 1}</span>
<span
className={clsx(
"select-none",
shouldHighlight ? "-ml-1 mr-5" : "mr-4"
)}
>
{i + 1}
</span>
)}
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token })} />
Expand Down

0 comments on commit d67b2af

Please sign in to comment.