Skip to content

Commit b3a856f

Browse files
jackyzha0MasssiveJuice08
authored andcommitted
fix: responsive youtube embed (closes #1167)
1 parent a627b11 commit b3a856f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

quartz/plugins/transformers/ofm.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
624624
// YouTube video (with optional playlist)
625625
node.tagName = "iframe"
626626
node.properties = {
627-
class: "external-embed",
627+
class: "external-embed youtube",
628628
allow: "fullscreen",
629629
frameborder: 0,
630630
width: "600px",
631-
height: "350px",
632631
src: playlistId
633632
? `https://www.youtube.com/embed/${videoId}?list=${playlistId}`
634633
: `https://www.youtube.com/embed/${videoId}`,
@@ -637,11 +636,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
637636
// YouTube playlist only.
638637
node.tagName = "iframe"
639638
node.properties = {
640-
class: "external-embed",
639+
class: "external-embed youtube",
641640
allow: "fullscreen",
642641
frameborder: 0,
643642
width: "600px",
644-
height: "350px",
645643
src: `https://www.youtube.com/embed/videoseries?list=${playlistId}`,
646644
}
647645
}

quartz/styles/base.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,5 +542,12 @@ ol.overflow {
542542
overflow-y: hidden;
543543
}
544544

545+
.external-embed.youtube {
546+
aspect-ratio: 16 / 9;
547+
height: 100%;
548+
width: 100%;
549+
border-radius: 5px;
550+
}
551+
545552
/* ====================================== */
546553
/* -- Below are MMW Edits to base.scss -- */

0 commit comments

Comments
 (0)