Obsidian css snippets

"naked" transclusion

.markdown-embed-title { display:none; } .markdown-preview-view .markdown-embed { border:none; padding:0; margin:0; } .markdown-preview-view .markdown-embed-content { max-height: unset;} .markdown-preview-view .markdown-embed-content>:first-child { margin-top: 0; } .markdown-preview-view .markdown-embed-content>:last-child { margin-bottom: 0; }

export to PDF

/* Line up "native" blockquotes with transcluded ones in PDF */
@media print{.internal-embed{margin-left:-30px;}}

/* Page breaks */
@media print {
  h1 { 
    page-break-before: always;
  }
  h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  pre, blockquote {
    page-break-inside: avoid;
  }
}

Mermaid diagrams don't overflow when exporting to PDF

@media print {
  .mermaid > svg {
    max-width: 100%;
    max-height: 100%;
    page-break-inside: avoid;
  }
}

prevent everywhere

.mermaid > svg {
	max-width: 100%;
}

one slide per page

@media print {
  hr {
    page-break-after: always;
  }
}
.internal-link.is-unresolved { opacity: 0.6; color: var(--neutral-blue); }

(editor doesn't have unresolved links so you can't style those)