twbs / twbs/bootstrap

Add :hover media query back

Open
#41,227 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

css feature
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Proposal

Back in 2018/v4 a decision was made in #25270 to deprecate a hover media query due to the relatively low browser support and as such requirement of a shim to make it work.

Now the hover media query is widely supported I propose that the $enable-hover-media-query flag is added back in.

Motivation and context

To quote the original v4 docs explaining the flag:

While :hover isn’t possible on most touch devices, iOS emulates this behavior, resulting in “sticky” hover styles that persist after tapping one element. These hover styles are only removed when users tap another element. This behavior is considered largely undesirable and appears to not be an issue on Android or Windows devices.

For better or for worse this is still an issue in iOS and it would be useful to have the option to safely alleviate it.

I'm more than happy to submit a PR if it feels like there's appetite to go ahead implementing this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the prior decision in #25270 and the quoted v4 documentation, then trace how current hover styles and Sass configuration are handled. Done means restoring an opt-in $enable-hover-media-query flag with behavior that addresses sticky hover styles on iOS and updating the relevant documentation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, scss
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.