Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@polymer/iron-overlay-behavior
Advanced tools
Provides a behavior for making an element an overlay
##Polymer.IronOverlayBehavior
Use Polymer.IronOverlayBehavior
to implement an element that can be hidden or shown, and displays
on top of other content. It includes an optional backdrop, and can be used to implement a variety
of UI controls including dialogs and drop downs. Multiple overlays may be displayed at once.
See the demo source code for an example.
An overlay may be hidden by closing or canceling. The difference between close and cancel is user
intent. Closing generally implies that the user acknowledged the content on the overlay. By default,
it will cancel whenever the user taps outside it or presses the escape key. This behavior is
configurable with the no-cancel-on-esc-key
and the no-cancel-on-outside-click
properties.
close()
should be called explicitly by the implementer when the user interacts with a control
in the overlay element. When the dialog is canceled, the overlay fires an 'iron-overlay-canceled'
event. Call preventDefault
on this event to prevent the overlay from closing.
By default the element is sized and positioned to fit and centered inside the window. You can
position and size it manually using CSS. See Polymer.IronFitBehavior
.
Set the with-backdrop
attribute to display a backdrop behind the overlay. The backdrop is
appended to <body>
and is of type <iron-overlay-backdrop>
. See its doc page for styling
options.
In addition, with-backdrop
will wrap the focus within the content in the light DOM.
Override the _focusableNodes
getter
to achieve a different behavior.
The element is styled to appear on top of other content by setting its z-index
property. You
must ensure no element has a stacking context with a higher z-index
than its parent stacking
context. You should place this element as a child of <body>
whenever possible.
##<iron-overlay-backdrop>
iron-overlay-backdrop
is a backdrop used by Polymer.IronOverlayBehavior
. It should be a
singleton.
The following custom properties and mixins are available for styling.
Custom property | Description | Default |
---|---|---|
--iron-overlay-backdrop-background-color | Backdrop background color | #000 |
--iron-overlay-backdrop-opacity | Backdrop opacity | 0.6 |
--iron-overlay-backdrop | Mixin applied to iron-overlay-backdrop . | {} |
--iron-overlay-backdrop-opened | Mixin applied to iron-overlay-backdrop when it is displayed | {} |
FAQs
Provides a behavior for making an element an overlay
The npm package @polymer/iron-overlay-behavior receives a total of 14,818 weekly downloads. As such, @polymer/iron-overlay-behavior popularity was classified as popular.
We found that @polymer/iron-overlay-behavior demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.