All of the theme colours are available as variables.
The most useful ones for backgrounds are --i-background_1 through to --i-background_6. Background 1 is the lightest colour in a light theme, and the darkest in the dark theme.
There are 3 main colors: --i-color_root, --i-color_soft and --i-color_hard. "Root" is the global text colour, "soft" is a subtle/softer colour and "hard" is a higher contrast colour. There are also a bunch of others including --i-color_primary, --i-color_secondary, --i-color_positive, --i-color_negative.
In practice, variables in v5 look like this:
.box{
background-color: var(--i-background_3);
color: var(--i-color_hard);
padding: 1em;
}