Dynamic shadows allow an element to switch its shadow class based on user interaction using data-neu-* attributes. The attribute value should be the CSS class of the shadow to switch to (e.g., .neu-pressed).
| Attribute | Trigger | Behavior |
|---|
data-neu-click | Mouse Down | Switches class while mouse is pressed; resets on release. |
data-neu-clicked | Click | Toggles class on click; toggles back on second click. |
data-neu-hover | Mouse Over | Switches class while hovered; resets when mouse leaves. |
data-neu-focus | Focus | Switches class while element is focused; resets on blur. |
<!-- Switches from neu-flat to neu-pressed while holding click -->
<button class="neu-flat" data-neu-click=".neu-pressed">Click me!</button>
<!-- Toggles between neu-flat and neu-pressed on each click -->
<button class="neu-flat" data-neu-clicked=".neu-pressed">Toggle me!</button>
<!-- Switches to neu-pressed on hover -->
<button class="neu-flat" data-neu-hover=".neu-pressed">Hover me!</button>
<!-- Switches to neu-pressed when input is focused -->
<input class="neu-flat" data-neu-focus=".neu-pressed" />