Skip to content

Commit

Permalink
refactor: Use CSS module name for line highlight instead of global name
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 8, 2020
1 parent 8b47d85 commit 2fb389d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/CodeHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CodeHighlight = ({
line,
key: idx,
className: cx({
'line-highlight': highlightedLines.has(idx + 1),
[styles.highlightLine]: highlightedLines.has(idx + 1),
}),
})}
>
Expand Down
16 changes: 8 additions & 8 deletions src/components/CodeHighlight.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
white-space: pre-wrap;
}

.highlightLine {
background: var(--color-nord-2);

:global(.light-mode) & {
background: var(--color-nord-5);
}
}

:global {
.namespace {
opacity: 0.7;
Expand Down Expand Up @@ -111,12 +119,4 @@
cursor: help;
}
}

.line-highlight {
background: var(--color-nord-2);

:global(.light-mode) & {
background: var(--color-nord-5);
}
}
}

0 comments on commit 2fb389d

Please sign in to comment.