Skip to content

Removing -webkit-tap-highlight-color removes useful feedback #23

@ethanresnick

Description

@ethanresnick

Webkit uses this tap color to highlight tapped form elements, links, and elements with various js events.

The current normalize.css removes the tap color, in order to solve an issue with delegated events outlined on the YUI blog. But removing the tap color entirely disables the valuable feedback that it provides when the user clicks a links or form element. I propose adding the highlight back in those cases.

The CSS would become:

input, select, textarea, button, a {-webkit-tap-highlight-color:#ccc; } /\* I think this is the right shade of gray... The opacity is not specified so that the native value will be used.. */

This still isn't perfect:

  1. When one of the elements listed above (input, select, etc.) is used to handle event delegation, the problem described at YUI will come back.

  2. Any element which isn't one of those excepted above won't get a tap highlight when tapped (whether it's the true target of a delegated event or was tapped directly).

But both of these problems are somewhat rare and avoidable with good HTML/JS (make clickable elements <a>s with event handlers that preventDefault and don't use an <a> as your delegation handler), so I think the above CSS is acceptable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions