Specificity class
CSS selector specificity as a triple (a, b, c):
a— ID selectorsb— class, attribute and pseudo-class selectorsc— type selectors and pseudo-elements
Compared lexicographically, a before b before c.
- Implemented types
Constructors
- Specificity(int a, int b, int c)
-
Creates a specificity triple.
const
Properties
Methods
-
compareTo(
Specificity other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator +(
Specificity other) → Specificity - Component-wise addition.
-
operator <(
Specificity other) → bool -
Whether this specificity is lower than
other. -
operator <=(
Specificity other) → bool -
Whether this specificity is at most
other. -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator >(
Specificity other) → bool -
Whether this specificity is higher than
other. -
operator >=(
Specificity other) → bool -
Whether this specificity is at least
other.
Constants
- classSelector → const Specificity
-
The specificity of a class, attribute or pseudo-class,
(0,1,0). - idSelector → const Specificity
-
The specificity of an ID selector,
(1,0,0). - typeSelector → const Specificity
-
The specificity of a type selector or pseudo-element,
(0,0,1). - universal → const Specificity
- Zero specificity. Prefer zero.
- zero → const Specificity
-
Zero specificity, contributed by
:where()and the universal selector.