-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(showcase): embed section #89
Changes from 1 commit
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,10 @@ | ||
import React from 'react' | ||
|
||
import { IEmbed } from '../../types' | ||
import { Wrapper } from './styled' | ||
|
||
const Embed = (props: IEmbed) => { | ||
return <Wrapper dangerouslySetInnerHTML={{ __html: props.code }} /> | ||
} | ||
|
||
export default Embed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import styled from '@theme' | ||
|
||
export const Wrapper = styled.div` | ||
position: relative; | ||
padding-bottom: 56.25%; /* 16:9 */ | ||
padding-top: 25px; | ||
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. why this padding-top? I believe we don't have padding in any section and the sectionWrapper takes care of all the top and bottom spacings 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. These styles are about this: https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php |
||
height: 0; | ||
|
||
iframe { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
` |
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.
Can we safely assume that it's always 16:9?
cc @pedroet