fix(eink): more legibility for the dictionary and wikipedia popups on Eink devices, closes #3258 (#3262)

This commit is contained in:
Huang Xin
2026-02-11 17:22:05 +08:00
committed by GitHub
parent fd3533dba1
commit 129720c916
2 changed files with 7 additions and 7 deletions
@@ -93,7 +93,7 @@ const WikipediaPopup: React.FC<WikipediaPopupProps> = ({
errorMsg.innerHTML = _('Unable to load the article. Try searching directly on {{link}}.', {
link: `<a href="https://${language}.wikipedia.org/w/index.php?search=${encodeURIComponent(
query,
)}" target="_blank" rel="noopener noreferrer" class="text-primary underline">Wikipedia</a>`,
)}" target="_blank" rel="noopener noreferrer" class="not-eink:text-primary underline">Wikipedia</a>`,
});
errorDiv.append(h1, errorMsg);
@@ -120,7 +120,7 @@ const WikipediaPopup: React.FC<WikipediaPopupProps> = ({
<div className='text-base-content flex h-full flex-col pt-2'>
<main className='flex-grow overflow-y-auto px-2 font-sans'></main>
<footer className='mt-auto hidden data-[state=loaded]:block data-[state=error]:hidden data-[state=loading]:hidden'>
<div className='flex items-center px-4 py-2 text-sm opacity-60'>
<div className='not-eink:opacity-60 flex items-center px-4 py-2 text-sm'>
Source: Wikipedia (CC BY-SA)
</div>
</footer>
@@ -162,7 +162,7 @@ const WiktionaryPopup: React.FC<WiktionaryPopupProps> = ({
pushHistory(title);
});
link.className = 'text-primary underline cursor-pointer';
link.className = 'not-eink:text-primary underline cursor-pointer';
}
});
@@ -206,7 +206,7 @@ const WiktionaryPopup: React.FC<WiktionaryPopupProps> = ({
const p = document.createElement('p');
p.innerText = results[0]!.language;
p.className = 'text-sm italic opacity-75';
p.className = 'text-sm italic not-eink:opacity-75';
hgroup.append(h1, p);
main.append(hgroup);
@@ -226,7 +226,7 @@ const WiktionaryPopup: React.FC<WiktionaryPopupProps> = ({
if (examples) {
const ul = document.createElement('ul');
ul.className = 'pl-8 list-disc text-sm italic opacity-75';
ul.className = 'pl-8 list-disc text-sm italic not-eink:opacity-75';
examples.forEach((example) => {
const exampleLi = document.createElement('li');
@@ -261,7 +261,7 @@ const WiktionaryPopup: React.FC<WiktionaryPopupProps> = ({
p.innerHTML = _('Unable to load the word. Try searching directly on {{link}}.', {
link: `<a href="https://en.wiktionary.org/w/index.php?search=${encodeURIComponent(
word,
)}" target="_blank" rel="noopener noreferrer" class="text-primary underline">Wiktionary</a>`,
)}" target="_blank" rel="noopener noreferrer" class="not-eink:text-primary underline">Wiktionary</a>`,
});
div.append(h1, p);
@@ -310,7 +310,7 @@ const WiktionaryPopup: React.FC<WiktionaryPopupProps> = ({
ref={footerRef}
className='mt-auto hidden data-[state=loaded]:block data-[state=error]:hidden data-[state=loading]:hidden'
>
<div className='flex items-center px-4 py-2 text-sm opacity-60'>
<div className='not-eink:opacity-60 flex items-center px-4 py-2 text-sm'>
Source: Wiktionary (CC BY-SA)
</div>
</footer>