Skip to content

Commit

Permalink
Reset user-agent styles for selected element
Browse files Browse the repository at this point in the history
Fixes #43.
  • Loading branch information
shvaikalesh committed Aug 13, 2016
1 parent f225b89 commit 30590d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ function copy(text, options) {
range = document.createRange();
selection = document.getSelection();

mark = document.createElement('mark');
mark = document.createElement('span');
mark.textContent = text;
mark.setAttribute('style', [
// reset user styles for span element
'all: unset',
// prevents scrolling to the end of the page
'position: fixed',
'top: 0',
Expand Down

0 comments on commit 30590d4

Please sign in to comment.