Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .nx/version-plans/version-plan-1783360840721.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
gamut: minor
---

remove scss from video
2 changes: 1 addition & 1 deletion packages/gamut/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"rm -rf ./dist",
"babel ./src --out-dir ./dist --extensions \".ts,.tsx\"",
"tsc --emitDeclarationOnly --project ./tsconfig.lib.json",
"cpy './src/**/*.{d.ts,scss,svg,png}' ./dist"
"cpy './src/**/*.{d.ts,scss,css,svg,png}' ./dist"
],
"parallel": false
}
Expand Down
6 changes: 4 additions & 2 deletions packages/gamut/src/Video/lib/VidstackPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Third-party Vidstack default theme styles */
/* eslint-disable gamut/no-css-standalone */
import '../styles/vds_base_theme.scss';
import '../vidstack-vendor.css';

import { styledOptions } from '@codecademy/gamut-styles';
import styled, { CSSObject } from '@emotion/styled';
Expand All @@ -18,13 +19,14 @@ import React, { useRef } from 'react';

import { Box } from '../../Box';
import { VideoProps } from '..';
import { vdsBaseThemeStyles } from '../styles';
import { keyboardShortcuts } from './utils/constants';
import { vdsVariables } from './utils/variables';
import { VideoLayout } from './VideoLayout';

const VariableProvider = styled(Box, styledOptions(['variables']))<{
variables?: CSSObject;
}>(({ variables }) => variables, {
}>(({ variables }) => variables, vdsBaseThemeStyles, {
width: '100%',
height: '100%',
position: 'relative',
Expand Down
101 changes: 101 additions & 0 deletions packages/gamut/src/Video/styles.ts
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;
}
}
`;
101 changes: 0 additions & 101 deletions packages/gamut/src/Video/styles/vds_base_theme.scss

This file was deleted.

3 changes: 3 additions & 0 deletions packages/gamut/src/Video/vidstack-vendor.css
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";
Loading