Sure it's not an issue with whatever is doing that (hacky) dark mode CSS? Looking at the google example, they are setting the font color. It just doesn't look good when dark-mode CSS doesn't take the existing colors into account.
In most examples, they're setting the background colour without corresponding font colour. In the Google example, they're making the opposite mistake.
One should set both or none.