That’s it. There are just a few rules. When you define a style for Name
the style automatically also affects Name.Function and so on. If you
defined 'bold' and you don’t want boldface for a subtoken use 'nobold'.

(Philosophy: the styles aren’t written in CSS syntax since this way
they can be used for a variety of formatters.)

or drop it into the styles subpackage of your Pygments distribution one style
class per style, where the file name is the style name and the class name is
StylenameClass. For example, if your style should be called
"mondrian", name the class MondrianStyle, put it into the file
mondrian.py and this file into the pygments.styles subpackage
directory.

Note that there may not be a space between bg: and the color value
since the style definition string is split at whitespace.
Also, using named colors is not allowed since the supported color names
vary for different formatters.

Custom styles used with the 256-color terminal formatter can also map colors to
use the 8 default ANSI colors. To do so, use ansigreen, ansibrightred or
any other colors defined in pygments.style.ansicolors. Foreground ANSI
colors will be mapped to the corresponding escape codes 30 to 37 thus respecting any
custom color mapping and themes provided by many terminal emulators. Light
variants are treated as foreground color with and an added bold flag.
bg:ansi<color> will also be respected, except the light variant will be the
same shade as their dark variant.

See the following example where the color of the string "helloworld" is
governed by the escape sequence \x1b[34;01m (Ansi bright blue, Bold, 41 being red
background) instead of an extended foreground & background color.