Created
February 19, 2026 03:24
-
-
Save greggman/57a12a7502fb430f6b5d361cdd535876 to your computer and use it in GitHub Desktop.
SVG: responsive size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <svg width="100" height="100"> | |
| <style> | |
| :root { | |
| --w: 50; | |
| --h: 100; | |
| } | |
| @media (max-width: 600px) { | |
| :root { | |
| --w: 100; | |
| --h: 50; | |
| } | |
| } | |
| </style> | |
| <rect width="100" height="50" fill="blue" style="width: var(--w); height: var(--h)" /> | |
| </svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"name":"SVG: responsive size","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment