将插件形式改为自定义scss直接合并入index.css

This commit is contained in:
ArenaDruid 2025-02-06 19:26:37 +08:00
parent 5c62251be2
commit c187ff39d3
5 changed files with 22 additions and 44 deletions

View File

@ -77,9 +77,7 @@ const config: QuartzConfig = {
// Adds image caption support. Syntax:
Plugin.FigureCaptions(),
// 启动中文斜体转楷体插件
Plugin.ChineseItalic(),
// Adds image lightbox support
//Plugin.Lightbox(),
//Plugin.ChineseItalic(),
],
filters: [
//Plugin.RemoveDrafts(),

View File

@ -1,16 +0,0 @@
import { QuartzTransformerPlugin } from "../types"
interface Options {
// 可扩展选项(如自定义字体名)
}
export const ChineseItalic: QuartzTransformerPlugin<Options> = (opts) => {
return {
name: "ChineseItalic",
externalResources() {
return {
css: [{ content: "static/chinese-italic-kaiti.css" }],
}
},
}
}

View File

@ -12,4 +12,3 @@ export { TableOfContents } from "./toc"
export { HardLineBreaks } from "./linebreaks"
export { RoamFlavoredMarkdown } from "./roam"
export { FigureCaptions } from "./figcaptions"
export { ChineseItalic } from "./chinese-italic"

View File

@ -1,23 +0,0 @@
/* Copyright (c) 2025 Github@ArenaDruid | MIT License */
/* 定义中文斜体专用字体 */
@font-face {
font-family: 'ChineseItalic';
font-style: italic;
src: local('楷体'),
local('Kaiti SC'),
local('STKaiti');
unicode-range: U+4E00-9FFF; /* 中文字符范围 */
}
/* 智能应用规则 */
em, .cm-em, i {
font-family:
-apple-system, /* 西文字体栈 */
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'ChineseItalic', /* 中文斜体触发 */
sans-serif;
font-style: italic; /* 必须保持斜体状态 */
}

View File

@ -1,3 +1,23 @@
@use "./base.scss";
// put your custom CSS here!
// put your custom CSS here!
/* Copyright (c) 2025 Github@ArenaDruid | MIT License */
/* 定义中文斜体专用字体 */
@font-face {
font-family: 'ChineseItalic';
font-style: italic;
src: local('楷体'),
local('Kaiti SC'),
local('STKaiti');
unicode-range: U+4E00-9FFF; /* 中文字符范围 */
}
/* 智能应用规则 */
em, .cm-em, i {
font-family:
'ChineseItalic', /* 中文斜体触发 */
var(--bodyFont);
font-style: italic; /* 必须保持斜体状态 */
}