Represents a part of the CSS selector.

interface SelectorPart {
    level?: number;
    name: string;
    penalty: number;
}

Properties

Properties

level?: number

(Optional) The hierarchical level of this part in the selector path. Can be used to order or structure the final selector.

name: string

The string representing this part of the CSS selector. For example: '#my-id', '.my-class', 'div', etc.

penalty: number

A number representing the penalty or cost associated with this selector part. Lower penalties indicate preferred selectors.