-
Notifications
You must be signed in to change notification settings - Fork 31
refactor(Video): Remove SCSS from Video #3390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
56da2f2
ec33ca2
d15e495
5308052
04e8b96
85280a0
4cbfa62
573e728
a88008f
373994b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| gamut: minor | ||
| --- | ||
|
|
||
| remove scss from video |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| import { css } from '@emotion/react'; | ||
|
|
||
| export const vdsBaseThemeStyles = css` | ||
| /** | ||
| * Youtube overlay | ||
| * - Why 120% ? hiding yt logo and copy link button which are not accessible. | ||
| */ | ||
| iframe.vds-youtube[data-no-controls] { | ||
| height: 120%; | ||
| } | ||
|
|
||
| [data-started] iframe.vds-youtube[data-no-controls] { | ||
| height: 1000%; | ||
| } | ||
|
|
||
| /* Control buttons */ | ||
| :where(.vds-button .vds-icon) { | ||
| border-radius: unset; | ||
| } | ||
|
|
||
| .vds-controls button { | ||
| border-radius: var(--media-button-border-radius); | ||
| } | ||
|
|
||
| :where(.vds-video-layout[data-sm]) :where(.vds-button) { | ||
| padding: 0px 4px !important; | ||
| } | ||
|
|
||
| /* Small layout volume / time slider */ | ||
| :where(.vds-video-layout[data-sm] .vds-volume-slider .vds-slider-track) { | ||
| background-color: var(--color-gray-600); | ||
| } | ||
| :where(.vds-video-layout[data-sm] .vds-volume-slider .vds-slider-track-fill) { | ||
| background-color: var(--color-secondary); | ||
| } | ||
| .vds-video-layout .vds-time-slider .vds-slider-value { | ||
| border: unset; | ||
| color: white; | ||
| } | ||
|
|
||
| /* Tooltip */ | ||
| .vds-tooltip-content::after { | ||
| content: ''; | ||
| -webkit-transform: rotate(45deg); | ||
| -moz-transform: rotate(45deg); | ||
| -ms-transform: rotate(45deg); | ||
| transform: rotate(45deg); | ||
| border-style: solid; | ||
| display: block; | ||
| width: 1rem; | ||
| height: 1rem; | ||
| position: absolute; | ||
| border-color: currentColor; | ||
| } | ||
| :where(.vds-tooltip-content[data-placement~='top'])::after { | ||
| border-width: 0 1px 1px 0; | ||
| bottom: -0.5rem; | ||
| left: calc(50% - 0.5rem); | ||
| background-image: linear-gradient( | ||
| to top left, | ||
| var(--color-background-contrast) 55%, | ||
| rgba(0, 0, 0, 0) 20% | ||
| ); | ||
| } | ||
|
|
||
| :where(.vds-tooltip-content[data-placement~='bottom'])::after { | ||
| border-width: 1px 0px 0px 1px; | ||
| top: -0.5rem; | ||
| left: calc(50% - 0.5rem); | ||
| background-image: linear-gradient( | ||
| to bottom right, | ||
| var(--color-background-contrast) 55%, | ||
| rgba(0, 0, 0, 0) 20% | ||
| ); | ||
| } | ||
|
|
||
| :where(.vds-tooltip-content[data-placement~='start'])::after { | ||
| left: calc(0% + 0.5rem); | ||
| } | ||
| :where(.vds-tooltip-content[data-placement~='end'])::after { | ||
| left: unset; | ||
| right: calc(0% + 0.5rem); | ||
| } | ||
|
|
||
| @keyframes vds-tooltip-exit { | ||
| 0% { | ||
| opacity: 1; | ||
| } | ||
| 100% { | ||
| opacity: 0; | ||
| } | ||
| } | ||
| @keyframes vds-tooltip-enter { | ||
| 0% { | ||
| opacity: 0; | ||
| } | ||
| 100% { | ||
| opacity: 1; | ||
| } | ||
| } | ||
| `; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @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"; | ||
|
Comment on lines
+1
to
+3
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think importing these via JS imports is technically more compatible with tools like vite. the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tho this may be deduped by emotion itself? idk just something to think about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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