mirror of
https://github.com/KazooTTT/kazoottt-blog-v2.git
synced 2025-06-16 23:41:20 +08:00
feat: add quote type
This commit is contained in:
@ -9,7 +9,14 @@ import type { Plugin } from "unified";
|
||||
import { visit } from "unist-util-visit";
|
||||
|
||||
// Supported admonition types
|
||||
const Admonitions = new Set<AdmonitionType>(["tip", "note", "important", "caution", "warning"]);
|
||||
const Admonitions = new Set<AdmonitionType>([
|
||||
"tip",
|
||||
"note",
|
||||
"important",
|
||||
"caution",
|
||||
"warning",
|
||||
"quote",
|
||||
]);
|
||||
|
||||
/** Checks if a string is a supported admonition type. */
|
||||
function isAdmonition(s: string): s is AdmonitionType {
|
||||
|
@ -110,6 +110,11 @@
|
||||
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' width='16' height='16' aria-hidden='true'%3E%3Cpath d='M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z'%3E%3C/path%3E%3C/svg%3E");
|
||||
}
|
||||
}
|
||||
|
||||
&[data-admonition-type="quote"] {
|
||||
--admonition-color: var(--color-gray-500);
|
||||
@apply bg-gray-500/5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,4 +81,4 @@ export interface Summary {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type AdmonitionType = "tip" | "note" | "important" | "caution" | "warning";
|
||||
export type AdmonitionType = "tip" | "note" | "important" | "caution" | "warning" | "quote";
|
||||
|
Reference in New Issue
Block a user