fixed issue #40: Make style transitions smooth