This is so simple I have no idea why it's not working. I am trying to get a CSS variable value with jQuery and compare it to a string of the same value. The comparison should return true
while it does not.
var themeMode = $(document.body).css('--theme-mode');
console.log(themeMode);
console.log(themeMode == 'dark');
:root {
--theme-mode: dark;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>