elm-community / typed-svg

Typed SVG library written for Elm
BSD 3-Clause "New" or "Revised" License
59 stars 16 forks source link

Cannot use scss var in fill and stroke #39

Open josepotal opened 4 years ago

josepotal commented 4 years ago

I was trying to use the a scss variable var(--text) in the fill attribute, like so:

g
        [ class [ "x-units" ] ]
        [ text_
            **[ fill  "var(--text)"]**
            [ text "Day" ]
        ]

I ended up using: attribute "fill" "var(--text)"

It would be nice to have a type inside the Paint type to handle the scss variables. Like the svg docs say:

" You can use the same css color naming schemes that you use in HTML, whether that's color names (that is red), rgb values (that is rgb(255,0,0)), hex values, rgba values, etc."

(https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Fills_and_Strokes)

As the scss properties also include scss variables (https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)