Skip to content
Merged
Prev Previous commit
Next Next commit
Add browser support considerations to code guidelines (mdn#41577)
  • Loading branch information
pepelsbey authored Oct 19, 2025
commit 3a42aa04436e17eaa1f46b77859c71d0dd3dc0f8
5 changes: 5 additions & 0 deletions files/en-us/mdn/writing_guidelines/code_style_guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Some more general guidelines include:
- Don't use deprecated features for brevity (such as presentation elements like {{HTMLElement("big")}} or {{domxref("Document.write", "document.write()")}}); do it correctly.
- In the case of API demos, if you are using multiple APIs together, point out which APIs are included and which features come from where.

### Browser support

When creating code examples for a technology that's not yet available in all major browsers, consider using [feature detection](/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection) to fall back to a simpler behavior or inform the user that their browser is not yet supported.
Do not specify supported browsers and their versions in code comments or prose, as this information quickly becomes outdated.

## MDN code style and formatting

Opinions on correct indentation, whitespace, and line lengths have always been controversial. Discussions on these topics are a distraction from creating and maintaining content.
Expand Down