perfect-dark-mode icon indicating copy to clipboard operation
perfect-dark-mode copied to clipboard

Be able to use .dark instead of pdm-dark on root html.

Open BurnedChris opened this issue 4 years ago • 1 comments

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

BurnedChris avatar Mar 01 '21 12:03 BurnedChris

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.

DylanVann avatar May 03 '21 05:05 DylanVann