refactor(Video): Remove SCSS from Video#3390
Conversation
|
View your CI Pipeline Execution ↗ for commit 373994b ☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3390 +/- ##
==========================================
- Coverage 90.55% 90.08% -0.47%
==========================================
Files 398 271 -127
Lines 6586 5671 -915
Branches 2141 1910 -231
==========================================
- Hits 5964 5109 -855
+ Misses 613 553 -60
Partials 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Update vidstack-vendor.css to use the webpack ~ module resolution prefix, which tells webpack to resolve imports from node_modules. This ensures the CSS imports are correctly resolved in both Storybook and consumer builds like Codecademy. Fixes module resolution error: "Can't resolve './@vidstack/react/..." when Codecademy's webpack processes the CSS file from the gamut dist output. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
… beak Applying vdsBaseThemeStyles as a styled() argument on VariableProvider scoped every .vds-* selector under the player's generated class, which broke the tooltip beak (rendered as a full diamond). Render the overrides via <Global> instead so they apply at document level, matching the original flat cascade and reaching portaled .vds-* nodes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
📬 Published Alpha Packages:
|
|
🚀 Styleguide deploy preview ready! Preview URL: https://6a57e1a272036b070750e7ea--gamut-preview.netlify.app |
dreamwasp
left a comment
There was a problem hiding this comment.
on mono, i was seeing that the tayra examples don't have the Closed Caption buttons on the ones on prod do. idk if thats just a weird tayra issue but wanted to mention it
| style={{ width, height }} | ||
| variables={vdsVariables} | ||
| > | ||
| <Global styles={vdsBaseThemeStyles} /> |
There was a problem hiding this comment.
the only thing about this i find awkward is that is there's more than one Video component rendered on a page this Global sheet gets injected over & over so maybe just a check/hook to only render one per page makes sense
There was a problem hiding this comment.
tho this may be deduped by emotion itself? idk just something to think about
There was a problem hiding this comment.
related Q: does it have to be a Global?
is the intention that these styles get inherited by MediaPlayer?
There was a problem hiding this comment.
hmm good q. so originally i had them being added to the VariableProvider (you can see in this commit 373994b) but the styles werent working bc the classnames didnt match
Applying vdsBaseThemeStyles as a styled() argument on VariableProvider
scoped every .vds-* selector under the player's generated class, which
broke the tooltip beak (rendered as a full diamond). Render the overrides
via instead so they apply at document level, matching the
original flat cascade and reaching portaled .vds-* nodes.
ill look into it but im guessing the captions get inserted from Percipio video data that doesnt work on previews/staging. that would be the same reason i had to force the VidstackPlayer to render in the mono PR |
| @import "~@vidstack/react/player/styles/default/theme.css"; | ||
| @import "~@vidstack/react/player/styles/default/layouts/video.css"; | ||
| @import "~@vidstack/react/player/styles/default/layouts/audio.css"; |
There was a problem hiding this comment.
I think importing these via JS imports is technically more compatible with tools like vite. the ~/* syntax is a webpack/css-loader thing that isn't directly supported in those tools without config changes, but directly importing CSS into JS is supported.
There was a problem hiding this comment.
good call! doing it via JS broke the Storybook page (styles weren't getting applied) but let me see if I can fix that separately
Overview
The Video component was the last consumer of a standalone SCSS file (
vds_base_theme.scss) for styling the Vidstack player. This PR removes that SCSS dependency, splitting its contents into two more idiomatic sources:vidstack-vendor.css— the three third-party Vidstack@imports (default theme + video/audio layouts), imported as plain CSS.styles.ts— our custom Vidstack overrides (YouTube overlay, control buttons, sliders, tooltips, keyframes), converted to an Emotioncsstemplate (vdsBaseThemeStyles) and applied throughGloabalinside the existingVariableProvidercomponent.This aligns the Video component with the rest of Gamut's Emotion-based styling and removes the last SCSS file from the package.
PR Checklist
Testing instructions
Verify the Vidstack player looks and behaves identically to
main— the goal is a no-visual-change refactor.iframe.vds-youtubeheight override) both before and after playback starts.PR Links and Envs