Skip to content

Commit

Permalink
feat: Support iframes in container media content
Browse files Browse the repository at this point in the history
  • Loading branch information
avinashbot committed Aug 25, 2023
1 parent ebe2f92 commit f4ae284
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/__snapshots__/documenter.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5007,7 +5007,7 @@ all containers to the height of the longest one, to avoid extra vertical scroll
Object {
"description": "Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.
You can define different positions and sizes for the media element within the container.
* \`content\` - Use this slot to render your media element. We support \`img\`, \`video\` and \`picture\` elements.
* \`content\` - Use this slot to render your media element. We support \`img\`, \`video\`, \`picture\`, and \`iframe\` elements.

* \`position\` - Defines the media slot's position within the container. Defaults to \`top\`.

Expand Down
6 changes: 2 additions & 4 deletions src/container/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface ContainerProps extends BaseComponentProps {
* Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.
* You can define different positions and sizes for the media element within the container.
*
* * `content` - Use this slot to render your media element. We support `img`, `video` and `picture` elements.
* * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.
*
* * `position` - Defines the media slot's position within the container. Defaults to `top`.
*
Expand Down Expand Up @@ -72,9 +72,7 @@ export interface ContainerProps extends BaseComponentProps {
export namespace ContainerProps {
export interface Media {
/**
*
* Use this slot to render your media element. We support `img`, `video` and `picture` elements.
*
* Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.
*/
content: React.ReactNode;

Expand Down
3 changes: 2 additions & 1 deletion src/container/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
// stylelint-disable-next-line @cloudscape-design/no-implicit-descendant, selector-max-type
img,
video,
picture {
picture,
iframe {
width: 100%;
height: 100%;
object-fit: cover;
Expand Down

0 comments on commit f4ae284

Please sign in to comment.