aforemny / elm-mdc

Elm port of the Material Components for the Web CSS/JS library
https://aforemny.github.io/elm-mdc
Apache License 2.0
354 stars 43 forks source link

Emit classes in order user gave them, not the reverse order #208

Closed berenddeboer closed 5 years ago

berenddeboer commented 5 years ago

The collect function reverses the user given order.

SidneyNemzer commented 5 years ago

Interesting change. As far as I know CSS does not care about the order of classes in the class attribute.

Not a big deal but this adds an extra function call and list traversal. I wonder if preserving the class order is worth it?

berenddeboer commented 5 years ago

It was mentioned in one of the comments in the code :-)

Although the browser doesn't care, I've always found it slightly delays me reading the emitted output as the order is different from what you expect. I'm assuming in most cases the list has only one item or two items, so overhead is probably minimal.

SidneyNemzer commented 5 years ago

Fair enough 👍