Skip to content

How to handle SVG style attributes #13

@davedawkins

Description

@davedawkins

SVG adds style attributes like text-anchor, stroke, fill, stroke-dasharray etc. Some of these are part of the regular CSS styles (eg fill), and some are HTML attributes (text-anchor). So I wonder if we should either extend CssEngine or create an SvgCssEngine.
Here's some Sutil code that I can't port fully to use Feliz.Engine as yet (see references to CssXs)


    rule ".tick line" [
        CssXs.stroke "#e2e2e2"
        CssXs.strokeDasharray "2"
    ]

    rule ".tick text" [
        Css.fill "#ccc"
        CssXs.textAnchor "start"
    ]

    rule ".tick.tick-0 line" [
        CssXs.strokeDasharray "0"
    ]

    rule ".x-axis .tick text" [
        CssXs.textAnchor "middle"
    ]

    rule ".bars rect" [
        Css.fill "#a11"
        CssXs.stroke "none"
        Css.opacity 0.65
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions