Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class Highlighter {
constructor(root) {
constructor(root,highlightColor) {
this._root = root;
this._resolve = null;
this._highlightColor=highlightColor;
}

_initializeOverlay() {
Expand All @@ -24,7 +25,7 @@ class Highlighter {
const style = node.style;
style.textDecoration = 'none';
style.color = 'var(--lumin-color, currentColor)';
style.background = 'var(--lumin-background-color, yellow)';
style.background = `var(--lumin-background-color, ${this._highlightColor})`;
return node;
}

Expand Down Expand Up @@ -182,4 +183,4 @@ class Highlighter {

export default function lumin(node) {
return new Highlighter(node);
}
}