elm / html

Use HTML in Elm!
https://package.elm-lang.org/packages/elm/html/latest/
BSD 3-Clause "New" or "Revised" License
395 stars 99 forks source link

There is no picture tag #240

Open Johann-Goncalves-Pereira opened 2 years ago

Johann-Goncalves-Pereira commented 2 years ago

I try to find the picture tag, but It doesn't exist in the Elm html package.

mbucc commented 1 year ago

Until this is merged, a work around is to use the attribute function in Html.Attributes.

I compiled but have not tested this example.


import Html.Attributes exposing (..)

logo : Html msg
logo =
    a
        [ img
            [ src "logo-medium.webp"
            , attribute "srcset" "/img/logo-small.webp 384w, /img/logo-medium.webp 683w, /img/logo-large.webp 1280w"
            , attribute "sizes" "(min-width: 2,048px) 1280px, (min-width: 768px) 683px, 25vw"
            ]
            []
        ]
Johann-Goncalves-Pereira commented 1 year ago

Yes, Html Node is useful as well.