import {log, querySelector} from '../utilities/exports.js'; export function runThemedLogoFeature() { themedLogo(); log('Themed Logo: Initialized.'); } const tildesLogo = ` `; function themedLogo() { let themedLogo = tildesLogo; for (const customProperty of tildesLogo.match(/var\(--.+\)/g) ?? []) { let color = window .getComputedStyle(document.body) .getPropertyValue(customProperty.slice('var('.length, -1)); if (color === '') { color = '#f0f'; } themedLogo = themedLogo.replace(customProperty, color); } const encodedSvg = encodeURIComponent(themedLogo); const siteHeader = querySelector('.site-header-logo'); siteHeader.style.backgroundImage = `url("data:image/svg+xml,${encodedSvg}")`; }