diff --git a/apps/sandbox/app/styles.css b/apps/sandbox/app/styles.css index 75d7d719d2..cdf6fb2d36 100644 --- a/apps/sandbox/app/styles.css +++ b/apps/sandbox/app/styles.css @@ -4,13 +4,6 @@ @source "../app"; @source "../templates"; @source "./_generated/registry"; -/* - * The publisher's Tailwind skin predates VJSC and is not in the generated registry. Its class maps ship bundled inside - * the public packages, so scan those copies. Keep these paths narrow: scanning either package root follows workspace - * symlinks across thousands of generated files and blocks cold requests. - */ -@source "../node_modules/@videojs/html/dist/default/presets/publisher"; -@source "../node_modules/@videojs/react/dist/default/presets/publisher"; /* The shell's scheme control pins `data-color-scheme`; without it the operating system decides. */ :root { @@ -40,19 +33,6 @@ @theme { --font-sans: Inter, ui-sans-serif, system-ui, sans-serif; - /* Publisher Tailwind skin animation token; ejected from the publisher's legacy skin `shared/tailwind.css`. */ - --animate-media-pulse: media-pulse 2s ease-in-out infinite; -} - -/* Soft opacity pulse for live/connecting status dots (publisher skins). */ -@keyframes media-pulse { - 0%, - 100% { - opacity: 1; - } - 50% { - opacity: 0.4; - } } @layer base { diff --git a/apps/sandbox/templates/moq-publisher-react/main.tsx b/apps/sandbox/templates/moq-publisher-react/main.tsx index 37b38ce78c..8e38066541 100644 --- a/apps/sandbox/templates/moq-publisher-react/main.tsx +++ b/apps/sandbox/templates/moq-publisher-react/main.tsx @@ -10,11 +10,11 @@ import '@app/styles.css'; // ?real publish to an actual MoQ relay via // ?relay= relay endpoint for ?real (default https://relay.mux.dev) // ?ns= publish namespace for ?real (default: random name) -// ?styling=tailwind use the Tailwind skin twin +// ?styling=tailwind compile the skin's Tailwind styling from its authored source import { SandboxI18nProvider } from '@app/shared/react/sandbox-i18n'; import type { Styling } from '@app/types'; import { createPlayer, useComposedRefs, useMediaInstance } from '@videojs/react'; -import { MoqPublishVideo, PublisherSkin, PublisherSkinTailwind, publisherFeatures } from '@videojs/react/publisher'; +import { MoqPublishVideo, PublisherSkin, publisherFeatures } from '@videojs/react/publisher'; import { type ComponentProps, forwardRef, useCallback } from 'react'; import { createRoot } from 'react-dom/client'; @@ -28,9 +28,28 @@ const real = params.has('real'); const relay = params.get('relay') || 'https://relay.mux.dev'; const namespace = params.get('ns') || `vjs-sandbox-${Math.random().toString(36).slice(2, 8)}`; -if (styling === 'css') await import('@videojs/react/publisher/skin.css'); +/** + * The packages ship only the CSS skin, so Tailwind compiles the authored source on request, as the shell does for the + * playback skins. + */ +async function loadSkin(): Promise { + if (styling === 'css') { + await import('@videojs/react/publisher/skin.css'); + + return PublisherSkin; + } + + const [authored] = await Promise.all([ + import('../../../../packages/skins/src/presets/publisher/skin.tsx?style=tailwind&target=react&skin=default-publisher&theme=default'), + import('@app/styles.authored.css'), + ]); -const { Provider } = createPlayer({ features: publisherFeatures }); + return authored.PublisherSkin; +} + +const Skin = await loadSkin(); + +const { Player } = createPlayer({ features: publisherFeatures }); /** * Fake twin of `MoqPublishVideo` — the same preview `