EINDEX / logseq-copilot

Logseq Copilot is a Browser extension that allows you to access your Logseq via your browser.
https://logseq-copilot.eindex.me
GNU General Public License v3.0
235 stars 21 forks source link

DuckDuckGo dark theme is unreadable #24

Closed thinkh closed 1 year ago

thinkh commented 1 year ago

Describe the bug

When using the DuckDuckGo dark theme some parts of the copilot sidebar are unreadable.

To Reproduce Steps to reproduce the behavior:

  1. Go to DuckDuckGo
  2. Switch to dark theme in settings
  3. Search for something that is available in the local graph
  4. See result

Expected behavior

The colors should have a better contrast in the dark theme.

Screenshots If applicable, add screenshots to help explain your problem.

Default white theme

grafik

Switch to dark theme

grafik

Dark theme

grafik

Desktop (please complete the following information):

howarddo2208 commented 1 year ago

I suspect the tailwind doesn't recognize theme change, but upon trying to fiddle with the code, I ran to an issue with the build script. Do you know how to resolve this @EINDEX ?

> logseq-copliot@1.6.0 build
> node build.mjs

/Users/tanhopdo/Developments/opensource/logseq-copilot/src/manifest.json.cjs:28
    version: process.env.VERSION.replace('v', ''),
                                 ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at build (/Users/tanhopdo/Developments/opensource/logseq-copilot/src/manifest.json.cjs:28:34)
    at build (file:///Users/tanhopdo/Developments/opensource/logseq-copilot/build.mjs:96:20)

Node.js v18.16.0
EINDEX commented 1 year ago

Sorry those days were busy with work, you have to set env var before build.

@howarddo2208

export VERSION=v0.0.0
EINDEX commented 1 year ago

I force the font color for dark and light modes, which will suit for system's default theme. If change theme at search engine, may can not using the correct theme.

Will keep this open until copilot can support theme by sites.

howarddo2208 commented 1 year ago

Yeah, it doesn't update based on the site. But turns out the problem is actually from the body style, other search sites update the body {color} when changing the theme and the extension inherit it, but it is not the case for duckduckgo

howarddo2208 commented 1 year ago

now you fixed the issue by hard-code the text color, but then the light theme on all sites is unreadable @EINDEX. image Please consider my PR #26 . Btw, I tested the tailwind, it never switches to dark tho, so I think all the dark: styles are not used.

EINDEX commented 1 year ago

@howarddo2208 your solutions are awesome, thanks.