Dev Tools · 2h ago
Stop Hardcoding #d9d9d9: Why That Gray Breaks Dark Mode and Accessibility
Hardcoding the hex code #d9d9d9 for borders and backgrounds causes UI bugs in dark mode and fails WCAG accessibility standards when paired with gray text. The color also renders differently across monitors due to color space variations. Developers should use semantic CSS variables or design tokens instead of hardcoding this specific gray.
Meridian48 take
This is a practical frontend tip, but the article overstates the problem—#d9d9d9 is just one example of a broader need for design tokens and theming.
cssaccessibility