Skip to content

Commit

Permalink
Document that polyfill fn returns a promise. Closes #154.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Feb 28, 2024
1 parent 240b09d commit 3b55af9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ To use the polyfill, add this script tag to your document `<head>`:
</script>
```

If you want to manually apply the polyfill, you can instead import the
`polyfill` function directly from the
`@oddbird/css-anchor-positioning/dist/css-anchor-positioning-fn.js` file.

For build tools such as Vite, Webpack, and Parcel, that will look like this:

```js
import polyfill from '@oddbird/css-anchor-positioning/fn';
```

The `polyfill` function returns a promise that resolves when the polyfill has
been applied.

You can view a more complete demo [here](https://anchor-polyfill.netlify.app/).

## Configuration
Expand Down

0 comments on commit 3b55af9

Please sign in to comment.