In the default setup, all levels of categories have the same font color in the category box. If you'd like to color each level differently, this recipe will allow you to specify a stylesheet class for each category level.
Note
Chef's suggestion:
Experiment using all the available class formatting options, not only colors. It may be the perfect choice for your store to show one of the levels in uppercase completely (with the first letter being bigger) using the parameter font-variant: small-caps
;
Your box could look like the one in this recipe. A second-level subcategory Subcat level 2 was added for better demonstration:
In this example, Hardware stays black, first-level subcategory CDROM Drives is red, and the added second-level subcategory is brown. The code presented here supports four levels of subcategories.