mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-19 09:36:59 +03:00
Remove small-target detection (too aggressive for regular links)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
122dddb686
commit
1260c2350e
@@ -169,12 +169,6 @@ const ANTIPATTERNS = [
|
||||
description:
|
||||
'Line height below 1.3x the font size makes multi-line text hard to read. Use 1.5 to 1.7 for body text so lines have room to breathe.',
|
||||
},
|
||||
{
|
||||
id: 'small-target',
|
||||
name: 'Small touch target',
|
||||
description:
|
||||
'Interactive elements should be at least 44x44px to be comfortably tappable. Small targets cause misclicks and frustrate users, especially on touch devices.',
|
||||
},
|
||||
{
|
||||
id: 'skipped-heading',
|
||||
name: 'Skipped heading level',
|
||||
@@ -767,7 +761,6 @@ function checkElementAIPaletteDOM(el) {
|
||||
}
|
||||
|
||||
const QUALITY_TEXT_TAGS = new Set(['p', 'li', 'td', 'th', 'dd', 'blockquote', 'figcaption']);
|
||||
const QUALITY_INTERACTIVE_TAGS = new Set(['button', 'a', 'input', 'select', 'textarea']);
|
||||
|
||||
function checkElementQualityDOM(el) {
|
||||
const tag = el.tagName.toLowerCase();
|
||||
@@ -829,14 +822,6 @@ function checkElementQualityDOM(el) {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Small touch targets ---
|
||||
if (QUALITY_INTERACTIVE_TAGS.has(tag) || el.hasAttribute('tabindex') || el.getAttribute('role') === 'button') {
|
||||
if (rect.width > 0 && rect.height > 0 && (rect.width < 44 || rect.height < 44)) {
|
||||
if (style.display !== 'none' && style.visibility !== 'hidden') {
|
||||
findings.push({ id: 'small-target', snippet: `${Math.round(rect.width)}x${Math.round(rect.height)}px (need 44x44)` });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Justified text (without hyphens) ---
|
||||
if (hasDirectText && style.textAlign === 'justify') {
|
||||
|
||||
@@ -167,12 +167,6 @@ const ANTIPATTERNS = [
|
||||
description:
|
||||
'Line height below 1.3x the font size makes multi-line text hard to read. Use 1.5 to 1.7 for body text so lines have room to breathe.',
|
||||
},
|
||||
{
|
||||
id: 'small-target',
|
||||
name: 'Small touch target',
|
||||
description:
|
||||
'Interactive elements should be at least 44x44px to be comfortably tappable. Small targets cause misclicks and frustrate users, especially on touch devices.',
|
||||
},
|
||||
{
|
||||
id: 'skipped-heading',
|
||||
name: 'Skipped heading level',
|
||||
@@ -765,7 +759,6 @@ function checkElementAIPaletteDOM(el) {
|
||||
}
|
||||
|
||||
const QUALITY_TEXT_TAGS = new Set(['p', 'li', 'td', 'th', 'dd', 'blockquote', 'figcaption']);
|
||||
const QUALITY_INTERACTIVE_TAGS = new Set(['button', 'a', 'input', 'select', 'textarea']);
|
||||
|
||||
function checkElementQualityDOM(el) {
|
||||
const tag = el.tagName.toLowerCase();
|
||||
@@ -827,14 +820,6 @@ function checkElementQualityDOM(el) {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Small touch targets ---
|
||||
if (QUALITY_INTERACTIVE_TAGS.has(tag) || el.hasAttribute('tabindex') || el.getAttribute('role') === 'button') {
|
||||
if (rect.width > 0 && rect.height > 0 && (rect.width < 44 || rect.height < 44)) {
|
||||
if (style.display !== 'none' && style.visibility !== 'hidden') {
|
||||
findings.push({ id: 'small-target', snippet: `${Math.round(rect.width)}x${Math.round(rect.height)}px (need 44x44)` });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Justified text (without hyphens) ---
|
||||
if (hasDirectText && style.textAlign === 'justify') {
|
||||
|
||||
Reference in New Issue
Block a user