Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2921

link-in-text-block

Skill này làm gì

Skill này kiểm tra các link nằm trong nội dung văn bản và đảm bảo chúng rõ ràng về mặt hình ảnh, thường bằng gạch chân. Skill dành cho nhà thiết kế và người xây front-end quan tâm tới khả năng truy cập.

Khi nào nên dùng

  • ✓Khi bạn nhờ agent xem lại kiểu dáng của link trong bài viết hoặc đoạn văn.
  • ✓Khi thiết kế bỏ gạch chân link và bạn muốn kiểm tra chúng có còn dễ thấy không.
  • ✓Khi bạn chuẩn bị trang cho buổi rà soát truy cập và cần xác nhận link không chỉ được nhận biết bằng màu sắc.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/link-in-text-block/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/link-in-text-block/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể kiểm tra xem các link trong bài blog của tôi có dễ phân biệt với phần chữ còn lại không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent xem kiểu dáng link trong các khối văn bản và kiểm tra có gạch chân hoặc độ tương phản màu đủ không. Sau đó báo những link có thể bị bỏ sót và gợi ý cách sửa.

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.

Make links in text blocks visually distinguishable

Approximately 8% of men and 0.5% of women have color vision deficiency (red-green being most common). If links are distinguished only by a color like blue or red, these users may not identify them as links and miss critical navigation or reference information. The underline is a universal, color-independent signal understood across cultures and vision abilities. Removing underlines is a common design trend that disproportionately affects users with low vision and cognitive disabilities.

Quick Reference

  • Color must not be the only visual means of distinguishing links from surrounding text — WCAG 2.1 SC 1.4.1 (Use of Color)
  • Option 1: Underline links (the browser default and most robust approach)
  • Option 2: If no underline, the link color must have ≥ 3:1 contrast ratio against surrounding body text AND ≥ 4.5:1 against the background
  • Focus and hover states must also maintain distinguishability
  • Applies only to links embedded within paragraphs/text blocks; standalone navigation links have different requirements

Check

Find all <a> elements within text-heavy containers (paragraphs, article body, list items containing prose). Check the CSS applied: if text-decoration: none or text-decoration: underline is removed, verify that the link color has at least 3:1 contrast ratio against the surrounding non-link text color AND at least 4.5:1 against the background. Also check :hover and :focus states for a non-color visual change (underline appearing, outline, background change).

Fix

The simplest fix is to restore text-decoration: underline on inline text links within body copy — this is the most widely understood and color-independent link indicator. If the design requires no underline: calculate the contrast between link color and body text color using the WCAG relative luminance formula; it must be ≥ 3:1. Add a non-color visual change on :hover and :focus (e.g., underline appears, font-weight changes, or background-color is added).

Explain

WCAG 2.1 SC 1.4.1 (Use of Color, Level A) states that color must not be the sole visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. For links within text, this means a user who cannot perceive the link color must still be able to identify the link. The WCAG technique G183 specifies that a 3:1 contrast ratio between link and surrounding text, combined with a non-color hover/focus cue, is a sufficient technique. The browser default underline satisfies SC 1.4.1 on its own.

Code Review

Review the rendered markup and interactive states that affect Make links in text blocks visually distinguishable. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/accessibility/link-in-text-block

Câu hỏi thường gặp

Vì sao link cần gạch chân?

Một số người không phân biệt được màu, nên gạch chân là tín hiệu rõ ràng cho thấy đoạn chữ đó là link.

Điều này có áp dụng cho link trong menu không?

Không. Skill nhắm tới link trong đoạn văn, không phải menu điều hướng hoặc link dạng nút.

Tôi có thể bỏ gạch chân không?

Skill chỉ cho phép nếu màu của link có đủ độ tương phản với chữ và nền xung quanh.

Chi tiết

Mô tả gốc của tác giả

Use when applies to hyperlinks (`<a>` elements) that appear inline within paragraphs or text blocks. Does not apply to navigation menus, button-style links, or standalone links that are visually isolated from body text. Use when reviewing CSS that removes text-decoration from inline body copy links.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2921
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự