terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
698 stars 67 forks source link

Axis to allow custom HTML/SVG attributes #122

Open Janiczek opened 1 year ago

Janiczek commented 1 year ago

Hello! I'd like to be able to do

C.xAxis [ CA.attrs [Svg.Attributes.class "text-grey2" ] ]

(or the htmlAttrs variant), but I'm disallowed this by:

type alias Axis =
  { limits : List (Attribute C.Axis)
  , pinned : C.Axis -> Float
  , arrow : Bool
  , color : String
  , width : Float
  }

I do have a workaround for now (generating CSS vars from my Tailwind config and then using CA.color "var(--tailwind-color-grey2)", but it would be nice to do the above with a class.