Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions web/src/pages/TemplatesPage/TemplatesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,19 +359,19 @@ export function TemplatesPage() {
</div>
</section>
)}
{officialStarters.length > 0 && (
{defaultStarters.length > 0 && (
<section
className={styles.section}
aria-labelledby="official-note-types-heading"
aria-labelledby="starter-note-types-heading"
>
<h2
id="official-note-types-heading"
id="starter-note-types-heading"
className={styles.sectionHeading}
>
Official 2anki templates
Starter note types
</h2>
<div className={styles.grid}>
{officialStarters.map((starter) => (
{defaultStarters.map((starter) => (
<NoteTypeCard
key={starter.id}
starter={starter}
Expand All @@ -384,19 +384,19 @@ export function TemplatesPage() {
</div>
</section>
)}
{defaultStarters.length > 0 && (
{officialStarters.length > 0 && (
<section
className={styles.section}
aria-labelledby="starter-note-types-heading"
aria-labelledby="official-note-types-heading"
>
<h2
id="starter-note-types-heading"
id="official-note-types-heading"
className={styles.sectionHeading}
>
Starter note types
Official 2anki templates
</h2>
<div className={styles.grid}>
{defaultStarters.map((starter) => (
{officialStarters.map((starter) => (
<NoteTypeCard
key={starter.id}
starter={starter}
Expand Down
4 changes: 3 additions & 1 deletion web/src/pages/TemplatesPage/renderNoteTypePreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ export function buildPreviewDocument(
): string {
const body = renderCardSide(noteType, previewData, side);
return `<!doctype html><html><head><meta charset="utf-8"><base target="_blank"><style>
html, body { margin: 0; padding: 0; width: 100%; height: 100%; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: #fff; color: #111; }
body { overflow: hidden; display: flex; }
body > .card { flex: 1; min-height: 100%; box-sizing: border-box; }
${noteType.css ?? ''}
html, body { margin: 0 !important; padding: 0 !important; max-width: none !important; width: 100% !important; height: 100% !important; }
body { display: flex !important; }
</style></head><body><div class="card">${body}</div></body></html>`;
}