about summary refs log tree commit diff stats
path: root/src/css/stylednode.nim
blob: d6293187757f3ef57c4e93a971c505cb10abf762 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import css/values
import html/dom

# Container to hold a style and a node.
# Pseudo elements are implemented using StyledNode objects without nodes.
type
  StyledType* = enum
    STYLED_ELEMENT, STYLED_TEXT

  StyledNode* = ref object
    case t*: StyledType
    of STYLED_ELEMENT:
      pseudo*: PseudoElem
      computed*: CSSComputedValues
    of STYLED_TEXT:
      text*: string
    node*: Node
    children*: seq[StyledNode]