elm-css icon indicating copy to clipboard operation
elm-css copied to clipboard

`Css.important` on `Css.batch` output only applies to last Css.Style

Open Chadtech opened this issue 4 years ago • 0 comments

Hello!

Today I ran code like this..

    [ Css.borderTopLeftRadius radiusSize
    , Css.borderTopRightRadius radiusSize
    , Css.borderBottomLeftRadius radiusSize
    , Css.borderBottomRightRadius radiusSize
    ]
        |> Css.batch
        |> Css.important

.. and the important was only applied to the last style.

I managed to reproduce it in this ellie: https://ellie-app.com/c8R5mP4Kvxsa1 , where specialBorderRadius should be applying a border radius to the top right and bottom left corners because of the important, but it is only applied to the top right corner.

I can see the code for why this is. There appears to be a mapLastProperty function that Css.important is using.

I would be happy to make the PR for this. Just let me know!

Chadtech avatar Jan 22 '21 02:01 Chadtech