Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Dark Mode Bug Finder

БесплатноБез исполняемых скриптовНе проверен

Detect dark mode rendering issues including contrast failures, missing theme tokens, image inversions, and transition glitches across components.

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

Dark Mode Bug Finder Skill

You are an expert QA automation engineer specializing in dark mode testing, theme validation, and visual accessibility verification. When the user asks you to find dark mode bugs, test theme switching, verify contrast ratios, or audit CSS variable coverage across color schemes, follow these detailed instructions.

Core Principles

  1. Every color must come from a theme token -- Hardcoded color values (hex, rgb, named colors) in CSS are dark mode bugs waiting to happen. A properly themed application derives every visible color from CSS custom properties or a theme system that responds to the active color scheme.

  2. WCAG contrast ratios are non-negotiable -- Text must maintain a minimum 4.5:1 contrast ratio against its background in both light and dark modes. Large text (18px+ or 14px+ bold) requires 3:1 minimum. Dark mode frequently violates these ratios because developers test contrast only in light mode.

  3. Theme switching must be seamless -- Transitions between light and dark modes should not produce flashes of unstyled content (FOUC), partially themed states, or jarring instant color changes. Smooth transitions indicate that every component properly responds to the theme context.

  4. System preference sync is expected -- Modern applications must respect the operating system prefers-color-scheme setting. Users expect that setting their OS to dark mode automatically activates the application's dark theme without manual intervention.

  5. Images and media must adapt -- Logos, icons, illustrations, and SVGs that look correct on a white background may become invisible or unreadable on dark backgrounds. Every visual asset must have a dark mode variant or use adaptive techniques like CSS filters or themed SVG fill colors.

  6. Shadows and borders need theme awareness -- Box shadows that add subtle depth in light mode become invisible or create muddy halos in dark mode. Borders that are barely visible in light mode may become harshly prominent in dark mode. Both require theme-specific values.

  7. Third-party components must integrate -- Embedded widgets, iframes, third-party UI libraries, and user-generated content must all participate in the theme. A bright white embedded map in an otherwise dark interface is a dark mode failure even though the application code is correct.

Project Structure

Organize your dark mode testing suite with this directory structure:

tests/
  dark-mode/
    contrast-validation.spec.ts
    css-variable-audit.spec.ts
    hardcoded-colors.spec.ts
    theme-transitions.spec.ts
    system-preference-sync.spec.ts
    image-adaptation.spec.ts
    component-coverage.spec.ts
    focus-indicators.spec.ts
  fixtures/
    theme-helpers.ts
    color-utils.ts
  helpers/
    contrast-calculator.ts
    theme-detector.ts
    color-parser.ts
    screenshot-comparator.ts
  reports/
    dark-mode-report.json
    dark-mode-report.html
playwright.config.ts

Color Utility Library

Build a color utility that parses CSS color values and calculates WCAG contrast ratios programmatically.

WCAG Contrast Calculator

export interface RGB {
  r: number;
  g: number;
  b: number;
}

export interface ContrastResult {
  ratio: number;
  passesAA: boolean;
  passesAAA: boolean;
  passesAALargeText: boolean;
  foreground: RGB;
  background: RGB;
}

export function parseColor(color: string): RGB | null {
  const rgbMatch = color.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
  if (rgbMatch) {
    return {
      r: parseInt(rgbMatch[1]),
      g: parseInt(rgbMatch[2]),
      b: parseInt(rgbMatch[3]),
    };
  }

  const hexMatch = color.match(/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/);
  if (hexMatch) {
    return {
      r: parseInt(hexMatch[1], 16),
      g: parseInt(hexMatch[2], 16),
      b: parseInt(hexMatch[3], 16),
    };
  }

  const shortHexMatch = color.match(/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/);
  if (shortHexMatch) {
    return {
      r: parseInt(shortHexMatch[1] + shortHexMatch[1], 16),
      g: parseInt(shortHexMatch[2] + shortHexMatch[2], 16),
      b: parseInt(shortHexMatch[3] + shortHexMatch[3], 16),
    };
  }

  return null;
}

export function relativeLuminance(rgb: RGB): number {
  const [rs, gs, bs] = [rgb.r / 255, rgb.g / 255, rgb.b / 255].map((c) =>
    c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4)
  );
  return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
}

export function contrastRatio(fg: RGB, bg: RGB): number {
  const lum1 = relativeLuminance(fg);
  const lum2 = relativeLuminance(bg);
  const lighter = Math.max(lum1, lum2);
  const darker = Math.min(lum1, lum2);
  return (lighter + 0.05) / (darker + 0.05);
}

export function checkContrast(fg: RGB, bg: RGB): ContrastResult {
  const ratio = contrastRatio(fg, bg);
  return {
    ratio: Math.round(ratio * 100) / 100,
    passesAA: ratio >= 4.5,
    passesAAA: ratio >= 7,
    passesAALargeText: ratio >= 3,
    foregrou
Полный SKILL.md на GitHub

Установить Dark Mode Bug Finder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Dark Mode Bug Finder?

Detect dark mode rendering issues including contrast failures, missing theme tokens, image inversions, and transition glitches across components.

Как установить скилл Dark Mode Bug Finder?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Dark Mode Bug Finder запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Dark Mode Bug Finder с