Style

zio.http.template2.Dom.Element.Style
final case class Style(attributes: Map[String, AttributeValue] = ..., children: Vector[Dom] = ...) extends Element

Style element with specialized methods for CSS

Attributes

Graph
Supertypes
trait Element
trait Dom
trait Modifier
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def `type`(value: String): Style
def addAttributes(attributes: Iterable[Attribute]): Style
override def apply(modifier: Modifier, modifiers: Modifier*): Style

Apply modifiers (attributes and children) to this element

Apply modifiers (attributes and children) to this element

Attributes

Definition Classes
def apply(modifiers: Iterable[Modifier]): Style
def apply(Css: Css, modifiers: Modifier*): Style
def attr(name: String, value: AttributeValue): Style

Add or update an attribute

Add or update an attribute

Attributes

def attr(name: String, value: String): Style
def css(code: String): Style
def css(code: Css): Style
def inlineCss(code: String): Style
def inlineCss(code: Css): Style
def inlineResource(file: String, classLoader: ClassLoader = ...): Style
def media(value: String): Style
def removeAttr(name: String): Style

Remove an attribute

Remove an attribute

Attributes

def replaceChildren(children: Dom*): Style

Replace all children

Replace all children

Attributes

def scoped: Style
def tag: String
def when(condition: Boolean)(modifiers: Modifier*): Style

Add children conditionally

Add children conditionally

Attributes

def whenSome[T](option: Option[T])(f: T => Seq[Modifier]): Style

Add children if Option is defined

Add children if Option is defined

Attributes

Inherited methods

def &(other: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable
def +(adjacent: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable
def >(child: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable
def >>(descendant: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable
def addAttributes(attribute: Attribute, attributes: Attribute*): Element

Attributes

Inherited from:
Element
def addChildren(child: Dom, children: Dom*): Element

Attributes

Inherited from:
Element
def addChildren(children: Iterable[Dom]): Element

Attributes

Inherited from:
Element

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable
def collect(predicate: PartialFunction[Dom, Dom]): List[Dom]

Collect all elements matching the predicate

Collect all elements matching the predicate

Attributes

Inherited from:
Dom

Attributes

Inherited from:
CssSelectable
def filter(predicate: Dom => Boolean): Dom

Filter children recursively based on a predicate

Filter children recursively based on a predicate

Attributes

Inherited from:
Dom
def find(predicate: Dom => Boolean): Option[Dom]

Find the first element matching the predicate

Find the first element matching the predicate

Attributes

Inherited from:
Dom

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
Dom

Attributes

Inherited from:
CssSelectable
def modify(element: Element): Element

Attributes

Inherited from:
Modifier

Attributes

Inherited from:
CssSelectable
def nthChild(formula: String): CssSelector

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable
def part(name: String): CssSelector

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def render(indentation: Boolean): String

Render the DOM to HTML string with optional indentation

Render the DOM to HTML string with optional indentation

Attributes

Inherited from:
Dom
def render: String

Render the DOM to HTML string without indentation

Render the DOM to HTML string without indentation

Attributes

Inherited from:
Dom

Render the DOM to minified HTML string

Render the DOM to minified HTML string

Attributes

Inherited from:
Dom

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable
def transform(f: Dom => Dom): Dom

Transform this DOM node by applying a function

Transform this DOM node by applying a function

Attributes

Inherited from:
Dom

Attributes

Inherited from:
CssSelectable
def withAttribute(attr: String, value: String): CssSelector

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable

Attributes

Inherited from:
CssSelectable
def |(other: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable
def ~(sibling: CssSelector): CssSelector

Attributes

Inherited from:
CssSelectable

Inherited fields

override val selector: CssSelector

Attributes

Inherited from:
Element