# SVG Ready: SVG to CSS Data URI Converter **SVG Ready** is a web-based tool that securely converts raw SVG markup into CSS-ready Data URIs. It focuses on optimization, strict sanitization, and generating clean, performant output for use in CSS backgrounds and masks. ## Quick Start 1. Paste raw SVG markup into the form. 2. Choose optimization options (strip width/height, strip class, show base64). 3. Click **Convert** or press **Cmd + Enter / Ctrl + Enter**. 4. Copy the generated output formats (Percent-encoded Data URI, CSS snippets, etc.). ## Interface Overview * **Input**: Raw SVG markup in a textarea. * **Options**: * Strip `width` / `height` on root `` (for scalability). * Remove `class` on root `` (to avoid CSS conflicts). * Show Base64 Data URI (includes the less efficient base64 format). * **Output**: * SVG Preview * Cleaned/Normalized Markup * Percent-encoded Data URI (for CSS) * CSS `background-image` snippet * CSS `mask-image` snippet * Base64 Data URI (if selected) * **Metrics**: Shows input/output size difference and optimization percentage. * **Copy buttons** for each output block. ## Conversion Options and Results | Option | Effect | Output Snippet | | :--- | :--- | :--- | | **Strip Width/Height** | Removes `width` and `height` attributes from the root ``, making the SVG naturally scalable via CSS. | `` | | **Strip Class** | Removes the `class` attribute from the root ``. | `` without `class="..."` | | **Show Base64** | Generates an additional Base64-encoded Data URI. | `data:image/svg+xml;base64,...` | ## Security and Limitations The tool employs **strict whitelisting** and multiple security layers to ensure safety, running securely on **Cloudflare Pages Functions** (Edge Workers). * **Max Input Size:** 250 KB limit (`SVGConverter.ERROR_TOO_LARGE`). * **XML Parsing Errors:** Strict checks for malformed XML and mismatched tags (`SVGConverter.ERROR_INVALID_ROOT`). * **Disallowed Tags & Attributes (Sanitization):** * **Dangerous Tags Removed:** `