Responsive images with srcset and sizes, explained
srcset lists your image files, sizes says how wide the image is shown, and the browser picks the smallest sharp file. Worked examples, common layouts and the new sizes="auto".
The Refract Journal
Practical articles on CSS, interface design and image optimisation, written for people who build websites.
srcset lists your image files, sizes says how wide the image is shown, and the browser picks the smallest sharp file. Worked examples, common layouts and the new sizes="auto".
Photos can carry your GPS location, dates and camera serial numbers. Here is what EXIF reveals, where it gets shared, and how to remove it on Windows, Mac, iPhone and Android.
BlurHash, LQIP, gradients or a single colour: how each image placeholder works, what it costs, and how to use them without layout shift.
Convert TTF and OTF fonts to WOFF2 and subset them to the characters you use, often cutting a text font to 15–30 KB. Formats, @font-face, unicode-range and the licence check.
Every social media image size you need in 2026 for Instagram, Facebook, X, LinkedIn, YouTube, Pinterest and TikTok, plus the safe areas and export settings that keep them sharp.
A squircle is a rounded square with corners that ease into the edges. Here is how to make one in CSS with corner-shape, an SVG mask or clip-path, and how much smoothing to use.
One variable font file can replace a whole family. Here is how the weight, width, slant and optical size axes map to CSS, how to declare them in @font-face, and how to set custom axes without the inheritance trap.
Grain gives flat gradients a tactile, printed feel and hides colour banding. Here is how to add it with an SVG feTurbulence filter, a pseudo-element and the right blend mode.
CSS has no mesh gradient function, but layered radial gradients get you the same soft, flowing look in a few hundred bytes. Here is how they work, how to pick colours, and how to animate them.
Enjoying Refract Tools? ☕️
Refract is a personal project built to make design and development a little easier, with practical, intuitive tools that help you work smarter, without AI doing the work for you.
If you find the tools useful, consider buying me a coffee. Every bit of support helps me keep building, improving, and sharing more free tools with the community.
Thanks for being here! ❤️
Buy me a coffee