Free Frontend Tutorials

Master the Web. One Tutorial at a Time.

Deep-dive tutorials on CSS, JavaScript, HTML, and AI-powered frontend — written for developers who want to level up fast and build better things.

Latest Articles
Browse all →
CSS :focus-visible: Keyboard Focus, WCAG & inert
CSS
23 min
Jun 12, 2026
CSS :focus-visible: Keyboard Focus, WCAG & inert
Removing outline:none without a replacement is one of the most common accessibility failures on the web. CSS :focus-visible shows a focus ring for keyboard users and hides it for mouse clicks — but most tutorials stop there. This 2026 guide adds the sticky-header scroll-padding-top trap, modern inert and <dialog> focus management, the :has(:focus-visible) modern keyboard-only parent highlight, accent-color for native form focus, why tap on mobile doesn't show a focus ring, cross-browser heuristic differences, and the WICG polyfill for legacy browsers.
W
W3Tweaks Team
Web Share API: navigator.share, Files & Fallbacks
HTML
22 min
Jun 12, 2026
Web Share API: navigator.share, Files & Fallbacks
navigator.share looks trivial — one method, a native share sheet. But it rejects with AbortError when the user simply cancels (which most tutorials mis-handle as a failure), canShare gives false positives for unknown keys, an await before share() can break it entirely, the text+url combination produces duplicate links on WhatsApp/X, Permissions-Policy headers can block it in iframes, Next.js/Astro break at build with ReferenceError, and PWA share-target file receivers need a 303 redirect in the service worker. This 2026 guide covers all of it.
W
W3Tweaks Team
HTML5 Video Custom Controls: Media API, Captions & PiP
HTML
22 min
Jun 11, 2026
HTML5 Video Custom Controls: Media API, Captions & PiP
Most HTML5 video tutorials build a played-progress bar and stop. They skip the buffered bar (TimeRanges), the textTracks captions API, ::cue styling, Picture-in-Picture, the Media Session API that handles Bluetooth headphone play/pause and lock-screen artwork, the playsinline iOS bug that breaks every custom player, autoplay policy detection, codec selection with the source media attribute, MediaError handling, and the modern MediaCapabilities + requestVideoFrameCallback APIs. This 2026 guide covers all of it.
W
W3Tweaks Team
CSS @supports: Feature Detection & Progressive Enhancement
CSS
17 min
Jun 11, 2026
CSS @supports: Feature Detection & Progressive Enhancement
CSS @supports is pure CSS feature detection — no JavaScript, no Modernizr. The modern Modernizr alternative is built into CSS itself. This 2026 guide covers @supports examples, the not/and/or operators, the selector() function (with the empty :has() gotcha), at-rule() for detecting @layer and @scope, Tailwind's supports-[] arbitrary variant, OKLCH and View Transitions detection, @supports inside @container for component-scoped gating, the double-negation parser quirk, and the CSS.supports() JavaScript API.
W
W3Tweaks Team
structuredClone: JavaScript Deep Copy (Stop JSON.parse)
JavaScript
21 min
Jun 11, 2026
structuredClone: JavaScript Deep Copy (Stop JSON.parse)
Most deep-copy guides stop at structuredClone vs JSON. This 2026 update covers what every competitor skips: the structuredClone is not defined polyfill for Node 16 / Jest / jsdom, Symbol-keyed properties silently dropped, property descriptors collapsing to plain values, why Immer or Mutative is the right choice for React state (NOT structuredClone), ES2023 non-mutating array methods that replace most clone calls, concrete 1KB/100KB/1MB benchmarks, and WinterCG runtime parity across Node, Bun, Deno, and Cloudflare Workers.
W
W3Tweaks Team
AbortController: Cancel Fetch Properly (With Live Demo)
JavaScript
20 min
Jun 10, 2026
AbortController: Cancel Fetch Properly (With Live Demo)
How to cancel a fetch request properly in 2026 — with a live search-race demo. Type fast and watch stale requests get cancelled in real time. Covers AbortController vs AbortSignal, debounce+abort for autocomplete, AbortSignal.timeout() one-liners, AbortSignal.any() composition, AbortSignal.throwIfAborted(), React useEffect cleanup, the single-use trap, custom abort reasons, memory leaks with abort listeners, and the libraries (TanStack Query, SWR, Axios, ky) that handle signals automatically.
W
W3Tweaks Team
Native Lazy Loading: When loading=lazy Silently Fails
HTML
23 min
Jun 10, 2026
Native Lazy Loading: When loading=lazy Silently Fails
loading=lazy looks foolproof — one attribute, defer offscreen images. But it produces no error when it fails. It silently delays your LCP if applied to the hero, does nothing on CSS backgrounds, causes layout shift without dimensions, hides images from Googlebot when paired with data-src libraries, and gets overridden silently by preload directives. Six silent failures plus WordPress auto-lazy, framework auto-lazy defaults, content-visibility, fetchpriority=low, NoScript fallback, AdSense iframes, and the picture+srcset+lazy combined pattern.
W
W3Tweaks Team
CSS Dark Mode: prefers-color-scheme, light-dark, OKLCH
CSS
19 min
Jun 10, 2026
CSS Dark Mode: prefers-color-scheme, light-dark, OKLCH
The complete 2026 CSS dark mode guide — prefers-color-scheme media query, the new light-dark() function with the color-scheme gotcha, OKLCH tokens with color-mix() for perceptual lightness scaling, Material 3 surface elevation, View Transitions API for the toggle animation, the SSR/SSG FOUC fix matrix (Next.js cookie pattern), Windows High Contrast Mode survival with forced-colors, meta theme-color for mobile chrome, Tailwind v4 @custom-variant dark, and cross-tab sync.
W
W3Tweaks Team
Responsive Images & Modern Formats: AVIF, WebP, JXL Guide
HTML
22 min
Jun 9, 2026
Responsive Images & Modern Formats: AVIF, WebP, JXL Guide
The complete 2026 responsive images guide — AVIF vs WebP file sizes, where JPEG XL stands now (Chrome 145 flag + Safari 17 default + Firefox 152 pref), the picture element with srcset and sizes done right, the 100vw sizes mistake that doubles your downloads, fetchpriority for LCP with decoding=async, placeholder strategies (BlurHash vs ThumbHash), CSS image-set for backgrounds, and the image CDN auto-format pattern that skips picture entirely.
W
W3Tweaks Team