开发者社区> 镜像站> NPM> dom-details-fallback
dom-details-fallback
Fallback for the interactive details element, emulating Chrome's behaviour in older browsers
Last updated 4 years ago by emilbay .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dom-details-fallback 
SYNC missed versions from official npm registry.

dom-details-fallback

Fallback for the interactive details element, emulating Chrome's behaviour in older browsers

Install

npm install dom-details-fallback

Usage

require('dom-details-fallback')(null, true)

To create the open/close marker the ::before pseudo element is used. This is normally styled with a vendor specific pseudo element, eg. ::-webkit-details-marker, so consider this if you want to change this:

summary::before, summary:before {
  /* Custom closed marker */
}

details[open="open"] summary::before,
details[open="open"] summary:before {
  /* Custom open marker */
}

API

applyDetailsFallback(parent, injectCss)

Will only polyfill if the open property is not present on a newly created <details> element.

parent

Type: Element|Document Default: window.document

Parent of the <details> elements that should be polyfilled.

injectCss

Type: Boolean
Default: true

Inject default CSS into <head>.

License

ISC

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 1
Last Month 1
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None