MDN Web Docs

6K posts

MDN Web Docs banner
MDN Web Docs

MDN Web Docs

@MozDevNet

The official MDN Web Docs account. We deliver the best web docs around.

Worldwide انضم Mart 2013
930 يتبع48.1K المتابعون
تغريدة مثبتة
MDN Web Docs
MDN Web Docs@MozDevNet·
MDN is 20 years old! 🥳 🙏 A huge thank you to... The devs who read and trust MDN The contributors who improve it Everyone working on the web platform who shares our mission. Here's how we celebrated with the web.dev team! 🧁 developer.mozilla.org/en-US/blog/mdn…
English
8
67
286
18.5K
MDN Web Docs
MDN Web Docs@MozDevNet·
🆕 The URL Pattern API is Newly Available! Use it to match and extract parts of URLs, no need to reinvent routing logic. Supports literals, wildcards, named groups, and even regex constraints. Learn how it works 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
0
16
143
3.7K
MDN Web Docs
MDN Web Docs@MozDevNet·
📬 Check own properties safely with Object.hasOwn() A safer alternative to hasOwnProperty, works even on objects with a null prototype. Baseline since 2022 ✅ Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
1
10
124
3.8K
Heath
Heath@cyral_·
@Michaili_K @tiredortired @MozDevNet This is what the mdn tweet should have said, because it’s not “zero effort”. The big catch is you need to know the size, which may not be feasible with responsive content or text that is dynamic
English
1
0
2
24
MDN Web Docs
MDN Web Docs@MozDevNet·
Speed up rendering with content-visibility: auto ⚡ This CSS property skips rendering off-screen content until needed, giving massive performance wins on long pages. ⋅ Pairs with contain-intrinsic-size ⋅ Zero-effort lazy rendering Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
2
49
531
27.9K
MDN Web Docs
MDN Web Docs@MozDevNet·
Maintain perfect proportions with CSS aspect-ratio 📍 No more padding-top hacks for 16:9 videos or square avatars. aspect-ratio: 16 / 9; ⋅ Works with any box model ⋅ Respects min/max dimensions ⋅ Baseline since 2021 ✅ Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
1
8
109
3.5K
MDN Web Docs
MDN Web Docs@MozDevNet·
React to element size changes, not just the window 📐 `ResizeObserver` fires when any element's dimensions change, perfect for responsive components. ⋅ Observe padding box, content box, or border box ⋅ Works with dynamic DOM changes Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
0
19
151
5.2K
Duncan McAlester
Duncan McAlester@duncanmcalester·
@MozDevNet Flash? Now, that's a name I've not heard in a long time. A long time.
English
1
0
0
46
MDN Web Docs
MDN Web Docs@MozDevNet·
Read and write to the clipboard with the modern Clipboard API 📋 async/await, permission-aware, and way cleaner than execCommand. ⋅ Supports text, HTML, and images ⋅ Works in secure contexts (HTTPS) ⋅ No Flash. No hacks. Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
5
24
246
6.1K
MDN Web Docs
MDN Web Docs@MozDevNet·
Format numbers correctly for any locale, no npm package needed 🌍 `Intl.NumberFormat` handles currencies, percentages, units, and compact notation. Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
0
15
170
4.4K
MDN Web Docs
MDN Web Docs@MozDevNet·
Control animations with JavaScript 🎬 The Web Animations API gives you programmatic control over CSS animations. ⋅ Play, pause, reverse, and seek ⋅ Read animated values in real time ⋅ Combines well with scroll-driven animations Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
1
9
131
4.1K
MDN Web Docs
MDN Web Docs@MozDevNet·
🆕 CSS Anchor Positioning is Newly Available! Position tooltips, dropdowns, and floating elements relative to any anchor, without JavaScript. ⋅ anchor-name on the reference element ⋅ position-anchor on the floating element Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
0
27
193
4.7K
MDN Web Docs
MDN Web Docs@MozDevNet·
Cancel fetch requests and async operations cleanly ✋ `AbortController` gives you a signal to pass to fetch(), event listeners, and other async APIs. ⋅ Use AbortSignal.timeout() for timeouts ⋅ Composable with AbortSignal.any() Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
2
17
277
44.7K
MDN Web Docs
MDN Web Docs@MozDevNet·
Better error chaining is finally in JavaScript 🔗 `Error.cause` lets you attach the original error when rethrowing, keeping full context without losing the stack. Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
6
61
628
35K
MDN Web Docs
MDN Web Docs@MozDevNet·
Generate cryptographically secure UUIDs in the browser 🔐 `crypto.randomUUID()` is built into the Web Crypto API, no npm package needed. Works in all modern browsers and Node.js 14.17+. Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
6
43
428
19K
MDN Web Docs
MDN Web Docs@MozDevNet·
🆕 The Popover API is Baseline, no JavaScript needed Tooltips, dropdowns, and menus with just HTML attributes. ⋅ popover attribute on any element ⋅ popovertarget to wire the trigger ⋅ Accessible by default, no ARIA hacks Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
6
59
518
21K
MDN Web Docs
MDN Web Docs@MozDevNet·
Eliminate awkward text wrapping with one CSS property 📝 text-wrap: balance distributes text evenly across lines — no more single-word orphans in headings. ⋅ Perfect for headlines and cards ⋅ Zero JavaScript needed ⋅ Widely supported ✅ Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
0
11
101
3.3K
MDN Web Docs
MDN Web Docs@MozDevNet·
Need the last matching item in an array? 🔍 `findLast()` and `findLastIndex()` search from the end, no more reversing arrays just to find the last match. const lastActive = users.findLast(u => u.active); Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
1
10
119
4K
MDN Web Docs
MDN Web Docs@MozDevNet·
Keep the screen on with the Screen Wake Lock API 🔒 Prevent devices from sleeping during active tasks, like video playback, presentations, or navigation. Learn more 👇 developer.mozilla.org/en-US/docs/Web…
MDN Web Docs tweet media
English
1
19
206
6.9K