It doesn’t have to be that way.
You could create a Skill [1] that tells the agent to use modern css; the newer models like Opus 5 are probably much better with modern css.
Google released a set of skills at I/O called Modern Web Guidance [2] that steer coding agents to use modern css and best practices.
[1]: https://www.skills.sh/paulirish/dotfiles/modern-css
[2]: https://developer.chrome.com/docs/modern-web-guidance/get-st...