AI 摘要The author, Sara Soueidan, shares the video recordings and slides of her talk 'SVG Filters: The Crash Course,' which she developed after learning SVG filters to customize a workshop for Netflix's design and engineering team, and which she presented at Beyond Tellerrand Munich and CSS Day Amsterdam. She had originally planned to write a series of in-depth articles on the topic, but since her interests are shifting to other areas of front-end development, she instead compiled the videos, slides, and recommended resources like the Web Platform docs and Michael Mullany's work. She notes that SVG filters offer many possibilities for recreating graphic editor effects, while acknowledging their limitations, and encourages readers to experiment with them.
AI 摘要While preparing a light/dark theme switcher demo for an upcoming talk, the author explores how to design and mark up accessible toggle switches, concluding that the correct implementation depends on intended behavior: radio buttons suit choosing between two distinct options, while a checkbox or a button with ARIA attributes fits enabling/disabling a single feature. After studying resources like Heydon Pickering's Inclusive Components and The A11y Project, the author inspects Codepen's buggy public/private switch—a single checkbox with two labels causing confusing behavior—and discusses possible fixes depending on whether it should toggle one option or offer two. The key takeaway is that design and UX should be decided first, with accessibility baked into the markup from the very start.
AI 摘要The author announces they have added offline viewing functionality to their website using Service Workers, allowing visitors to access main pages and articles even without an internet connection, along with a Web App Manifest for a more native-app-like experience. The implementation was inspired by Jeremy Keith's new book 'Going Offline' from A Book Apart, which the author read in two days and highly recommends for anyone wanting to learn about Service Workers. These features are progressively enhanced, meaning browsers that don't support Service Workers simply miss out on the new capabilities while the site experience remains unchanged.
AI 摘要The author describes a case study from the Smashing Magazine redesign in which three complex SVG membership illustrations needed to be delivered in a performant and accessible way. To achieve this, each illustration was split into an external, cacheable SVG file referenced inside an inline via an element, while the membership titles remained as real inline SVG elements, making them searchable, selectable, accessible, and stylable from the main stylesheet. This hybrid approach shows that SVG's dual nature as both an image and a document allows combining multiple embedding techniques for clean code, better performance, and accessible text.
AI 摘要This article explains how SVG's viewBox and preserveAspectRatio attributes can be used to crop, scale, and position images as a fallback or alternative to the CSS object-fit and object-position properties. The author demonstrates that nearly any combination of object-fit and object-position values can be replicated with preserveAspectRatio, and this technique works in any browser supporting SVG, including Internet Explorer back to IE9. The article also shows how to make the SVG solution accessible by adding a element and appropriate ARIA attributes.
In this article I explain the subtle but important difference between auto-fill and auto-fit for sizing columns in CSS Grid. Each of them exhibits a responsive behavior once compbined with repeat() that you may or may not want for your resp
AI 摘要The author describes migrating their personal website from Jekyll and GitHub Pages to Hugo and Netlify, primarily because Jekyll became unbearably slow at compiling the site—sometimes taking up to five minutes per change or freezing entirely. They chose Hugo for its blazing build speed and flexible content organization, which they first experienced firsthand while working on the Smashing Magazine redesign. The article walks through setting up Hugo, using its one-line Jekyll import command, and shares practical tips on folder structure, config files, and template conversion learned during the migration.
AI 摘要Unlike HTML elements, SVG elements lack a CSS box model and are positioned absolutely relative to the SVG viewport's single coordinate system, which makes positioning one SVG element relative to another a challenge. The article explains how nesting elements can be used to create grouping, new coordinate systems, and separate 'layers' for responsive effects, and introduces the concept of bounding boxes as a way to compensate for the missing box model. By retrieving an element's bounding box properties (x, y, width, height) via getBBox(), an inner can be visually placed over another element to establish a positioning context around it, effectively mimicking relative positioning.
AI 摘要This article is a practical guide to switching from icon fonts to an SVG icon system, walking through how to extract icons from icon font files (e.g., generated with Fontello) and convert them into SVG icons using tools like the Icomoon web app or the font-blast command-line tool. It then covers next steps such as combining the icons into an SVG sprite, embedding them in pages, and styling or animating them, while pointing to further reading on why SVG is superior to icon fonts.
AI 摘要The article explains the 'Flash Of Unstyled SVG' (FOUSVG) problem, where SVGs lacking width and height attributes scale to fill the entire viewport width when CSS fails to load, making pages appear broken. The solution is to keep the width and height presentation attributes on the SVG (for example, by not checking Illustrator's 'Responsive' export option) and instead control dimensions via CSS, since SVG presentation attributes act as low-level author styles that are overridden by any other style declarations and thus serve as fallbacks. The author also emphasizes never removing the viewBox attribute, which is essential for proper SVG scaling, and notes that presentation attributes are useful for providing default styles when reusing elements with and CSS custom properties.
AI 摘要The article argues that animated SVGs are superior to GIFs for images well-suited to vector format, such as icons, logos, and simple illustrations. SVGs offer resolution independence for crisp display at any scale, proper alpha-channel transparency without the halo artifacts caused by GIFs' binary transparency, and smoother, more controllable animations via CSS, JavaScript, or SMIL. Additionally, animated SVGs have dramatically smaller file sizes than GIFs, as illustrated by an example where the SVG was only 0.355KB compared to the GIF's 21.23KB.
AI 摘要This article provides practical tips for designers on creating and exporting cleaner, more optimized SVG code using graphics editors like Adobe Illustrator, so that developers can more easily embed, style, and animate the resulting files. Key recommendations include using simple shape elements instead of paths, weighing the pros and cons of converting text to outlines, simplifying paths, avoiding unnecessary path merging, using SVG filters rather than Photoshop effects, fitting artboards to drawings, and following good naming, grouping, and layering conventions. The article concludes by emphasizing the importance of choosing the most suitable export options for web use.
AI 摘要This is the final article in a series comparing common CSS techniques with their SVG counterparts. Rather than comparing a single solution achievable in both CSS and SVG, it serves as a roundup of multiple solutions, offering an overview of each. The author provides links to existing detailed articles covering these solutions and encourages readers to explore them.
AI 摘要This article, the third in a series comparing CSS and SVG, explores techniques for creating arbitrarily-shaped UI components using CSS properties, SVG capabilities, or a combination of both. It focuses specifically on circular menus as a prime example of functional non-rectangular UI elements.
AI 摘要This article is the second in a series comparing techniques achievable with both CSS and SVG, focusing specifically on styling checkboxes and radio buttons. It demonstrates how these form elements can be customized using both approaches, including creating animated checkboxes with SVG's line drawing capabilities.
AI 摘要This article explains how to create a circular navigation menu using the CSS clip-path property combined with SVG paths. It notes that clip-path is an underused but powerful CSS feature that can produce interesting layouts and animations, and that browser handling of pointer events on clipped regions makes building circular menus fairly straightforward.
AI 摘要This article is the first in a series comparing CSS and SVG techniques for web design problems, aiming to objectively weigh the pros and cons of each despite the author's admitted bias toward SVG. In this first installment, the focus is on graphical text effects, examining the CSS background-clip and mask-image properties alongside SVG pattern fills and masks.
AI 摘要This article explains how to style the contents of the SVG element with CSS, addressing the challenges that arise because the content is cloned into the shadow DOM. It covers the limitations this cloning introduces and demonstrates workarounds that take advantage of the CSS cascade and CSS Variables to gain full control over the styled content. It also provides fallbacks for browsers that don't support CSS Variables.
AI 摘要The author describes developing an SVG infographic for Provata Health's website and explains why they embedded it with the HTML element instead of or : the SVG text needed to remain accessible, selectable, searchable, and serve as a raw text fallback if the graphic failed to load. Since hiding parts of a single SVG via CSS/JavaScript was impractical due to file size, they served separate desktop and mobile SVGs, swapping the object's data attribute with a small inline, non-async script (using Modernizr media queries) so the important graphic would render as quickly as possible. The article concludes by noting that inlining such small scripts can improve load times and suggesting that a -like element for would be a useful HTML extension.
AI 摘要The state of SVG animation is changing, with CSS, SMIL, and JavaScript all offering ways to animate SVGs. However, SMIL is soon to be deprecated and was never supported in Internet Explorer, while CSS animations have inconsistent browser support and are buggy in some browsers. The article reviews the current and future state of SVG animation, explaining what you can and can't do and offering advice on choosing the right tool for your specific animation needs.