Skip to content

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

License

Notifications You must be signed in to change notification settings

smockle/headingoffset-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •