In a greyscale design, it is possible to switch between "dark/light" theme with "filter" and CSS function invert():
box.invert{filter:invert(100%);}
High contrast themes tend to eliminate backgrounds. By employing a transparent outline the box shape can be restored. When a high contrast theme is not running, the outline is invisible.