Skip to content

Commit

Permalink
Replace deprecated API usage in dark mode documentation
Browse files Browse the repository at this point in the history
This change updates the proposed use of the [deprecated `MediaQueryList.addListener()`](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener) method with the standard `MediaQueryList.addEventListener()` method.
  • Loading branch information
eyecatchup committed May 4, 2021
1 parent 7d20020 commit 822aa6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/theming/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ toggle.addEventListener('ionChange', (ev) => {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)');

// Listen for changes to the prefers-color-scheme media query
prefersDark.addListener((e) => checkToggle(e.matches));
prefersDark.addEventListener('change', (e) => checkToggle(e.matches));

// Called when the app loads
function loadApp() {
Expand Down

0 comments on commit 822aa6c

Please sign in to comment.