Polyfill for the headingoffset
attribute. Related discussion in whatwg/html#5033.
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>
This project uses Web Test Runner to run tests and collect coverage.
# Install dependencies
$ npm ci
# Run tests
$ npm test