Appearance
Focus Indicator Tool
Overview
The Focus Indicator tool enhances keyboard navigation by providing clear, high-contrast visual indicators for focused elements. It replaces subtle browser default focus indicators with prominent focus outlines that are easily visible to all users.
Features
- Enhanced Visibility: High-contrast blue focus indicators that stand out on any background
- Universal Coverage: Applies to all focusable elements including links, buttons, and form controls
- WCAG Compliant: Meets accessibility guidelines for focus indicator visibility
- Dark Mode Support: Automatically adjusts colors for dark mode environments
- Keyboard Navigation: Essential for users who navigate with keyboard or assistive devices
Settings
| Level | Description |
|---|---|
| Disabled | Browser default focus indicators |
| Enabled | Enhanced high-contrast blue focus indicators with improved visibility |
Usage
- Click the Focus Indicator button in the accessibility toolbar
- Enhanced focus indicators are immediately applied to all focusable elements
- Use Tab key to navigate and see the improved focus visibility
- Click the button again to return to browser default indicators
Accessibility Benefits
- Keyboard Navigation: Essential for users who cannot use a mouse
- Visual Clarity: Makes focused elements clearly visible on any background
- Motor Impairments: Helps users with limited motor control identify current focus
- Cognitive Support: Reduces confusion about which element is currently selected
- Screen Reader Users: Provides visual confirmation for sighted screen reader users
- Low Vision: High contrast indicators are easier to see for users with visual impairments
Focus Styles
Enhanced Indicators
- Blue Outline: 3px solid blue (#2196f3) outline for high visibility
- Outline Offset: 3px offset from element for clear separation
- Shadow Effect: Blue shadow (rgba(33, 150, 243, 0.4)) for additional emphasis
- Dark Mode: Light blue (#90caf9) outline and shadow for dark themes
Element Coverage
- Links: Text links and navigation elements
- Buttons: All button types and interactive controls
- Form Fields: Input fields, textareas, and select boxes
- Custom Elements: Interactive components and widgets
Technical Implementation
The tool applies CSS classes to the HTML element using !important declarations to override existing focus styles:
- Light Mode: Blue outline (#2196f3) with matching shadow
- Dark Mode: Light blue outline (#90caf9) with matching shadow
- Consistent Application: All focusable elements receive the same styling
API Usage Example
The Focus Indicator tool can be programmatically controlled using the widget API:
javascript
// Enable the focus indicator tool
window.BrowseAidWidget.api.enableTool('focus-indicator');
// Toggle the tool on/off
const isEnabled = window.BrowseAidWidget.api.toggleTool('focus-indicator');
console.log('Focus Indicator is now:', isEnabled ? 'enabled' : 'disabled');
// Get current settings
const settings = window.BrowseAidWidget.api.getToolState('focus-indicator');
console.log('Current Focus Indicator settings:', settings);
// Disable the tool
window.BrowseAidWidget.api.disableTool('focus-indicator');
// Listen for tool changes
const unsubscribe = window.BrowseAidWidget.api.onToolChange((toolName, settings) => {
if (toolName === 'focus-indicator') {
console.log('Focus Indicator settings changed:', settings);
}
});Configuration Options
| Option | Type | Values | Default | Description |
|---|---|---|---|---|
enabled | boolean | true/false | false | Enables or disables the tool |
Current Implementation Notes
The Focus Indicator tool currently provides:
- Fixed Styling: Predefined blue focus indicators that cannot be customized
- Binary Control: Simple enable/disable functionality
- Automatic Dark Mode: Adjusts colors based on dark mode setting
- Universal Application: Applies to all focusable elements consistently
Future versions may include customization options for color, thickness, and style preferences.