Skip to content

Commit

Permalink
v5: Add role=button cursor in Reboot (twbs#31040)
Browse files Browse the repository at this point in the history
* v5: Add role=button cursor in Reboot

Ports the changes from twbs#30562 made in v4.5 and adds them to v5. This replaces twbs#30563 which sought to add this to the utility API, but the v4 PR shifted to implement an accessible solution vs a lone utility.

* Update reboot.md

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
  • Loading branch information
2 people authored and olsza committed Oct 3, 2020
1 parent fb415d2 commit b3e9053
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ select {
text-transform: none;
}

// Set the cursor for non-`<button>` buttons
//
// Details at https://github.com/twbs/bootstrap/pull/30562
[role="button"] {
cursor: pointer;
}

// Remove the inheritance of word-wrap in Safari.
// See https://github.com/twbs/bootstrap/issues/24990

Expand Down
9 changes: 9 additions & 0 deletions site/content/docs/5.0/content/reboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ These changes, and more, are demonstrated below.
{{< partial "callout-warning-input-support.md" >}}
{{< /callout >}}

### Pointers on buttons

Reboot includes an enhancement for `role="button"` to change the default cursor to `pointer`. Add this attribute to elements to help indicate elements are interactive. This role isn't necessary for `<button>` elements, which gets its own `cursor` change.

{% capture example %}
<span role="button">Non-button element button</span>
{% endcapture %}
{% include example.html content=example %}

## Misc elements

### Address
Expand Down

0 comments on commit b3e9053

Please sign in to comment.