Description

It is frequently useful to change the styling for labels or fieldsets if they contain an input element that has the focus. Patterns facilitate that by automatically adding a focus class.

Documentation

It is frequently useful to change the styling for labels or fieldsets if they contain an input element that has the focus. Patterns facilitate that by automatically adding a focus class.

Let's look at a simple form:

Generic info

Details ...

If the focus changes to the keywords input Patterns will add the focus class to the input element, its label and fieldset:

Generic info

Details ...

It is not required to put the input element inside a label: labels will automatically be scanned for relevant for attributes.