Skip to content
Merged
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
6 changes: 0 additions & 6 deletions src/@chakra-ui/gatsby-plugin/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ const styles = {
"li > p": {
"margin-bottom": "calc(1.45rem / 2)",
},
// YouTube embeds
iframe: {
display: "block",
maxWidth: "560px",
margin: "32px 0",
},
// should be replace by the usage of https://chakra-ui.com/docs/components/heading
// also, the media queries defined on each of these heading tags are bearly used
"h1,h2,h3,h4,h5,h6": {
Expand Down
10 changes: 4 additions & 6 deletions src/components/YouTube.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Box } from "@chakra-ui/react"
import { AspectRatio } from "@chakra-ui/react"

/**
* @param {id} ID of the YouTube video
Expand All @@ -22,10 +22,8 @@ const YouTube: React.FC<IProps> = ({ id, start = "0", title = "YouTube" }) => {
const baseUrl = "https://www.youtube.com/embed/"
const src = baseUrl + id + startQuery
return (
<Box as="figure" display="block" my={4}>
<AspectRatio as="figure" maxW="560px" ratio={16 / 9} my={8}>
<iframe
width="100%"
height="315"
src={src}
frameBorder="0"
title={title}
Expand All @@ -37,8 +35,8 @@ const YouTube: React.FC<IProps> = ({ id, start = "0", title = "YouTube" }) => {
gyroscope;
picture-in-picture"
allowFullScreen
></iframe>
</Box>
/>
</AspectRatio>
)
}

Expand Down