Skip to content
GitHub

Hitbox

Expand hit areas of interactive elements without affecting layout.

Kudos to Kian Bazza for the original implementation.

Installation

Usage

Examples

Basic

Use hitbox-* to extend the hit area uniformly on all sides.

Individual sides

Target specific sides with hitbox-l-*, hitbox-r-*, hitbox-t-*, and hitbox-b-*.

Horizontal and vertical

Use hitbox-x-* and hitbox-y-* for axis shorthands.

Custom values

Use arbitrary values with bracket syntax.

Debugging

Add hitbox-debug to visualize the expanded hit area.

Use hitbox-y-* so adjacent items feel continuous.

API Reference