Skip to content

Commit

Permalink
add linenumbers class name
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Apr 11, 2020
1 parent 62138e4 commit ab14d21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions linenumbers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
type Options = {
class: string
wrapClass: string
width: string
}

Expand All @@ -7,6 +9,8 @@ export function withLineNumbers(
options: Partial<Options> = {}
) {
const opts: Options = {
class: "codejar-linenumbers",
wrapClass: "codejar-wrap",
width: "35px",
...options
}
Expand Down Expand Up @@ -35,9 +39,11 @@ function init(editor: HTMLElement, opts: Options): HTMLElement {
const css = getComputedStyle(editor)

const wrap = document.createElement("div")
wrap.className = opts.wrapClass
wrap.style.position = "relative"

const lineNumbers = document.createElement("div")
lineNumbers.className = opts.class
wrap.appendChild(lineNumbers)

// Add own styles
Expand Down

0 comments on commit ab14d21

Please sign in to comment.