Version: 0.1.01.0.01.0.11.1.01.2.01.3.01.3.11.4.01.5.01.6.01.7.01.8.01.9.01.10.01.11.01.11.11.12.01.13.01.14.01.15.01.16.01.17.01.17.11.18.01.19.01.20.01.21.01.22.01.23.01.23.11.24.01.25.01.25.11.26.01.27.01.28.01.29.01.30.01.31.01.32.01.33.01.34.01.34.11.35.01.35.11.35.21.35.31.35.41.35.51.35.71.36.01.36.11.37.01.37.11.38.01.39.01.40.02.0.0-beta.12.0.0-beta.22.0.0-beta.32.0.0-rc.12.0.0-rc.22.0.0-rc.32.0.0-rc.42.0.02.0.12.1.12.2.02.2.12.3.13.0.0-beta.03.0.0-beta.13.0.0-rc.03.0.0-rc.13.0.03.0.13.1.03.2.03.3.03.4.03.5.03.5.13.6.03.6.13.7.03.8.03.9.03.10.03.11.03.12.03.13.03.14.03.14.13.15.03.15.13.16.03.16.23.17.03.17.13.17.23.18.03.18.13.19.03.19.13.20.03.21.03.22.03.22.13.22.23.22.33.23.03.23.13.24.03.25.03.26.03.26.13.27.03.28.03.28.13.28.23.29.03.30.03.30.13.31.03.32.03.32.13.33.03.34.03.34.13.35.03.36.03.37.03.38.03.38.13.38.23.39.03.40.03.40.13.41.03.42.03.43.03.44.03.44.13.44.23.44.33.45.03.46.03.47.03.48.03.49.03.49.13.50.03.50.13.50.23.50.33.50.43.51.03.51.13.51.23.51.33.52.03.53.03.54.04.0.0-alpha.04.0.0-beta.04.0.0-beta.14.0.0-beta.24.0.0-beta.34.0.0-beta.44.0.0-beta.54.0.0-beta.64.0.0-beta.74.0.0-beta.84.0.0-beta.94.0.0-beta.104.0.0-beta.114.0.0-beta.124.0.0-beta.134.0.0-beta.144.0.0-beta.154.0.0-rc.04.0.0-rc.14.0.0-rc.24.0.04.0.14.0.24.0.34.0.44.1.04.1.14.1.24.2.04.2.14.2.24.3.04.3.14.3.24.4.04.4.14.5.04.5.14.6.04.6.14.7.04.8.04.9.04.9.14.9.24.9.34.9.44.10.04.10.14.10.24.11.04.11.14.11.24.11.34.11.44.11.54.11.64.12.04.13.04.14.04.14.14.14.24.14.34.15.04.15.14.16.04.16.14.16.24.16.34.17.04.17.14.17.24.17.34.17.44.17.54.17.64.17.74.17.84.18.04.19.04.19.14.19.24.19.34.19.44.19.54.20.04.20.14.20.25.0.0-alpha.15.0.0-alpha.25.0.0-alpha.35.0.0-alpha.45.0.0-alpha.55.0.0-alpha.65.0.0-alpha.75.0.0-beta.05.0.0-beta.15.0.0-beta.25.0.0-rc.05.0.05.0.15.1.05.1.15.1.25.1.35.1.45.1.55.2.05.2.15.3.05.3.15.3.25.3.35.4.05.5.05.5.15.6.05.7.05.7.15.7.25.8.05.8.15.8.25.9.05.9.15.10.05.10.15.10.25.10.35.10.45.10.55.11.05.12.05.13.0
// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
// of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
// and https://github.com/palantir/blueprint/blob/master/PATENTS
/*
Accessibility
Blueprint strives to provide accessible components out of the box. Many of the JS components
will apply accessible HTML attributes to support different modes of usage.
Styleguide a11y
*/
Focus management
Focus states (that glowy blue outline around the active element) are essential for keyboard
navigation to indicate which element is currently active. They are less important, and
occasionally outright intrusive, when using a mouse because you can click wherever you want at
any time.
Blueprint includes a utility that manages the appearance of focus styles. When enabled, focus
styles will be hidden while the user interacts using the mouse and will appear when the <kbd class="pt-key">tab</kbd> key
is pressed to begin keyboard navigation. Try this out for yourself below.
**You must explictly enable this feature in your app (and you probably want to):**
```ts
import { FocusStyleManager } from "@blueprintjs/core";
FocusStyleManager.onlyShowFocusOnTabs();
```
Note that the focus style for text inputs (a slightly thicker colored border) is not removed by this
utility because it is always useful to know where you're typing.
@react-example FocusExample
Styleguide a11y.focus
JavaScript API
This behavior is controlled by a singleton instance called `FocusStyleManager` that lives in the
__@blueprintjs/core__ package. It supports the following public methods:
- `FocusStyleManager.isActive(): boolean`: Returns whether the `FocusStyleManager` is currently running.
- `FocusStyleManager.onlyShowFocusOnTabs(): void`: Enable behavior which hides focus styles during mouse interaction.
- `FocusStyleManager.alwaysShowFocus(): void`: Stop this behavior (focus styles are always visible).
Styleguide a11y.focus.js
:focus {
@include focus-outline();
}
.pt-focus-disabled :focus {
// override any focus outline anywhere
// stylelint-disable declaration-no-important
outline: none !important;
// special override for checkbox etc which render focus on a separate element
~ .pt-control-indicator {
Color contrast
Colors have been designed to be accessible to as many people as possible, even those who are visually impaired or
experiencing any kind of colorblindness. Our colors have not only been chosen to go well together but to also adhere to
[WCAG 2.0](https://www.w3.org/TR/WCAG20/) standards.
Weight: 1
Styleguide a11y.contrast