Skip to content

Commit

Permalink
Remove inert polyfill as it is comfortably baseline now
Browse files Browse the repository at this point in the history
  • Loading branch information
Joppe committed May 30, 2024
1 parent 00008d2 commit 55cb27b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 29 deletions.
8 changes: 1 addition & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"dependencies": {
"@lion/tabs": "^0.13.1",
"hex-to-css-filter": "^5.4.0",
"lit": "^3.1.3",
"wicg-inert": "^3.1.2"
"lit": "^3.1.3"
}
}
}
4 changes: 0 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ export default [
patterns: [ 'fonts/*.woff2', 'meta/mashup.png' ],
rootDir: './site'
}),
copy({
patterns: [ 'inert.esm.js' ],
rootDir: './node_modules/wicg-inert/dist'
}),
// Print bundle summary
summary()
],
Expand Down
3 changes: 1 addition & 2 deletions site/src/components/rec-carousel/rec-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { LitElement, html, unsafeCSS, render } from 'lit';
import { repeat } from 'lit/directives/repeat.js';
import { styleMap } from 'lit/directives/style-map.js';
import styles from './rec-carousel.scss';
import 'wicg-inert';

/**
* Allows a user to navigate through a set of images with captions.
Expand Down Expand Up @@ -300,7 +299,7 @@ export class RecCarousel extends LitElement {
}
}

/* Running the inert polyfill is expensive, so shouldn't happen _during_ the animation */
/* Probably best not to set inert _during_ the animation */
requestIdleCallback(() => this._slides.forEach(slide => {
const hidden = slide.getAttribute('aria-hidden');
if (hidden === 'false') {
Expand Down
13 changes: 0 additions & 13 deletions site/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@
<script async type="module" src="components/rec-filtercalculator/rec-filtercalculator.js"></script>
<script async type="module" src="../../node_modules/@lion/tabs/lion-tabs.js"></script>

<script>
// Don't download inert polyfill if it is not needed
if (!HTMLElement.prototype.hasOwnProperty('inert')) {
var sc = document.createElement('script');
sc.src = './inert.esm.js';
sc.type = 'module';
sc.async = true;

document.getElementsByTagName('head')[0].appendChild(sc)
}
</script>


<link rel="stylesheet" href="styles/index.css">
<link rel="stylesheet" href="styles/pushable.css">

Expand Down

0 comments on commit 55cb27b

Please sign in to comment.