website/frontend/src/Config/Style/Svgs/Helpers.elm
2024-12-11 02:38:42 -06:00

23 lines
710 B
Elm
Executable file

module Config.Style.Svgs.Helpers exposing (..)
import Config.Style.Svgs.Types as SvgTypes exposing (..)
import Element as E exposing (..)
import Svg
{- buildSvg consumes an inner record to construct most of an SVG, and an outer record to supply
any potentially varying TypedSvg.Core.Attribute msgs and wrap it in an Element.el so it can be
used by elm-ui. It provides a consistent interface for inserting SVGs into elm-ui code.
-}
buildSvg : SvgTypes.OuterPart msg -> SvgTypes.InnerPart msg -> Element msg
buildSvg outer inner =
el
outer.elementAttributes
<|
html <|
Svg.svg
(outer.svgAttributes ++ inner.svgAttributes)
inner.svg