ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

It would be nice to support SVG files #171

Closed joeytwiddle closed 1 year ago

joeytwiddle commented 2 years ago

Screenshot_20220419_153927

Example file:

<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg">
    <mask id="mask">
        <rect width="100%" height="100%" fill="#fff" />
        <path d="M10 0h30l50 60-50 60H10l50-60" />
    </mask>
    <path d="M130 0h-30L50 60l50 60h30L80 60" fill="#5DA5D5" mask="url(#mask)" transform="translate(5 10)" />
    <path d="M5 10h30l50 60-50 60H5l50-60" fill="#2D2E2C" />
</svg>
ap commented 1 year ago

SVG should already be supported via the support for XML in general. For me at least, it is already:

ap commented 1 year ago

That said, even so, that can be improved for SVG specifically, and I have pushed that now:

(Note that in this screenshot the fill="white" is highlighted. But RGBA is also supported.)

Share and enjoy.