Skip to content

Commit bd18ff3

Browse files
committed
Fixes for Firefox
1 parent 66bf5b8 commit bd18ff3

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

examples/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<toot-embed src="https://sunny.garden/@knowler/109487032491438808"></toot-embed>
1010

1111
<script type="module">
12+
import 'https://cdn.skypack.dev/pin/urlpattern-polyfill@v6.0.2-Xkk1InwdFsTyUXRMqTq0/mode=imports,min/optimized/urlpattern-polyfill.js'
13+
import 'https://cdn.skypack.dev/pin/element-internals-polyfill@v1.1.18-z4BovnhHcCqD1ZdZNRfe/mode=imports,min/optimized/element-internals-polyfill.js'
1214
// import 'https://unpkg.com/@github/toot-embed-boilerplate@latest/dist/toot-embed.js'
1315
import '../src/toot-embed-element.ts'
1416
</script>

src/toot-embed-element.ts

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
const html = String.raw
22
const styles = new CSSStyleSheet()
33
styles.replaceSync(`
4-
:host(:not(:--loading)) {
5-
display: grid;
6-
max-inline-size: 36em;
7-
padding: 0.5em;
8-
gap: 0.5em;
9-
border: 0.0625em solid grey;
10-
border-radius: 0.5em;
11-
grid-template:
12-
"avatar author-link author-link" max-content
13-
"content content content" max-content
14-
"backlink backlink backlink" max-content
15-
/ min-content auto auto;
4+
@supports selector(:--loading) {
5+
:host(:not(:--loading)) {
6+
display: grid;
7+
max-inline-size: 36em;
8+
padding: 0.5em;
9+
gap: 0.5em;
10+
border: 0.0625em solid grey;
11+
border-radius: 0.5em;
12+
grid-template:
13+
"avatar author-link author-link" max-content
14+
"content content content" max-content
15+
"backlink backlink backlink" max-content
16+
/ min-content auto auto;
17+
}
18+
}
19+
20+
@supports not selector(:--loading) {
21+
:host(:not([internals-loading])) {
22+
display: grid;
23+
max-inline-size: 36em;
24+
padding: 0.5em;
25+
gap: 0.5em;
26+
border: 0.0625em solid grey;
27+
border-radius: 0.5em;
28+
grid-template:
29+
"avatar author-link author-link" max-content
30+
"content content content" max-content
31+
"backlink backlink backlink" max-content
32+
/ min-content auto auto;
33+
}
1634
}
1735
1836
[part="avatar"] {

0 commit comments

Comments
 (0)