Transform CSS correctly in case of multiple inheritance

Fixes #849