Get a better focus effect in all browsers.
The native focus behavior of browsers are wired and different.
For better focus effect control, we use the
instead of the
:focus selector in Luda.
Except form elements, the
.focus class will be added
to a focusable element only when it’s focused through keyboard.
For a form element, the
.focus class will be added no matter how it’s focused.
This link will show an outline only when it’s focused through keyboard.
<a href="#">Focus this link</a>
This button will show an outline only when it’s focused through keyboard.
<button class="btn btn-primary">Focus me through keyboard</button>
The border color of this text field will be changed no matter how the text field is focused.
<div class="fm fm-text"> <input placeholder="A text filed"> </div>
Add this attribute to the
<html> tag to disable the enhancement
to browser’s native focus behavior.