Skip to content

Commit

Permalink
Merge pull request #15 from hismethod/hotfix/linenumber-style
Browse files Browse the repository at this point in the history
Correct lineNumberStyle application logic in code.tsx
  • Loading branch information
pomber authored Apr 23, 2023
2 parents 3e608de + e42c026 commit 2b22b09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/perfect-geese-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bright": patch
---

Fix line numbers style
7 changes: 3 additions & 4 deletions lib/src/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,17 @@ function Style({
mode: "dark" | "light" | undefined
lineNumbers?: boolean
}) {
const lineNumbersStyle = lineNumbers
? ""
: `[data-bright-theme] [data-bright-ln] {
const lineNumbersStyle = `[data-bright-theme] [data-bright-ln] {
color: var(--line-number-color);
margin-right: 1.5ch;
display: inline-block;
text-align: right;
user-select: none;
}`

const css = `${displayStyle(mode)}
[data-bright-theme] ::selection { background-color: var(--selection-background) }
${lineNumbersStyle}
${lineNumbers ? lineNumbersStyle : ""}
`
return <style dangerouslySetInnerHTML={{ __html: css }} />
}
Expand Down

1 comment on commit 2b22b09

@vercel
Copy link

@vercel vercel bot commented on 2b22b09 Apr 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

bright – ./

bright-git-main-codehike.vercel.app
bright.codehike.org
bright-codehike.vercel.app

Please sign in to comment.