Reordering styles to match layer order