README.md
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
26### Closing and canceling
27
28A dialog may be hidden by closing or canceling. The difference between close and cancel is user
29intent. Closing generally implies that the user acknowledged the content on the overlay. By default,
30it will cancel whenever the user taps outside it or presses the escape key. This behavior is
31configurable with the `no-cancel-on-esc-key` and the `no-cancel-on-outside-click` properties.
32`close()` should be called explicitly by the implementer when the user interacts with a control
33in the overlay element. When the dialog is canceled, the overlay fires an 'iron-overlay-canceled'
34event. Call `preventDefault` on this event to prevent the overlay from closing.
35
36### Positioning
37
38By default the element is sized and positioned to fit and centered inside the window. You can
39position and size it manually using CSS. See `Polymer.IronFitBehavior`.
40
41### Backdrop
42
43Set the `with-backdrop` attribute to display a backdrop behind the overlay. The backdrop is
44appended to `<body>` and is of type `<iron-overlay-backdrop>`. See its doc page for styling
45options.
46
47### Limitations
48
49The element is styled to appear on top of other content by setting its `z-index` property. You
50must ensure no element has a stacking context with a higher `z-index` than its parent stacking
51context. You should place this element as a child of `<body>` whenever possible.
52
53
54
55##<iron-overlay-backdrop>
56
57`iron-overlay-backdrop` is a backdrop used by `Polymer.IronOverlayBehavior`. It should be a
58singleton.
59
60### Styling
61
62The following custom properties and mixins are available for styling.
63
64| Custom property | Description | Default |
65| --- | --- | --- |
66| `--iron-overlay-backdrop-background-color` | Backdrop background color | #000 |
67| `--iron-overlay-backdrop-opacity` | Backdrop opacity | 0.6 |
68| `--iron-overlay-backdrop` | Mixin applied to `iron-overlay-backdrop`. | {} |
69| `--iron-overlay-backdrop-opened` | Mixin applied to `iron-overlay-backdrop` when it is displayed | {} |
70
71
72