Skip to content

fix(VVideoControls): import VVideo.sass to ensure styles are bundled with tree shaking#22749

Open
mixelburg wants to merge 1 commit intovuetifyjs:masterfrom
mixelburg:fix/vvideo-controls-styles-tree-shaking
Open

fix(VVideoControls): import VVideo.sass to ensure styles are bundled with tree shaking#22749
mixelburg wants to merge 1 commit intovuetifyjs:masterfrom
mixelburg:fix/vvideo-controls-styles-tree-shaking

Conversation

@mixelburg
Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #22529

When VVideoControls (or VVideoVolume) is used in an app without importing VVideo, production builds with tree shaking skip the VVideo.sass stylesheet — because only VVideo.tsx imported it. The result is unstyled controls in production (vite build + vite preview) while dev mode works fine (Vite doesn't tree-shake in dev).

Fix

Add import './VVideo.sass' to the top of both VVideoControls.tsx and VVideoVolume.tsx. This is the same pattern used throughout Vuetify (e.g. every component that needs styles imports its own .sass file directly). Adding the import to both ensures styles are included whenever any of the three VVideo sub-components is used standalone.

…with tree shaking

When using VVideoControls or VVideoVolume without importing VVideo,
production builds with tree shaking would omit the .v-video-controls
styles (defined in VVideo.sass) since only VVideo.tsx imported the
stylesheet.

Fix by importing VVideo.sass at the top of VVideoControls.tsx and
VVideoVolume.tsx so their styles are included regardless of which
components from the VVideo family are imported.

Fixes vuetifyjs#22529
@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Mar 24, 2026

The correct way would be to split the main stylesheet into dedicated files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report][3.11.6] VVideoControls by itself doesn't include styles (with tree shaking)

2 participants