Kevin Powell - CommunityKP-C
Kevin Powell - Community2y ago
15 replies
CDL

Is there an efficient way to handle SVG usage in Svelte?

Instead of this hideous block of code in the picture, is there an easier way to handle using an svg? it really does make it very difficult to see what the hell is going on when I scroll through my code..

    <div class="react">
        <svg
            width="800px"
            height="800px"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
            fill="#ff5733"
            stroke="#ff5733"
        >
            <g id="SVGRepo_bgCarrier" stroke-width="0" />

            <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" />

            <g id="SVGRepo_iconCarrier">
                <title>react</title> <rect width="24" height="24" fill="none" />
                <path
                    d="M12,10.11A1.87...........
                />
            </g>
        </svg>
        <i>React</i>
image.png
Was this page helpful?