JSPM

  • Created
  • Published
  • Downloads 23196
  • Score
    100M100P100Q163789F
  • License BSD-3-Clause

Fits an element inside another element

Package Exports

  • @polymer/iron-fit-behavior
  • @polymer/iron-fit-behavior/iron-fit-behavior.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polymer/iron-fit-behavior) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build status

Demo and API docs

Polymer.IronFitBehavior

Polymer.IronFitBehavior fits an element in another element using max-height and max-width, and optionally centers it in the window or another element.

The element will only be sized and/or positioned if it has not already been sized and/or positioned by CSS.

CSS properties Action
position set Element is not centered horizontally or vertically
top or bottom set Element is not vertically centered
left or right set Element is not horizontally centered
max-height set Element respects max-height
max-width set Element respects max-width

Polymer.IronFitBehavior can position an element into another element using verticalAlign and horizontalAlign. This will override the element's css position.

  <div class="container">
    <iron-fit-impl vertical-align="top" horizontal-align="auto">
      Positioned into the container
    </iron-fit-impl>
  </div>

Use noOverlap to position the element around another element without overlapping it.

  <div class="container">
    <iron-fit-impl no-overlap vertical-align="auto" horizontal-align="auto">
      Positioned around the container
    </iron-fit-impl>
  </div>