Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 887 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 887 Bytes

headingoffset-polyfill

codecov

Polyfill for the headingoffset attribute. Related discussion in whatwg/html#5033.

Usage

Add the polyfill:

<script src="headingoffset-polyfill.js"></script>

Note

The script will scan the existing document and monitor for changes after that.

Use headingoffset:

<h1>I’m a level-1 heading!</h1>
<h2>I’m a level-2 heading!</h2>

<div headingoffset="1">
  <h1>I’m a level-2 heading!</h1>
  <h2>I’m a level-3 heading!</h2>
</div>

Testing

This project uses Web Test Runner to run tests and collect coverage.

# Install dependencies
$ npm ci

# Run tests
$ npm test