Keyboard Accessibility Tester – Online Check Tab Order
Paste HTML snippet and see calculated tab order. Identify missing focusable elements. A11y helper.
UD5 Toolkit
Online emulator for testing CSS prefers-contrast media query — simulate high & low contrast modes without changing your OS settings.
This paragraph demonstrates how body text renders under the current contrast mode. Text should remain legible and comfortable to read across all contrast preferences.
Secondary text like captions, footnotes, and helper descriptions — these need special attention in low-contrast modes.
/* Default styles (no preference) */
body {
color: #1e293b;
background: #ffffff;
}
/* High contrast mode */
@media (prefers-contrast: more) {
body {
color: #000;
background: #fff;
border-color: #000;
}
a { color: #0000ee; text-decoration: underline; }
button { border: 2px solid #000; }
}
/* Low contrast mode */
@media (prefers-contrast: less) {
body {
color: #6b7280;
background: #f9fafb;
border-color: #e5e7eb;
}
}
// Detect contrast preference
const moreContrast = window.matchMedia(
'(prefers-contrast: more)'
);
const lessContrast = window.matchMedia(
'(prefers-contrast: less)'
);
if (moreContrast.matches) {
console.log('High contrast preferred');
}
// Listen for changes in real-time
moreContrast.addEventListener('change', (e) => {
if (e.matches) {
applyHighContrastTheme();
}
});
Combine prefers-contrast with prefers-color-scheme for comprehensive accessibility support.
In Windows High Contrast Mode, forced-colors: active also applies. Use both queries for full coverage.
Supported in Chrome 96+, Firefox 101+, Edge 96+, Safari 15+. ~92% global coverage as of 2025.
prefers-contrast is a CSS media query that detects the user's system-level contrast preference. It allows websites to adapt their visual presentation based on whether the user prefers more contrast (high contrast), less contrast (low contrast), or has no preference. This is part of the CSS Media Queries Level 5 specification and is crucial for accessibility — particularly for users with visual impairments who rely on high contrast to perceive content clearly.
no-preference — The user has not expressed any contrast preference. This is the default.more — The user prefers higher contrast. On Windows, this corresponds to High Contrast Mode. On macOS, it aligns with "Increase Contrast" in Accessibility settings.less — The user prefers lower contrast. Some users find high contrast fatiguing and prefer softer visual distinctions.custom — The user has a custom contrast scheme (rare; primarily used with forced-colors on Windows).window.matchMedia() to query the contrast preference. You can check the current value and also listen for real-time changes when the user adjusts their system settings:
const mq = window.matchMedia('(prefers-contrast: more)');
if (mq.matches) { /* apply high contrast */ }
mq.addEventListener('change', (e) => {
if (e.matches) { /* switched to high contrast */ }
});
prefers-contrast: more — Indicates the user wants higher contrast. The website still controls the color palette but should ensure sufficient contrast ratios.forced-colors: active — Indicates a forced color palette is applied by the OS (e.g., Windows High Contrast Mode). The browser overrides many author styles with system colors like CanvasText, Canvas, ButtonFace, etc. Use both queries together for maximum compatibility in accessibility scenarios.
Global browser coverage is approximately 92% as of early 2025. Always provide a sensible default fallback for unsupported browsers.
more mode, increase border widths and use solid outlines for focus indicators.@media (prefers-contrast: more) and (prefers-color-scheme: dark) for fine-grained control.gnome-tweaks for advanced options.@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
/* High contrast + dark mode */
body { color: #fff; background: #000; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {
/* High contrast + light mode */
body { color: #000; background: #fff; }
}
This approach creates 4 distinct themes (light/dark × normal/high-contrast) for comprehensive coverage.
prefers-contrast: more helps meet these criteria when users explicitly request higher contrast. Conversely, prefers-contrast: less serves users who find maximum contrast uncomfortable — a valid accessibility need recognized by WCAG's flexibility principle. Always ensure your less mode still meets at least the AA minimum.
prefers-contrast. Update your browser.forced-colors: active but may not always set prefers-contrast: more depending on the OS version. On Windows 11, both are typically set together.more, less, and custom.chrome://flags or about:config.
less mode, maintain at least 4.5:1 for body text.Paste HTML snippet and see calculated tab order. Identify missing focusable elements. A11y helper.
Paste media queries and see a visual indicator of which rules apply at current viewport size.
Paste HTML and see the order in which elements would receive focus via Tab key. Highlight issues. Local accessibility testing.
Enter HTML with aria-labels and see what a screen reader would announce. Simulates common patterns. Local educational tool.
Write and run simple Sinclair BASIC programs in a browser-based ZX Spectrum emulator. Load demo programs and experience 80s computing. Educational fun.
Paste HTML and detect elements with aria‑hidden='true' that contain focusable children. An easy a11y win to fix.
Open a modal and see how focus is trapped and restored. Copy the lightweight focus‑trap code. Accessible pattern.
Write a media query and see if it matches as you resize the iframe. Understand width, height, and resolution queries.
See your website inside iframes at multiple breakpoints simultaneously. Side‑by‑side responsive testing.
Build a CSS media query by selecting feature, operator, and value. Copy the exact syntax for your stylesheet.
Paste a website's HTML and see which text is only visible to screen readers (e.g., .sr‑only). Preview the accessible layer.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
See the roving tabindex pattern in action. Use arrow keys to navigate a list. Copy the accessible JavaScript pattern.
Paste a media query and instantly check for syntax errors. See if it's correctly formed. Quick developer tool.
Toggle between full and reduced motion on a live animated page. See how to design for vestibular disorders. Educational.
Design a custom focus indicator with outline, offset, and box‑shadow. Preview on interactive elements. Copy the CSS.
Compare :focus and :focus‑visible styling. See which one applies when using mouse vs. keyboard. Accessible focus management.
View all CSS system colors (Canvas, ButtonFace, GrayText) as swatches. Click to copy. For forced‑colors adaptation.
Simulate forced‑colors mode and see how your site looks. Adjust CSS system colors. Make your design accessible.
Simulate reduced motion preference and test your animations. Copy the media query snippet. Keep your users safe.
Write a media query and instantly see if it matches your current viewport. Width, height, orientation, and more.
Simulate a full‑page screenshot by stitching screen captures (limited). Works best on simple pages. Use browser’s native capture.
Preview any website inside emulated device viewports (iPhone, iPad, various resolutions). No screenshot, live interaction in an iframe. Local tool.