The order in which styles are applied is not necessarily the same as the order in which the edges are given. It would be much better to rely on the second argument of EdgeShapeFunction
to control which styles are applied. Here is a version that does this:
styleAssociation = AssociationThread[edgeList, styles];
Graph[
edgeList,
VertexLabels->Automatic,
EdgeShapeFunction->({styleAssociation[Sort@#2],Arrow@#}&)
]
Update
Updated to add support for switching between Line/Arrow for the primitive. Here is the revised association:
assoc = AssociationThread[
edgeList,
Replace[
Thread[{edgeList, styles}],
{e_, s_} :> Association["directive" -> s, "primitive" -> If[MatchQ[e, _UndirectedEdge], Line, Arrow]],
{1}
]
];
And, here is the corresponding Graph call:
Graph[
edgeList,
VertexLabels->Automatic,
EdgeShapeFunction->({assoc[Sort@#2, "directive"], assoc[Sort@#2, "primitive"][#1]}&)
]