viewport-zoom
Skill này làm gì
Skill này kiểm tra thẻ meta viewport xem có cài đặt nào chặn phóng to không. Nó dành cho lập trình viên và người làm template muốn trang di động vẫn dễ tiếp cận.
Khi nào nên dùng
- ✓Khi thẻ meta viewport của trang chứa user-scalable=no.
- ✓Khi trang đặt maximum-scale bằng 1 hoặc một giá trị thấp khác.
- ✓Khi một template hoặc framework CSS đã thêm cài đặt chặn phóng to.
Liên kết skill
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/viewport-zoom/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Website di động của chúng tôi không cho phép chụm để phóng to. Bạn có thể kiểm tra cài đặt viewport không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc thẻ meta viewport và đánh dấu các cài đặt chặn phóng to. Nó thay chúng bằng cài đặt chuẩn width và initial-scale.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Do not disable pinch zoom
Pinch-to-zoom is an essential accessibility feature for low-vision users who cannot read text at the page's default size. When zoom is disabled, these users cannot enlarge text or images, making the page completely inaccessible without external magnification software. Low-vision users who rely on browser zoom are entirely blocked. Additionally, all users benefit from being able to zoom in on small text, fine-print, or complex images. Disabling zoom is one of the most harmful and easily preventable accessibility failures.
Quick Reference
- Never use
user-scalable=nooruser-scalable=0in the viewport meta tag - Never set
maximum-scale=1(or any value below 5) in the viewport meta tag - Both prevent pinch-to-zoom, violating WCAG 2.1 SC 1.4.4 (Resize Text, Level AA)
- The correct viewport meta tag is:
<meta name='viewport' content='width=device-width, initial-scale=1'> - Note: iOS 10+ ignores
user-scalable=noin Safari, but other browsers and older iOS do not
Check
Find the <meta name='viewport'> element in the HTML <head>. Check its content attribute for: (1) user-scalable=no — disables all zoom; (2) user-scalable=0 — same effect; (3) maximum-scale=1 or maximum-scale=1.0 — limits zoom to the initial scale; (4) any maximum-scale value below 2 — significantly limits zoom range. Flag any of these. Also check CSS for touch-action: none or user-zoom: fixed (CSS Device Adaptation, rarely used) that may limit zoom.
Fix
Remove user-scalable=no and maximum-scale=1 from the viewport meta tag. The correct viewport meta tag for a responsive site is: <meta name='viewport' content='width=device-width, initial-scale=1'>. If maximum-scale was set for a specific reason (e.g., to prevent unintended zoom on input focus on iOS), the correct fix is to set form input font-size: 1rem (16px) instead — iOS Safari only auto-zooms on input focus when font-size is below 16px.
Explain
WCAG 2.1 SC 1.4.4 (Resize Text, Level AA) requires that text can be resized up to 200% without loss of content or functionality, except for captions and images of text. On mobile devices, pinch-to-zoom and the browser's built-in text size settings are the primary mechanisms for resizing text. Setting user-scalable=no or maximum-scale=1 in the viewport meta tag disables pinch-to-zoom entirely (or limits it to 1x), preventing low-vision users from enlarging content. This is a direct violation of SC 1.4.4. While iOS 10+ Safari ignores these settings, Android browsers, Chrome for iOS, and older iOS versions do not — so the setting must be removed regardless.
Code Review
Review stylesheets, component styles, and responsive states related to Do not disable pinch zoom. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/viewport-zoom
Câu hỏi thường gặp
Cài đặt viewport nào là đúng?
Skill khuyến nghị width=device-width, initial-scale=1.
iPhone có bỏ qua user-scalable=no không?
Skill cho biết iOS 10 trở lên bỏ qua nó trong Safari, nhưng các trình duyệt khác và phiên bản iOS cũ hơn vẫn tuân theo.
Việc phóng to liên quan tới tiêu chuẩn nào?
Skill dẫn tiêu chí thành công 1.4.4 của WCAG 2.1 về thay đổi kích thước chữ.
Chi tiết
Mô tả gốc của tác giả
Use when applies to any `<meta name='viewport'>` element in HTML documents. Check the `content` attribute for `user-scalable=no`, `user-scalable=0`, `maximum-scale=1`, or `maximum-scale` values less than 2. This is a common mistake in mobile-first templates and CSS frameworks.
Độ phổ biến
- Sao GitHub
- 75k
- Vị trí xếp hạng
- #3078
- Giấy phép
- MIT
- Cập nhật
- 31/10/2026
Bình luận
- …
Thêm skill từ kho mã này
frontendchecklist
75kKiểm tra mã frontend và trang trực tiếp theo hơn 380 quy tắc về khả năng tiếp cận, tốc độ, SEO và bảo mật, bằng một công cụ dòng lệnh.
frontend-checklist-global
75kKiểm toán một dự án frontend theo đủ 386 quy tắc của Front-End Checklist, và đưa cách sửa cụ thể cho từng vấn đề tìm thấy.
404-page
75kKiểm tra xem trang báo thiếu của bạn có đưa ra các liên kết hữu ích và trả về mã trạng thái 404 thật hay không, để giúp khách bị lạc tìm đường.
about-page
75kKiểm tra xem trang web có trang Giới thiệu rõ ràng giải thích ai điều hành nó hay không, để xây dựng niềm tin với khách và công cụ tìm kiếm.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.