<script>
svDocReady(function() {
    const textColor = '$textColor'
    const menuBackground = '$menuBackground'
    const menuColor = '$menuColor'
    const footerColor = '$footerColor'
    
    if (textColor != '') {
        const headings = document.querySelectorAll('.mdh-h1, .mdh-h2, .mdh-h3, .mdh-h4, .mdh-h5, .mdh-p, .mdh-ingress')
        headings.forEach(heading => {
            heading.style.color = textColor
        });
    }

    const menu = document.querySelector('#mobile-menu__subpages')

    if (menuBackground != '') {
        menu.style.backgroundColor = menuBackground
    }

    if (menuColor != '') {
        const menuLinks = menu.querySelectorAll('.mdh-mobile-menu__subpages--link')
        menuLinks.forEach(link => {
            link.style.color = menuColor
        });
    }

    if (footerColor != '') {
        const footer = document.querySelectorAll('.mdh-footer')[0]
        const footerText = footer.querySelectorAll('p, h1, h2, h3, h4, h5')
        footerText.forEach(text => {
            text.style.color = footerColor
        });
    }
});
</script>