It is hard to translate directly and the meaning in both sentences is a bit different.
The first sentence would best be translated as "But the trend to wear stylish headgear persits." In German "Der Trend zu/zur/zum s.th." is used like some sort of synonym, shortening the sentence by hiding the verb which will be conveyed by the context and only using the preposition.
The second sentence does rely on the context. Here I'd assume that they are talking about clothing and a specfic clothing item that can be worn perfectly with a jeans blazer. The sentence would then continue like "Perfekt zum Jeans-Blazer mit ausgefallenem Schnitt passt ein weißes T-Shirt".
In that case the meaning of "zum" would be translated like this "A white T shirt fits perfectly to a jeans blazer with a fancy clothing cut". Here "zum" acts as preposition connecting the blazer and the shirt in context with the verb "passen", essentialy replacing "to" in the English equivalent "fit s.th. to s.th.".