Specificity

laika.ast.Specificity
case class Specificity(ids: Int, classes: Int, types: Int, order: Int) extends Ordered[Specificity]

Represents the specificity of a style selector or predicate. This is modeled after the precedence rules of the CSS standard.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[Specificity]
trait Comparable[Specificity]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def +(other: Specificity): Specificity

Adds this and the given specificity by summing all its individual parameters.

Adds this and the given specificity by summing all its individual parameters.

Attributes

def compare(other: Specificity): Int

Compares this instance with the given specificity. Applies the CSS standard weighting of first comparing the number of specified ids, followed by classes, then types and finally the order.

Compares this instance with the given specificity. Applies the CSS standard weighting of first comparing the number of specified ids, followed by classes, then types and finally the order.

Attributes

Inherited methods

def <(that: Specificity): Boolean

Attributes

Inherited from:
Ordered
def <=(that: Specificity): Boolean

Attributes

Inherited from:
Ordered
def >(that: Specificity): Boolean

Attributes

Inherited from:
Ordered
def >=(that: Specificity): Boolean

Attributes

Inherited from:
Ordered
def compareTo(that: Specificity): Int

Attributes

Inherited from:
Ordered
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product