Skip to main content

Module cascade

Module cascade 

Source
Expand description

CSS cascade & inheritance.

Walks the BoxTree and propagates inheritable properties from parent to child when the child has not specified them. Properties not in the inheritable list are left untouched (initial values applied at paint time).

Inheritable properties (per CSS spec, restricted to our scope):

  • color
  • font-family
  • font-size
  • font-weight
  • font-style
  • line-height
  • letter-spacing
  • text-align
  • white-space
  • overflow-wrap
  • visibility
  • text-decoration (not strictly inheritable but used as such here)

All other properties (background, padding, border, transform, etc.) are NOT inherited.

Functionsยง

inherit_from
Inherit unset child properties from the parent. parent is the already resolved style (post-cascade) of the parent node.