Skip to content

Obsolete pattern "focus"? #1256

@thet

Description

@thet

We have the pat-focus pattern. As far as I understand, the functionality can completely be replicated with pure CSS. Instead of adding focus classes on fields and fieldsets, we can use this selectors:

:focus {
    /* selects an element, which is focused */
}

:has(:focus) {
    /* selects an element where at least one of it's children is focused */
}
:focus-within {
    /* same as above */
}

This question popped up while debugging a problem with pat-focus where it breaks pattern registration/scanning when used with pat-leaflet.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions