Skip to content

Commit

Permalink
docs: remove unnecessary wrapping divs.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Jan 26, 2022
1 parent a853de4 commit 2c31854
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 35 deletions.
56 changes: 26 additions & 30 deletions website/docs/how-to/VideoThing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@ import Admonition from '@theme/Admonition';

const Component = ({ videoUrls, children }) => {
return (
<article className="unleash-video-wrapper">
<div className="unleash-video-container">
<Admonition type="tip" title="Video content">
{children}
Hey! Did you know that the content in this guide is also
available in video format? If that's more your speed, feel
free to check out one of these related videos 🍿📽
</Admonition>
<article className="unleash-video-container">
<Admonition type="tip" title="Video content">
{children}
Hey! Did you know that the content in this guide is also
available in video format? If that's more your speed, feel free
to check out one of these related videos 🍿📽
</Admonition>

<div className="videos">
{videoUrls ? (
videoUrls.map((url) => (
<div className="video-wrapper">
<iframe
key={url}
width="100%"
height="auto"
src={url}
title="YouTube video player"
frameBorder="0"
allowFullScreen
></iframe>
</div>
))
) : (
<Admonition type="danger">
You need to provide YouTube video URLs for this
component to work properly.
</Admonition>
)}
</div>
<div className="videos">
{videoUrls ? (
videoUrls.map((url) => (
<iframe
key={url}
width="100%"
height="auto"
src={url}
title="YouTube video player"
frameBorder="0"
allowFullScreen
></iframe>
))
) : (
<Admonition type="danger">
You need to provide YouTube video URLs for this
component to work properly.
</Admonition>
)}
</div>
</article>
);
Expand Down
11 changes: 6 additions & 5 deletions website/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ html[data-theme='dark'] .header-github-link:before {
no-repeat;
}

/* Video content container */

.unleash-video-container {
display: grid;
--gap: 0.5em;
Expand All @@ -86,10 +88,6 @@ html[data-theme='dark'] .header-github-link:before {
gap: var(--gap);
}

.video-wrapper {
display: flex;
}

.unleash-video-container > .admonition {
box-shadow: none;
background-color: var(--unleash-color-admonition-background);
Expand All @@ -107,7 +105,10 @@ html[data-theme='dark'] .header-github-link:before {
grid-template-columns: 1fr min(250px, 25%);
}
.unleash-video-container > .videos {
grid-template-columns: 1fr;
display: flex;
flex-direction: column;
gap: var(--gap);
}
}

/* end video content container */

0 comments on commit 2c31854

Please sign in to comment.