dependabot/npm_and_yarn/katex-0.16.27
copilot/add-i18n-support-for-english
dependabot/npm_and_yarn/astro-5.16.4
dependabot/npm_and_yarn/katex-0.16.27
dependabot/npm_and_yarn/prettier-3.7.4
dependabot/npm_and_yarn/tailwindcss-4.1.16
dependabot/npm_and_yarn/tailwindcss/vite-4.1.16
dependabot/npm_and_yarn/typescript-eslint-8.46.2
dependabot/npm_and_yarn/typescript-eslint/parser-8.46.2
development
main
| 1 | <script> |
| 2 | function loadXCards() { |
| 3 | const xCards = document.querySelectorAll('.twitter-tweet') |
| 4 | if (xCards.length === 0) return |
| 5 | |
| 6 | if (document.querySelector('script[src*="platform.twitter.com/widgets.js"]')) { |
| 7 | return |
| 8 | } |
| 9 | |
| 10 | const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches |
| 11 | xCards.forEach((element) => { |
| 12 | element.setAttribute('data-theme', isDark ? 'dark' : 'light') |
| 13 | }) |
| 14 | |
| 15 | const script = document.createElement('script') |
| 16 | script.src = 'https://platform.twitter.com/widgets.js' |
| 17 | script.async = true |
| 18 | document.head.appendChild(script) |
| 19 | } |
| 20 | |
| 21 | document.addEventListener('DOMContentLoaded', loadXCards) |
| 22 | |
| 23 | document.addEventListener('astro:page-load', loadXCards) |
| 24 | </script> |
| 25 | |
| 26 | <style> |
| 27 | :global(.prose .x-card) { |
| 28 | width: 100%; |
| 29 | margin: 1em auto; |
| 30 | text-align: center; |
| 31 | } |
| 32 | |
| 33 | :global(.prose .x-card > *) { |
| 34 | display: inline-block; |
| 35 | max-width: 100%; |
| 36 | margin: 0 auto; |
| 37 | } |
| 38 | |
| 39 | :global(.prose .x-card iframe) { |
| 40 | max-width: 100%; |
| 41 | width: auto; |
| 42 | } |
| 43 | </style> |