perfect-dark-mode
perfect-dark-mode copied to clipboard
Be able to use .dark instead of pdm-dark on root html.
This would mean that if used with tailwind css / twin.macro
you could enable all dark mode classes with .dark without any hack arounds.
If this is currently possible i would love to know
Maybe I could make the prefix configurable. If you want a workaround this will work:
let modePrevious;
window.__pdm__.mode.subscribe((mode) => {
const htmlElement = document.documentElement;
htmlElement.classList.remove(modePrevious);
htmlElement.classList.add(mode);
modePrevious = mode;
});
The mode value here is unprefixed.