Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome committed Aug 6, 2024
1 parent eba0468 commit dd67919
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/codeBlock/code-blocks.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
margin: 0 0 1rem;
}

/**
* Shift padding on code diffs, so the background highlight covers the whole line
*/
pre[class^='language-']:has(:global(.code-diff)) {
padding-right: 0;

Expand Down Expand Up @@ -73,14 +76,17 @@

/* Diff highlighting, classes provided by rehype-prism-plus */
/* Set inserted line (+) color */
/* Move the margin left and adjust width so we can keep the parent padding */
:global(.diff-inserted),
:global(.inserted) {
background-color: rgba(16, 185, 129, 0.2);
margin-left: -12px;
width: calc(100% + 12px);
}

/* Diff highlighting, classes provided by rehype-prism-plus */
/* Set deleted line (-) color */
/* Move the margin left and adjust width so we can keep the parent padding */
:global(.diff-deleted),
:global(.deleted) {
background-color: rgba(239, 68, 68, 0.2);
Expand Down

0 comments on commit dd67919

Please sign in to comment.