Set theme to light theme

45 views
Skip to first unread message

bruh 9000

unread,
Mar 28, 2024, 10:38:48 PM3/28/24
to Blockly
document.getElementById('darkModeCheckbox').addEventListener('change', function(event) {
  if (event.target.checked) {
    ws.setTheme(DarkTheme);
  } else {
   
  }
});


document.addEventListener("DOMContentLoaded", function() {
  if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
    ws.setTheme(DarkTheme);
  } else {

  }
});

This is my current code for switching themes, but I am unable to figure out the value for setTheme that turns it to light theme. I successfully imported dark theme, and it works fine, but I just can't reset it.

Maribeth Moffatt

unread,
Mar 29, 2024, 1:18:56 PM3/29/24
to Blockly
The default theme is called Classic. You can access it at `Blockly.Themes.Classic`

Best,
Maribeth

Reply all
Reply to author
Forward
0 new messages