{"id":33957,"date":"2017-06-19T12:25:38","date_gmt":"2017-06-19T19:25:38","guid":{"rendered":"https:\/\/medium.com\/@yangsammyy\/project-1-retrospective-personal-training-scheduling-app-d27b18c61551?source=rss------ux-5"},"modified":"2017-06-19T12:25:38","modified_gmt":"2017-06-19T19:25:38","slug":"10-golden-rules-for-responsive-svgs","status":"publish","type":"post","link":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/","title":{"rendered":"10 golden rules for responsive SVGs"},"content":{"rendered":"<p>The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a\u00a0natural fit for <a href=\"http:\/\/www.creativebloq.com\/rwd\/responsive-web-design-tutorials-71410085\">responsive web design<\/a>. Despite the SVG specification being a decade old, it&#8217;s relatively recent support in many browsers and tools means there are\u00a0still a number of tricks, loopholes and gotchas that catch out even experienced web designers and developers.\u00a0<\/p>\n<p>Here, I&#8217;ve summarised the most important of these as 10 golden rules.<\/p>\n<h3>01. Set up your tools correctly<\/h3>\n<p>Just as a craftsman sharpens his tools before beginning work, anyone working with SVG must set their applications up to deliver vector format in the most efficient and optimised method possible. There are a number of settings to implement.<\/p>\n<p>First, unless there are compelling reasons to do otherwise,\u00a0set measurements to &#8216;pixels&#8217; in your vector tool. While it doesn&#8217;t matter to SVG (which will measure the <strong>viewBox<\/strong> and elements happily in almost any measurement system) it makes sense to develop the SVG drawing using common CSS units, rather than the print default of inches; and it also makes it much easier to add <strong>@media<\/strong> queries and other interventions later.<\/p>\n<p>Don&#8217;t make the canvas area any larger than it needs to be. Like bitmap images, any &#8216;blank space&#8217; in\u00a0the SVG won&#8217;t be used, and is best substituted with\u00a0CSS margins. Note that many vector tools, such\u00a0as Sketch, will automatically &#8216;crop&#8217; the canvas area to selected elements.<\/p>\n<p>At the same time,\u00a0don&#8217;t crop the canvas area to the exact edges of elements. Antialiasing will still be applied to the SVG, and cutting it too close may also crop out the antialiasing. Instead, leave at least 2px clear wherever the edge of the canvas comes close to\u00a0an element.<\/p>\n<p>Responsiveness and performance are closely related, so set the decimal precision to be no more than two points. SVG doesn&#8217;t think in integers, so a vector point can have a value of\u00a01.45882721px. This extreme precision is entirely unnecessary, and only adds to code bloat and file size, so it&#8217;s better to\u00a0truncate it at this point.<\/p>\n<p>Similarly, draw vector shapes using as few points as possible. Many new designers assume more points is better, when the reverse is actually true: a few points, placed well, provide greater control over an\u00a0element, while also reducing file size.\u00a0<\/p>\n<p>If you&#8217;re given vector files that do not follow this rule, don&#8217;t worry \u2013 most <a href=\"http:\/\/www.creativebloq.com\/graphic-design\/how-create-vector-art-2131975\">vector art<\/a> applications have a &#8216;simplify&#8217; option you can use to reduce the number of points in an element without changing its shape. Alternatively, for detailed work I&#8217;d suggest a\u00a0plugin like Astute Graphics&#8217; VectorScribe.<\/p>\n<h3>02. Remove height and width attributes<\/h3>\n<p>Most apps add a\u00a0lot\u00a0of proprietary, unnecessary code in their SVG export. The only\u00a0required\u00a0code at the start of most SVG files is the following:<\/p>\n<p>For our purposes, the most important aspect is the removal of the <strong>width<\/strong>\u00a0and\u00a0<strong>height<\/strong> attributes that most applications include automatically. This makes the SVG fully responsive in modern browsers.<\/p>\n<p>If you&#8217;re processing a lot of SVGs, or are in a rush, you don&#8217;t need to complete this step by hand. Instead, you can follow the suggestions laid out in the third golden rule&#8230;<\/p>\n<h3>03. Optimise and minify SVG output<\/h3>\n<figure>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" name=\"\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/dEr2eCVSR9UJYuGnff8Nyd.jpg?w=900\" align=\"middle\" fullscreen=\"\"><\/p><figcaption>A combination of intelligent hand-editing and post-production optimisation can reduce SVG file sizes markedly<\/figcaption><\/figure>\n<p>Whatever tool you use to create your SVG content, it&#8217;s\u00a0still worthwhile processing its output through a tool like <a href=\"https:\/\/jakearchibald.github.io\/svgomg\/\" target=\"_blank\">SVGOMG<\/a>, which will trim the code markedly. Typically, you can save around 20 to 80 per cent in file size. The same code can be integrated locally <a href=\"https:\/\/www.npmjs.com\/package\/svgo\" target=\"_blank\">as a gulp or Grunt task<\/a>.<\/p>\n<h3>04. Modify code for IE<\/h3>\n<p>Rule 2 mentioned that correctly optimised SVGs are fully responsive in modern browsers. That&#8217;s true if we count Microsoft Edge as a modern browser. For IE 9-11, we have a few issues to address. If we are using the SVG as an\u00a0image:<\/p>\n<p>We can force IE9-11 to display the image correctly using the CSS attribute selector:<\/p>\n<p>SVG images work well in general production, but have limited interactivity: most browsers will ignore interactivity and animation inside an SVG placed on a page as an <strong><img><\/strong>. In addition, SVG images are an extra HTTP request for the browser.\u00a0<\/p>\n<p>For these and other reasons, SVG is increasingly used inline. In that case, the SVG code needs a little more treatment for IE:<\/p>\n<p>In addition to the\u00a0<strong>preserveAspectRatio<\/strong>\u00a0attribute, IE\u00a0needs a little more guidance to preserve the correct scaling of the image: take the\u00a0width\u00a0of the\u00a0SVG (<strong>365<\/strong>\u00a0in this case), divide it by the height (<strong>525<\/strong>) and multiply the result by 100 per cent. This\u00a0will become the\u00a0<strong>padding-bottom<\/strong>\u00a0value for the SVG, &#8216;propping&#8217; it open enough in IE to display the\u00a0SVG in its\u00a0correct aspect ratio:<\/p>\n<p><\/p>\n<p>Note that, in order to keep things concise and clear, the code samples in the rest of this article don&#8217;t include these changes. Amelia Bellamy-Royds has written an\u00a0<a href=\"https:\/\/css-tricks.com\/scale-svg\/\" target=\"_blank\">excellent article on scaling SVG<\/a>.<\/p>\n<h3>05. Consider SVG for hero text<\/h3>\n<figure>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" name=\"\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/EXhvxJP5pNyqADvVoh8Kyd.jpg?w=900\" align=\"middle\" fullscreen=\"\"><\/p><figcaption>Using SVG for hero text means it will automatically scale in line with its container<\/figcaption><\/figure>\n<p>There&#8217;s currently no CSS standard for sizing text to its container. It&#8217;s possible to scale text using vw\u00a0units, but that will almost always require at least\u00a0two media query interventions to &#8216;clamp&#8217; the\u00a0text at certain viewport limits. However, SVG text\u00a0will\u00a0resize to a container automatically:<\/p>\n<p>The CSS:<\/p>\n<p>Keeping the SVG inline preserves accessibility and SEO value,\u00a0and\u00a0allows the text to be styled using any font already embedded in the page. See <a href=\"http:\/\/thenewcode.com\/363\/Creating-Responsive-Hero-Text-with-SVG\"><ins>here<\/ins><\/a> for more information.\u00a0<\/p>\n<h3>06. Leave width and height in place for progressive icons<\/h3>\n<figure>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" name=\"\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/ymE5vZyuNoNJqU62uCSLyd.jpg?w=900\" align=\"middle\" fullscreen=\"\"><\/p><figcaption>A non-scaling-stroke line has been applied to this speech bubble so it will not change in width when the viewport is resized<\/figcaption><\/figure>\n<p>One exception to Rule 2 is icons and small logos, which should retain their <strong>width<\/strong> and <strong>height<\/strong> attributes if you want them to be progressively enhanced:<\/p>\n<p>You can see an example of this technique in action <a href=\"http:\/\/codepen.io\/dudleystorey\/pen\/MKxrEr\" target=\"_blank\">here<\/a>.\u00a0<\/p>\n<p>If we\u00a0only\u00a0size the SVG icons with CSS, and the site&#8217;s style sheet\u00a0doesn&#8217;t\u00a0load, the icons will appear at\u00a0the default size of a replaced element: 300px x 150px. By keeping the height and width as attributes, we can size them to the nearest reasonable touch size\u00a0by default, and use our CSS to\u00a0enhance\u00a0the\u00a0way they are presented.<\/p>\n<h3>07. Use vector-effects to keep hairlines thin<\/h3>\n<p>By default, SVG scales\u00a0everything\u00a0with the viewport, including stroke thickness. Usually this works out fine, but in some cases \u2013 diagrams and strokes applied as effects on the outside of text in particular \u2013 you may want to keep strokes the same thickness, no matter what the size of the drawing. This is the domain of the little-known\u00a0<strong>vector-effect<\/strong>\u00a0property, which can be applied as a presentation attribute or\u00a0in\u00a0CSS:<\/p>\n<p>Take a look at <a href=\"http:\/\/thenewcode.com\/443\/Making-Comic-Book-Speech-Bubbles-with-SVG\" target=\"_blank\">a full example of this technique<\/a>.<\/p>\n<h3>08. Remember bitmaps<\/h3>\n<p>Many developers assume SVG can only use vectors, but JPEGs and PNGs can also be applied to an SVG drawing. And so long as you&#8217;ve followed my rules so\u00a0far, those images will be responsive when you add\u00a0a bitmap via the\u00a0<strong><image><\/image><\/strong>\u00a0tag:<\/p>\n<h3>09. Consider adaptive solutions<\/h3>\n<figure>\n<p><img data-recalc-dims=\"1\" decoding=\"async\" name=\"\" src=\"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/q4JevRaG7zuy666uKCaUxd.jpg?w=900\" align=\"middle\" fullscreen=\"\"><\/p><figcaption>The classic Coca-Cola logo rendered at different adaptive sizes<\/figcaption><\/figure>\n<p>Making things go &#8216;squish&#8217; is only one part of responsive design. What RWD is about, in the larger sense of adaptive design, is presenting appropriate content at\u00a0all viewport sizes.<\/p>\n<p>This can be achieved in a variety of ways. responsivelogos.co.uk provides a series of examples that use SVG sprites, but I prefer to integrate media queries into the SVG to create what I call &#8216;branding modules&#8217;. This approach enables me to add, remove and modify the visibility of components. Read more about adaptive branding modules <a href=\"http:\/\/thenewcode.com\/1086\/%20Make-an-Adaptive-Branding-Module-with-SVG\" target=\"_blank\">in my article<\/a>.<\/p>\n<p>This same technique can be used for diagrams, illustrations, maps and more. In the simplest modules, the CSS itself can be written inside the SVG, making it usable everywhere, as outlined in the\u00a0previous rule.<\/p>\n<h3>10. Integrate media queries into SVG<\/h3>\n<p>Many people don&#8217;t know that CSS media queries can be written inside SVG itself:<\/p>\n<p>It&#8217;s important to note that the media query can only &#8216;see&#8217; the element it is inside of: that is, any measurement relates to the element itself, not the\u00a0page. One potential downside of this approach is\u00a0that the canvas area of the SVG will always remain the same, relative to the elements inside it.\u00a0<\/p>\n<p>This can result in very small elements at small viewport sizes, framed inside a relatively large canvas area. There are several solutions to this, including <a href=\"http:\/\/thenewcode.com\/1090\/Make-an-Advanced-Adaptive-Branding-Module-with-SVG-and-JavaScript\" target=\"_blank\">resizing the viewBox<\/a> and <a href=\"http:\/\/vagari.github.io\/svg_queries\/\" target=\"_blank\">scaling up the elements to compensate<\/a>.<\/p>\n<h3>Conclusion<\/h3>\n<p>The infinite scalability of SVG is its greatest asset, but a feature that is still somewhat underserved by\u00a0browsers and vector graphics editors. By integrating these guidelines into your production workflow and communicating them to others in your team, you can create smoothly responsive SVG for the web, making it part\u00a0of the assets you use in development every day.<\/p>\n<p><em>This article originally appeared in <\/em><a href=\"http:\/\/www.creativebloq.com\/net-magazine\"><em>net magazine<\/em><\/a><em> issue 283; <\/em><a href=\"https:\/\/www.myfavouritemagazines.co.uk\/design\/net-magazine-back-issues\/net-summer-2016-issue-283\/\" target=\"_blank\"><em>buy it here<\/em><\/a><em>!<\/em><\/p>\n<p><strong>Related articles:<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/www.creativebloq.com\/features\/12-must-have-user-testing-tools\" target=\"_blank\">12 must-have code testing tools<\/a><\/li>\n<li><a href=\"http:\/\/www.creativebloq.com\/how-to\/sharpen-your-sketching-skills\" target=\"_blank\">Sharpen your sketching skills<\/a><\/li>\n<li><a href=\"http:\/\/www.creativebloq.com\/web-design\/supercharge-svg-animations-gsap-11618683\" target=\"_blank\">Supercharge SVG animations with GSAP<\/a><\/li>\n<\/ul>\n<p class=\"wpematico_credit\"><small>Powered by <a href=\"http:\/\/www.wpematico.com\" target=\"_blank\">WPeMatico<\/a><\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a\u00a0natural fit for responsive web design. Despite the SVG specification being a decade old, it&#8217;s relatively recent support in many browsers and tools means there are\u00a0still a number of tricks, loopholes and&#8230;<a class=\"moretag\" href=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/\"> Read the full article&#8230;<\/a><\/p>\n","protected":false},"author":4,"featured_media":33958,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[371],"tags":[],"class_list":["post-33957","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-user-experience"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it&#039;s relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Guest Contribution\"\/>\n\t<meta name=\"keywords\" content=\"user experience\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"10 golden rules for responsive SVGs | Design for Immersive Technologies\" \/>\n\t\t<meta property=\"og:description\" content=\"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it&#039;s relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-06-19T19:25:38+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-06-19T19:25:38+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"10 golden rules for responsive SVGs | Design for Immersive Technologies\" \/>\n\t\t<meta name=\"twitter:description\" content=\"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it&#039;s relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#article\",\"name\":\"10 golden rules for responsive SVGs | Design for Immersive Technologies\",\"headline\":\"10 golden rules for responsive SVGs\",\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/dEr2eCVSR9UJYuGnff8Nyd.jpg?fit=1500%2C487&ssl=1\",\"width\":1500,\"height\":487},\"datePublished\":\"2017-06-19T12:25:38-07:00\",\"dateModified\":\"2017-06-19T12:25:38-07:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#webpage\"},\"articleSection\":\"User Experience\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"position\":2,\"name\":\"User Experience\",\"item\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#listItem\",\"name\":\"10 golden rules for responsive SVGs\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#listItem\",\"position\":3,\"name\":\"10 golden rules for responsive SVGs\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/category\\\/user-experience\\\/#listItem\",\"name\":\"User Experience\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/\",\"name\":\"Guest Contribution\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Guest Contribution\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#webpage\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/\",\"name\":\"10 golden rules for responsive SVGs | Design for Immersive Technologies\",\"description\":\"The many advantages of SVG \\u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \\u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it's relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/author\\\/guestcontribution\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.taterboy.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/06\\\/dEr2eCVSR9UJYuGnff8Nyd.jpg?fit=1500%2C487&ssl=1\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#mainImage\",\"width\":1500,\"height\":487},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/2017\\\/06\\\/10-golden-rules-for-responsive-svgs\\\/#mainImage\"},\"datePublished\":\"2017-06-19T12:25:38-07:00\",\"dateModified\":\"2017-06-19T12:25:38-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/\",\"name\":\"Design for Immersive Technologies\",\"description\":\"User Experience for Games, Virtual Reality (VR) and Augmented\\\/Mixed Reality (AR\\\/MR)\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.taterboy.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"10 golden rules for responsive SVGs | Design for Immersive Technologies","description":"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it's relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and","canonical_url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/","robots":"max-image-preview:large","keywords":"user experience","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#article","name":"10 golden rules for responsive SVGs | Design for Immersive Technologies","headline":"10 golden rules for responsive SVGs","author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/dEr2eCVSR9UJYuGnff8Nyd.jpg?fit=1500%2C487&ssl=1","width":1500,"height":487},"datePublished":"2017-06-19T12:25:38-07:00","dateModified":"2017-06-19T12:25:38-07:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#webpage"},"isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#webpage"},"articleSection":"User Experience"},{"@type":"BreadcrumbList","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.taterboy.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","position":2,"name":"User Experience","item":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#listItem","name":"10 golden rules for responsive SVGs"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#listItem","position":3,"name":"10 golden rules for responsive SVGs","previousItem":{"@type":"ListItem","@id":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/#listItem","name":"User Experience"}}]},{"@type":"Organization","@id":"https:\/\/www.taterboy.com\/blog\/#organization","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","url":"https:\/\/www.taterboy.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author","url":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/","name":"Guest Contribution","image":{"@type":"ImageObject","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/d2aad73eb0f48c67b141e9fc978a0e498969791ed623346e361d02d19775b0bb?s=96&d=mm&r=g","width":96,"height":96,"caption":"Guest Contribution"}},{"@type":"WebPage","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#webpage","url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/","name":"10 golden rules for responsive SVGs | Design for Immersive Technologies","description":"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it's relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.taterboy.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#breadcrumblist"},"author":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"creator":{"@id":"https:\/\/www.taterboy.com\/blog\/author\/guestcontribution\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/dEr2eCVSR9UJYuGnff8Nyd.jpg?fit=1500%2C487&ssl=1","@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#mainImage","width":1500,"height":487},"primaryImageOfPage":{"@id":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/#mainImage"},"datePublished":"2017-06-19T12:25:38-07:00","dateModified":"2017-06-19T12:25:38-07:00"},{"@type":"WebSite","@id":"https:\/\/www.taterboy.com\/blog\/#website","url":"https:\/\/www.taterboy.com\/blog\/","name":"Design for Immersive Technologies","description":"User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.taterboy.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Design for Immersive Technologies | User Experience for Games, Virtual Reality (VR) and Augmented\/Mixed Reality (AR\/MR)","og:type":"article","og:title":"10 golden rules for responsive SVGs | Design for Immersive Technologies","og:description":"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it's relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and","og:url":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/","article:published_time":"2017-06-19T19:25:38+00:00","article:modified_time":"2017-06-19T19:25:38+00:00","twitter:card":"summary","twitter:title":"10 golden rules for responsive SVGs | Design for Immersive Technologies","twitter:description":"The many advantages of SVG \u2013 including infinitely scalable vector images, small file sizes and direct integration with the DOM \u2013 make it a natural fit for responsive web design. Despite the SVG specification being a decade old, it's relatively recent support in many browsers and tools means there are still a number of tricks, loopholes and"},"aioseo_meta_data":{"post_id":"33957","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_custom_image_width":null,"og_custom_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"created":"2021-02-08 09:48:24","updated":"2026-08-30 12:06:15","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"twitter_image_url":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/\" title=\"User Experience\">User Experience<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t10 golden rules for responsive SVGs\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.taterboy.com\/blog"},{"label":"User Experience","link":"https:\/\/www.taterboy.com\/blog\/category\/user-experience\/"},{"label":"10 golden rules for responsive SVGs","link":"https:\/\/www.taterboy.com\/blog\/2017\/06\/10-golden-rules-for-responsive-svgs\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8wzr5-8PH","jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.taterboy.com\/blog\/wp-content\/uploads\/2017\/06\/dEr2eCVSR9UJYuGnff8Nyd.jpg?fit=1500%2C487&ssl=1","_links":{"self":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/33957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/comments?post=33957"}],"version-history":[{"count":0,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/posts\/33957\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media\/33958"}],"wp:attachment":[{"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/media?parent=33957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/categories?post=33957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taterboy.com\/blog\/wp-json\/wp\/v2\/tags?post=33957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}