Przeglądaj źródła

Fix stylesheet toggle

Use rel attributes to specify currently selected theme.
tags/0.3.0
TheoryOfNekomata 3 lat temu
rodzic
commit
48881294f8
1 zmienionych plików z 2 dodań i 0 usunięć
  1. +2
    -0
      packages/react-common-docs/src/components/ThemeToggle/ThemeToggle.tsx

+ 2
- 0
packages/react-common-docs/src/components/ThemeToggle/ThemeToggle.tsx Wyświetl plik

@@ -26,8 +26,10 @@ const applyStyles = (theme) => {
stylesheets.forEach(s => {
const enabled = s.title === theme
if (enabled) {
s.setAttribute('rel', 'stylesheet')
s.removeAttribute('disabled')
} else {
s.setAttribute('rel', 'alternate')
s.setAttribute('disabled', 'disabled')
}
})


Ładowanie…
Anuluj
Zapisz