laika.ast.styles

Members list

Type members

Classlikes

case class ParentSelector(selector: StyleSelector, immediate: Boolean)

Represents a parent selector and indicates whether it is an immediate parent or an ancestor anywhere in the hierarchy.

Represents a parent selector and indicates whether it is an immediate parent or an ancestor anywhere in the hierarchy.

Attributes

Source
styles.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Specificity(ids: Int, classes: Int, types: Int, order: Int) extends Ordered[Specificity]

Represents the specificity of a style selector or predicate.

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

Attributes

Source
styles.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait Ordered[Specificity]
class Object
trait Matchable
class Any
Show all
case class StyleDeclaration(selector: StyleSelector, styles: Map[String, String])

Represents a single style declaration.

Represents a single style declaration.

Value parameters

selector

the selector to determine which elements this declaration applies to

styles

the styles themselves in a map representing the names and values of each style

Attributes

Companion
object
Source
styles.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object StyleDeclaration extends (StyleSelector, Map[String, String]) => StyleDeclaration

Companion providing factory methods for the StyleDeclaration class.

Companion providing factory methods for the StyleDeclaration class.

Attributes

Companion
class
Source
styles.scala
Supertypes
trait Product
trait Mirror
trait (StyleSelector, Map[String, String]) => StyleDeclaration
class Object
trait Matchable
class Any
Show all
Self type
case class StyleDeclarationSet(paths: Set[Path], styles: Set[StyleDeclaration], precedence: Precedence)

Represents a set of one or more style declarations.

Represents a set of one or more style declarations.

Value parameters

paths

the paths the style declarations have been obtained from

precedence

the precedence of this set compared to other provided sets

styles

the style declarations that belong to this set

Attributes

Companion
object
Source
styles.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Companion providing factory methods for the StyleDeclaration class.

Companion providing factory methods for the StyleDeclaration class.

Attributes

Companion
class
Source
styles.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Show all
Self type
sealed trait StylePredicate

Represents a single predicate which is part of the selector for a style declaration.

Represents a single predicate which is part of the selector for a style declaration.

Attributes

Companion
object
Source
styles.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ElementType
class Id
class StyleName

Contains the available predicate types.

Contains the available predicate types.

The available selector types represent a subset of the full CSS standard, picking those features which are reasonably suited in the context of the Laika document model. It includes type, class and id selectors, but no attribute selectors as most Laika tree elements primarily contain a sequence of children and not many other properties to match against.

It also supports the CSS syntax to declare selectors for child elements (e.g. Paragraph .intro) or immediate children (e.g. Paragraph > .intro).

Attributes

Companion
trait
Source
styles.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StyleSelector(predicates: Set[StylePredicate], parent: Option[ParentSelector], order: Int)

Responsible for determining whether a style declaration should be applied to a target element, basing its decision on a set of predicates.

Responsible for determining whether a style declaration should be applied to a target element, basing its decision on a set of predicates.

Value parameters

order

the index of the style declaration this selector belongs to

parent

the optional parent selector

predicates

the set of predicates that need to hold for this selector to be applicable to a target element

Attributes

Source
styles.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all