Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode toggle #24

Open
ArchOwlen opened this issue Nov 17, 2020 · 1 comment
Open

Dark mode toggle #24

ArchOwlen opened this issue Nov 17, 2020 · 1 comment

Comments

@ArchOwlen
Copy link

I use the Dark Reader extension to make websites dark, and it becomes hard to read when both extensions are enabled

image

(Small screenshot for privacy)
(For those who are using a dark theme on github: there is a dark border around the white box in the screenshot)

@ArchOwlen ArchOwlen changed the title Dark mode Dark mode toggle Nov 17, 2020
@jasontbradshaw
Copy link
Owner

jasontbradshaw commented Dec 2, 2020

Dark mode isn't something I'm personally interested in, however if there was a low effort/maintenance way to support it passively (e.g. using different classes from Amazon's styles), I'd be open to a PR.

My main concern is that I don't want to do something specific to a particular extension since I don't want to commit to chasing cross-extension compatibility forever.

As for implementation details, essentially this extension uses Amazon's own class names to style most things (e.g.

<div id="${elementId}" class="${loadingClass}">
<span class="total-text">${LOCALE.subtotal_text(attrs.total_count)}</span>:
<span class="total-price a-color-price">
${localeTotal}
</span>
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
<circle cx="50" cy="50" fill="none" stroke-linecap="round" r="40" stroke-width="10" stroke="#dddddd" stroke-dasharray="62.83185307179586 62.83185307179586">
<animateTransform attributeName="transform" type="rotate" calcMode="linear" values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animateTransform>
</circle>
</svg>
</div>
), with the exception of
background-color: white;
.

If there's a way to get the "white opaque background" style by adding one of Amazon's class names to the appropriate element, it's quite possible that this could be implemented along the guidelines I suggested above, since presumably the dark mode extension would then override the style for that class make it "dark" (though as I'm not familiar with that extension so it may not work this way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants