capitalist / elm-octicons

Octicons. For your Elm apps.
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

Reduce repetition of code for configuration, introduce integration test #1

Closed YetAnotherMinion closed 7 years ago

YetAnotherMinion commented 7 years ago

It appeared to me that there was a lot of repetition centered around creating custom sized or styled icons. Our use case requires many different sizes of the icons so I took a stab at cutting down the amount of code both on the elm side and the generated javascript. I separated what is generally configurable about an icon (the width, height, color, fill ...), and what information is inseparable from the icon itself without altering the intention of the icon designer (name, viewBox).

I also introduced an integration test that renders all of the icons exported by the project into a grid in the same style as octicons.github.com so you can quickly spot check that everything is working.

In acknowledgment that each user probably has a different idea of what the best defaults are, I removed all helpers. Now there is only a single function per icon.

iconName : Options -> Html msg
capitalist commented 7 years ago

This is a solid refactor. Thanks!