mirror of
https://github.com/chmouel/liseur-sync.git
synced 2026-10-19 03:17:09 +00:00
fix: keep reader selection colors owned by the active theme
Co-authored-by: chmouel <98980+chmouel@users.noreply.github.com>
This commit is contained in:
parent
b9f99793eb
commit
de60837fa1
3 changed files with 7 additions and 7 deletions
|
|
@ -1717,12 +1717,12 @@ function chapterCSS(s) {
|
|||
const theme = THEMES[s.theme];
|
||||
if (theme) {
|
||||
rules.push(
|
||||
`html { color-scheme: ${theme.scheme}; --selection-bg: ${theme.selectionBg}; --selection-fg: ${theme.selectionFg}; }`,
|
||||
`html { color-scheme: ${theme.scheme}; --liseur-selection-bg: ${theme.selectionBg}; --liseur-selection-fg: ${theme.selectionFg}; }`,
|
||||
`html, body { background: ${theme.bg} !important; color: ${theme.fg} !important; }`,
|
||||
`body * { background-color: transparent !important; color: ${theme.fg} !important; }`,
|
||||
`a:any-link { color: ${theme.link} !important; }`,
|
||||
"body::selection, body *::selection { background: var(--selection-bg) !important; color: var(--selection-fg) !important; }",
|
||||
"body::-moz-selection, body *::-moz-selection { background: var(--selection-bg) !important; color: var(--selection-fg) !important; }",
|
||||
"body::selection, body *::selection { background-color: var(--liseur-selection-bg) !important; color: var(--liseur-selection-fg) !important; }",
|
||||
"body::-moz-selection, body *::-moz-selection { background-color: var(--liseur-selection-bg) !important; color: var(--liseur-selection-fg) !important; }",
|
||||
);
|
||||
}
|
||||
if (FONTS[s.font]) {
|
||||
|
|
|
|||
4
internal/webui/testdata/readerbrowser.mjs
vendored
4
internal/webui/testdata/readerbrowser.mjs
vendored
|
|
@ -254,9 +254,9 @@ const probe = `(() => {
|
|||
selectionBackground: body ? doc.defaultView.getComputedStyle(body, '::selection').backgroundColor : '',
|
||||
selectionColour: body ? doc.defaultView.getComputedStyle(body, '::selection').color : '',
|
||||
selectionTokenBackground: doc
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--selection-bg').trim() : '',
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--liseur-selection-bg').trim() : '',
|
||||
selectionTokenColour: doc
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--selection-fg').trim() : '',
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--liseur-selection-fg').trim() : '',
|
||||
stageBackground: document.getElementById('reader-view')
|
||||
? getComputedStyle(document.getElementById('reader-view')).backgroundColor : '',
|
||||
fraction: typeof loc?.fraction === 'number' ? +loc.fraction.toFixed(4) : -1,
|
||||
|
|
|
|||
4
internal/webui/testdata/readerfirefox.mjs
vendored
4
internal/webui/testdata/readerfirefox.mjs
vendored
|
|
@ -183,9 +183,9 @@ const probe = `(() => {
|
|||
selectionBackground: body ? doc.defaultView.getComputedStyle(body, '::selection').backgroundColor : '',
|
||||
selectionColour: body ? doc.defaultView.getComputedStyle(body, '::selection').color : '',
|
||||
selectionTokenBackground: doc
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--selection-bg').trim() : '',
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--liseur-selection-bg').trim() : '',
|
||||
selectionTokenColour: doc
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--selection-fg').trim() : '',
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).getPropertyValue('--liseur-selection-fg').trim() : '',
|
||||
stageBackground: document.getElementById('reader-view')
|
||||
? getComputedStyle(document.getElementById('reader-view')).backgroundColor : '',
|
||||
fraction: typeof loc?.fraction === 'number' ? +loc.fraction.toFixed(4) : -1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue