I refactored the site’s theme system to use a single dataTheme attribute on the html element instead of toggling multiple CSS classes across various elements. This change makes theme switching faster, more reliable, and less error-prone. It also improves consistency during page load and reduces the amount of DOM manipulation required. This also fixes a race condition.