Change #yomichan-float to .yomichan-float

Since there can be more than one popup, using a class makes more sense than an ID.
This commit is contained in:
toasted-nutbread 2019-10-13 11:57:40 -04:00
parent 42d67249c9
commit b34ff7ebe9
6 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" class="yomichan-search">
<html lang="en" data-yomichan-page="search">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1" />

View File

@ -24,7 +24,7 @@
font-family: "Helvetica Neue", Helvetica, Arial ,sans-serif;
font-size: 14px;
}
iframe#yomichan-float {
iframe.yomichan-float {
resize: none;
}
.vertical-align-outer {

View File

@ -17,7 +17,7 @@
*/
iframe#yomichan-float {
iframe.yomichan-float {
all: initial;
background-color: #fff;
border: 1px solid #999;
@ -29,14 +29,14 @@ iframe#yomichan-float {
box-sizing: border-box;
}
iframe#yomichan-float[data-yomichan-theme=dark],
iframe#yomichan-float[data-yomichan-theme=auto][data-yomichan-site-color=dark] {
iframe.yomichan-float[data-yomichan-theme=dark],
iframe.yomichan-float[data-yomichan-theme=auto][data-yomichan-site-color=dark] {
background-color: #1e1e1e;
border: 1px solid #666;
box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
iframe#yomichan-float.yomichan-float-full-width {
iframe.yomichan-float.yomichan-float-full-width {
border-left: none;
border-right: none;
left: 0 !important;
@ -46,13 +46,13 @@ iframe#yomichan-float.yomichan-float-full-width {
resize: none;
}
iframe#yomichan-float.yomichan-float-full-width:not(.yomichan-float-above) {
iframe.yomichan-float.yomichan-float-full-width:not(.yomichan-float-above) {
border-bottom: none;
top: auto !important;
bottom: 0 !important;
}
iframe#yomichan-float.yomichan-float-full-width.yomichan-float-above {
iframe.yomichan-float.yomichan-float-full-width.yomichan-float-above {
border-top: none;
top: 0 !important;
bottom: auto !important;

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" class="yomichan-float">
<html lang="en" data-yomichan-page="float">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1" />

View File

@ -27,7 +27,7 @@ class Popup {
this.child = null;
this.childrenSupported = true;
this.container = document.createElement('iframe');
this.container.id = 'yomichan-float';
this.container.className = 'yomichan-float';
this.container.addEventListener('mousedown', e => e.stopPropagation());
this.container.addEventListener('scroll', e => e.stopPropagation());
this.container.setAttribute('src', chrome.extension.getURL('/fg/float.html'));

View File

@ -30,8 +30,8 @@
* General
*/
html.yomichan-float:not([data-yomichan-theme]),
html.yomichan-float:not([data-yomichan-theme]) body {
html:root[data-yomichan-page=float]:not([data-yomichan-theme]),
html:root[data-yomichan-page=float]:not([data-yomichan-theme]) body {
background-color: transparent;
}
@ -82,8 +82,8 @@ ol, ul {
padding-bottom: 10px;
}
html:root.yomichan-float .entry,
html:root.yomichan-float .note {
html:root[data-yomichan-page=float] .entry,
html:root[data-yomichan-page=float] .note {
padding-left: 10px;
padding-right: 10px;
}