Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Popup preview fixes (#948)
Browse files Browse the repository at this point in the history
* Select just the text node and not its container

* Make background color transparent by default
  • Loading branch information
toasted-nutbread authored Oct 21, 2020
1 parent ecbac2c commit 9bda0a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions ext/bg/css/popup-preview.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
*/

html {
--text-color: #333333;
--background-color: #ffffff;
--theme-transition: background-color 0.25s linear 0s, color 0.25s linear 0s;
transition: var(--theme-transition);
background-color: var(--background-color);
color: var(--text-color);
transition: background-color 0.25s linear 0s, color 0.25s linear 0s;
background-color: rgba(255, 255, 255, 0);
color: #333333;
}
html.dark {
--text-color: #d4d4d4;
--background-color: #1e1e1e;
color: #d4d4d4;
background-color: #1e1e1e;
}
html,
body {
Expand Down Expand Up @@ -99,7 +96,9 @@ body {
top: 0;
right: 0;
bottom: 0;
background-color: var(--background-color);
}
.example-text-input:not([hidden])+.example-text {
visibility: hidden;
}

.popup-placeholder {
Expand Down
2 changes: 1 addition & 1 deletion ext/bg/js/settings/popup-preview-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class PopupPreviewFrame {
if (textNode === null) { return; }

const range = document.createRange();
range.selectNode(textNode);
range.selectNodeContents(textNode);
const source = new TextSourceRange(range, range.toString(), null, null);

try {
Expand Down

0 comments on commit 9bda0a9

Please sign in to comment.