Documentation
    Preparing search index...

    Class Insets

    Symmetric edge insets in layout units — padding and margins (§74).

    A mutable class rather than an object literal, for plan D7's reason: insets are read every layout pass, so they are written in place (set, setAll, copy) and never replaced.

    Index
    • CSS's shorthand order — (all), (vertical, horizontal), or all four clockwise from the top — because that is the order every author already knows, and none of the four is more fundamental than the others.

      Parameters

      • top: number = 0
      • right: number = top
      • bottom: number = top
      • left: number = right

      Returns Insets

    bottom: number

    Distance from the bottom edge.

    left: number

    Distance from the left edge.

    right: number

    Distance from the right edge.

    top: number

    Distance from the top edge, in layout units.

    • get horizontal(): number

      left + right — the horizontal space these insets consume.

      Returns number

    • get vertical(): number

      top + bottom — the vertical space these insets consume.

      Returns number

    • Writes all four edges, in the constructor's shorthand order. Returns this.

      Parameters

      • top: number
      • right: number = top
      • bottom: number = top
      • left: number = right

      Returns this