document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('.beast-card').forEach(card => { // Find the color chip within the card const colorChip = card.querySelector('.tdb-module-term'); // Check if the color chip exists if (colorChip) { // Get the background color, either as a variable or computed color const chipStyle = window.getComputedStyle(colorChip); const bgColor = chipStyle.getPropertyValue('background-color') || chipStyle.getPropertyValue('--your-variable-name'); // Apply the color to the card background card.style.backgroundColor = bgColor; } }); });