mdgriffith / design-discussion-elm-ui-2

A repo for discussing changes to Elm UI 2
17 stars 0 forks source link

Make border more flexible #15

Open jouderianjr opened 4 years ago

jouderianjr commented 4 years ago

I faced a problem with elm-ui recently, I was trying to have different border colors, I had to use html attribute style like this, as elm-ui only provides Border.color:


defaultBorder =
    [ Border.width 2
    , style "border-bottom-color" "rgb(5,6,8)"
    , style "border-right-color" "rgb(5,6,8)"
    , style "border-left-color" "rgb(255,255 ,255)"
    , style "border-top-color" "rgb(255,255 ,255)"
    ]

This is a fine solution, not optimal, it works, but the problem is this doesn't work with `mouseDown` as my custom `style` function is not `Decorative`.

so I would suggest adding also a function like `Border.colorEach`.

I think this can be also added to the current version as a minor as it should not affect much and it should not require a lot of implementation. I'm glad to open a pull request to the current elm-ui if you agree to add this to the elm 1.0 version.