I would have thought this could be achieved in a custom theme. It's possible to build filters that manipulate the CSS on the fly. You could also do it with some JavaScript/Ajax that manipulated the CSS (you may need to change the layout files or even override the renderers for parts of the screen).
In other words, it would be possible but relatively difficult.
https://docs.moodle.org/dev/Themes
Don't (!) change core code. That's a very bad plan - it breaks upgrades.