Skip to content

smockle/headingoffset-polyfill

Repository files navigation

headingoffset-polyfill

codecov

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

Usage

Add the polyfill:

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

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

About

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

Resources

License

Stars

Watchers

Forks