About Sass Variables in JavaScript
You can pass Sass variables to JavaScript using CSS custom properties as follows:
Sass:
$theme_color: #215a00;
:root {
--theme-color: #{$theme_color};
}
JavaScript:
const themeColor = getComputedStyle(document.body)
.getPropertyValue('--theme-color');
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You