about summary refs log tree commit diff
path: root/bskyembed/snippet/embed.ts
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2024-12-12 01:31:29 +0900
committerGitHub <noreply@github.com>2024-12-11 16:31:29 +0000
commitde15f8e2d3264b9ffb18c3a089612ef604eb87b8 (patch)
treeae5419e798d55b978596ca7a396fdb395d2cf4fc /bskyembed/snippet/embed.ts
parent48c5341644935b103fa81c91b23391f7b7c8a572 (diff)
downloadvoidsky-de15f8e2d3264b9ffb18c3a089612ef604eb87b8.tar.zst
feat(embed): Add support for dark mode (#6912)
* feat(embed): Support dark mode (wip)

* finishing up the implementation

* fix tailwind color selector

* tweak design

* refactor: unify types

* fix

* fix english grammar

* refactor: unify types

* tweak design

* remove the customization part
Diffstat (limited to 'bskyembed/snippet/embed.ts')
-rw-r--r--bskyembed/snippet/embed.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/bskyembed/snippet/embed.ts b/bskyembed/snippet/embed.ts
index 380cda5fb..3c1b14b95 100644
--- a/bskyembed/snippet/embed.ts
+++ b/bskyembed/snippet/embed.ts
@@ -20,6 +20,7 @@ window.addEventListener('message', event => {
     return
   }
 
+  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
   const id = (event.data as {id: string}).id
   if (!id) {
     return
@@ -33,6 +34,7 @@ window.addEventListener('message', event => {
     return
   }
 
+  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
   const height = (event.data as {height: number}).height
   if (height) {
     embed.style.height = `${height}px`
@@ -47,7 +49,7 @@ window.addEventListener('message', event => {
  * @returns
  */
 function scan(node = document) {
-  const embeds = node.querySelectorAll('[data-bluesky-uri]')
+  const embeds = node.querySelectorAll<HTMLIFrameElement>('[data-bluesky-uri]')
 
   for (let i = 0; i < embeds.length; i++) {
     const id = String(Math.random()).slice(2)