Transform CSS correctly in case of multiple inheritance