mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
chore(icon_pack): generate root declaration
This commit is contained in:
parent
b157cd909c
commit
93a3b29677
@ -126,8 +126,12 @@ describe("CSS generation", () => {
|
|||||||
expect(processedResult).toBeTruthy();
|
expect(processedResult).toBeTruthy();
|
||||||
const css = generateCss(processedResult!);
|
const css = generateCss(processedResult!);
|
||||||
|
|
||||||
|
console.log(css);
|
||||||
expect(css).toContain("@font-face");
|
expect(css).toContain("@font-face");
|
||||||
expect(css).toContain("font-family: 'trilium-icon-pack-bx'");
|
expect(css).toContain("font-family: 'trilium-icon-pack-bx'");
|
||||||
expect(css).toContain(`src: url('/api/attachments/${processedResult?.fontAttachmentId}/download') format('woff2');`);
|
expect(css).toContain(`src: url('/api/attachments/${processedResult?.fontAttachmentId}/download') format('woff2');`);
|
||||||
|
|
||||||
|
expect(css).toContain("@font-face");
|
||||||
|
expect(css).toContain("font-family: 'trilium-icon-pack-bx' !important;");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -70,5 +70,18 @@ export function generateCss(processedIconPack: ProcessResult) {
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
src: url('/api/attachments/${processedIconPack.fontAttachmentId}/download') format('${MIME_TO_CSS_FORMAT_MAPPINGS[processedIconPack.fontMime]}');
|
src: url('/api/attachments/${processedIconPack.fontAttachmentId}/download') format('${MIME_TO_CSS_FORMAT_MAPPINGS[processedIconPack.fontMime]}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.${processedIconPack.manifest.prefix} {
|
||||||
|
font-family: 'trilium-icon-pack-${processedIconPack.manifest.prefix}' !important;
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
font-variant: normal;
|
||||||
|
line-height: 1;
|
||||||
|
text-rendering: auto;
|
||||||
|
display: inline-block;
|
||||||
|
text-transform: none;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user