1 2<!--- 3 4This README is automatically generated from the comments in these files: 5iron-overlay-backdrop.html iron-overlay-behavior.html 6 7Edit those files, and our readme bot will duplicate them over here! 8Edit this file, and the bot will squash your changes :) 9 10The bot does some handling of markdown. Please file a bug if it does the wrong 11thing! https://github.com/PolymerLabs/tedium/issues 12 13--> 14 15[](https://travis-ci.org/PolymerElements/iron-overlay-behavior) 16 17_[Demo and API docs](https://elements.polymer-project.org/elements/iron-overlay-behavior)_ 18 19 20##Polymer.IronOverlayBehavior 21 22Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or shown, and displays 23on top of other content. It includes an optional backdrop, and can be used to implement a variety 24of UI controls including dialogs and drop downs. Multiple overlays may be displayed at once. 25 26See the [demo source code](https://github.com/PolymerElements/iron-overlay-behavior/blob/master/demo/simple-overlay.html) 27for an example. 28 29### Closing and canceling 30 31An overlay may be hidden by closing or canceling. The difference between close and cancel is user 32intent. Closing generally implies that the user acknowledged the content on the overlay. By default, 33it will cancel whenever the user taps outside it or presses the escape key. This behavior is 34configurable with the `no-cancel-on-esc-key` and the `no-cancel-on-outside-click` properties. 35`close()` should be called explicitly by the implementer when the user interacts with a control 36in the overlay element. When the dialog is canceled, the overlay fires an 'iron-overlay-canceled' 37event. Call `preventDefault` on this event to prevent the overlay from closing. 38 39### Positioning 40 41By default the element is sized and positioned to fit and centered inside the window. You can 42position and size it manually using CSS. See `Polymer.IronFitBehavior`. 43 44### Backdrop 45 46Set the `with-backdrop` attribute to display a backdrop behind the overlay. The backdrop is 47appended to `<body>` and is of type `<iron-overlay-backdrop>`. See its doc page for styling 48options. 49 50In addition, `with-backdrop` will wrap the focus within the content in the light DOM. 51Override the [`_focusableNodes` getter](#Polymer.IronOverlayBehavior:property-_focusableNodes) 52to achieve a different behavior. 53 54### Limitations 55 56The element is styled to appear on top of other content by setting its `z-index` property. You 57must ensure no element has a stacking context with a higher `z-index` than its parent stacking 58context. You should place this element as a child of `<body>` whenever possible. 59 60 61 62##<iron-overlay-backdrop> 63 64`iron-overlay-backdrop` is a backdrop used by `Polymer.IronOverlayBehavior`. It should be a 65singleton. 66 67### Styling 68 69The following custom properties and mixins are available for styling. 70 71| Custom property | Description | Default | 72| --- | --- | --- | 73| `--iron-overlay-backdrop-background-color` | Backdrop background color | #000 | 74| `--iron-overlay-backdrop-opacity` | Backdrop opacity | 0.6 | 75| `--iron-overlay-backdrop` | Mixin applied to `iron-overlay-backdrop`. | {} | 76| `--iron-overlay-backdrop-opened` | Mixin applied to `iron-overlay-backdrop` when it is displayed | {} | 77 78 79