[黑暗模式] 多个主题硬编码了直接的 CSS 属性,从而绕过了 Bootstrap 5.3 的黑暗模式变量重映射
作者: jayflesher创建于 2026年6月11日更新于 2026年7月16日
Bootstrap 5.3 implements dark mode by remapping CSS variables (e.g. `--bs-body-color`, `--bs-alert-bg`, `--bs-btn-color`) when `[data-bs-theme="dark"]` is set on a parent element. This only works if the rendered value flows through a variable — a direct hardcoded CSS property like `color: #212529` is invisible to the variable system and stays unchanged regardless of the active theme.
内容来源: thomaspark/bootswatch