There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

if-focus-first

Syntax

if-focus-first: (selector set);

This conditional will return true if the first element found in the selector set is focused on the page.

selector set = Any CSS selector that will return more than one item. It will work with just one item, but it is designed for multiple items in the selector set.

For example, this conditional will return true if the first item in the ".srch-Res a" selector set has the focus of the page. We use exact conditional for our search key handlings on this website to determine whether we want to focus back on the search input field when we are focused on the first item in the search results.

@conditional srchFocusFirst {
    if-focus-first: .srch-Res a;
}

.srch-Res a:srchFocusFirst:keydownArrowUp {
    focus-on: #adm-Search;
}