Skip to content

Commit a70f3df

Browse files
authored
Merge pull request #82 from adobe/iframe
feat: iframe block
2 parents 6269acc + a442d62 commit a70f3df

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

blocks/iframe/iframe.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@media (min-width: 100px) {
2+
main .section > div.iframe-wrapper {
3+
margin: 0 auto;
4+
padding: 0;
5+
max-width: 1000px;
6+
}
7+
8+
main iframe {
9+
border: none;
10+
width: 100%;
11+
height: 4000px;
12+
max-height: calc(100vh - var(--nav-height));
13+
}
14+
}

blocks/iframe/iframe.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function decorate(block) {
2+
const iframe = document.createElement('iframe');
3+
iframe.src = new URL(block.textContent.trim());
4+
iframe.sandbox = 'allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms allow-storage-access-by-user-activation';
5+
block.innerHTML = '';
6+
block.append(iframe);
7+
}

0 commit comments

Comments
 (0)