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

      • Optionaltop: number
      • Optionalright: number
      • Optionalbottom: number
      • Optionalleft: number

      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

    • Copies other's four edges into this. Returns this.

      Parameters

      Returns this

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

      Parameters

      • top: number
      • Optionalright: number
      • Optionalbottom: number
      • Optionalleft: number

      Returns this