Skip to content

Commit

Permalink
Add comments for future development (concerning dark mode and select2…
Browse files Browse the repository at this point in the history
…) (CFM-239)
  • Loading branch information
arlen committed Jun 12, 2023
1 parent 06d8ee6 commit a464c16
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/templates/element/javascript.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
$("select").addClass("form-select");

// Use select2 library everywhere except
// XXX TODO: Find a replacement for Select2 - it is not accessible.
// - duet-date
// $("select").not("#limit").not(".duet-date__select--month").not(".duet-date__select--year").select2({
// width: '100%',
Expand Down Expand Up @@ -260,6 +261,7 @@
});

// Test for dark mode OS preference, and add the 'dark-mode' body class by default if it is present.
// XXX TODO: Replace this with setting an application variable (when available) so we do not flash the light color briefly on each page load
const darkModeOsEnabled = window.matchMedia("(prefers-color-scheme: dark)");
if(darkModeOsEnabled.matches) {
$('html').addClass('dark-mode');
Expand Down

0 comments on commit a464c16

Please sign in to comment.