Skip to content

Conversation

SH20RAJ
Copy link

@SH20RAJ SH20RAJ commented Aug 30, 2025

  • Add outline fallbacks for form controls in high contrast mode
  • Add outline fallbacks for button focus states in high contrast mode
  • Ensure focus indicators remain visible when box-shadow is disabled
  • Include test file demonstrating accessibility improvements

Fixes accessibility issue where focus indicators become invisible in high contrast mode or when users disable box-shadow effects.

Changes:

  • scss/forms/_form-control.scss: Added @media (prefers-contrast: high) with outline fallback
  • scss/_buttons.scss: Added @media (prefers-contrast: high) with outline fallback for focus-visible
  • test-high-contrast-focus.html: Test page demonstrating the improvements

The compiled CSS now includes:

.form-control:focus { /* existing styles */ }
@media (prefers-contrast: high) {
  .form-control:focus { outline: 2px solid; outline-offset: 2px; } }

.btn:focus-visible { /* existing styles */ }
@media (prefers-contrast: high) {
  .btn:focus-visible { outline: 2px solid; outline-offset: 2px; } }

Description

Motivation & Context

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would change existing functionality)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Live previews

Related issues

- Add outline fallbacks for form controls in high contrast mode
- Add outline fallbacks for button focus states in high contrast mode
- Ensure focus indicators remain visible when box-shadow is disabled
- Include test file demonstrating accessibility improvements

Fixes accessibility issue where focus indicators become invisible
in high contrast mode or when users disable box-shadow effects.

Changes:
- scss/forms/_form-control.scss: Added @media (prefers-contrast: high) with outline fallback
- scss/_buttons.scss: Added @media (prefers-contrast: high) with outline fallback for focus-visible
- test-high-contrast-focus.html: Test page demonstrating the improvements

The compiled CSS now includes:
.form-control:focus { /* existing styles */ }
@media (prefers-contrast: high) {
  .form-control:focus { outline: 2px solid; outline-offset: 2px; }
}

.btn:focus-visible { /* existing styles */ }
@media (prefers-contrast: high) {
  .btn:focus-visible { outline: 2px solid; outline-offset: 2px; }
}
@SH20RAJ SH20RAJ requested a review from a team as a code owner August 30, 2025 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants