Fix style corruption when toggling design mode.