chore: tweak

This commit is contained in:
pengzhanbo 2024-06-16 19:41:52 +08:00
parent d45dfd667b
commit 08bf8a08eb
12 changed files with 257 additions and 248 deletions

View File

@ -66,7 +66,7 @@ const createTime = computed(() =>
<span>{{ createTime }}</span>
</div>
</div>
<div v-if="post.excerpt" class="plume-content excerpt" v-html="post.excerpt" />
<div v-if="post.excerpt" class="vp-doc excerpt" v-html="post.excerpt" />
</div>
</template>
@ -205,19 +205,19 @@ const createTime = computed(() =>
transition: color var(--t-color);
}
.plume-content :deep(p) {
.vp-doc :deep(p) {
margin: 0.5rem 0;
}
.plume-content :deep(p:first-of-type) {
.vp-doc :deep(p:first-of-type) {
margin-top: 0;
}
.plume-content :deep(p:last-of-type) {
.vp-doc :deep(p:last-of-type) {
margin-bottom: 0;
}
.plume-content :deep(p strong) {
.vp-doc :deep(p strong) {
color: var(--vp-c-text-2);
transition: color var(--t-color);
}

View File

@ -8,6 +8,6 @@ const props = defineProps<PlumeThemeHomeCustom>()
<template>
<VPHomeBox class="vp-home-custom" v-bind="props">
<Content class="vp-doc plume-content" />
<Content class="vp-doc" />
</VPHomeBox>
</template>

View File

@ -29,7 +29,7 @@ const maxWidth = computed(() => {
<VPImage :image="image" :style="{ maxWidth }" />
</div>
<div class="content-text plume-content">
<div class="content-text vp-doc">
<section>
<h2 v-if="title" class="title">
{{ title }}

View File

@ -43,7 +43,7 @@ export type MenuItem = Omit<Header, 'slug' | 'children'> & {
export function getHeaders(range?: ThemeOutline): MenuItem[] {
const headers = Array.from(
document.querySelectorAll('.plume-content :where(h1,h2,h3,h4,h5,h6)'),
document.querySelectorAll('.vp-doc :where(h1,h2,h3,h4,h5,h6)'),
)
.filter(el => el.id && el.hasChildNodes())
.map((el) => {

View File

@ -12,7 +12,7 @@ export function setupWatermark(): void {
defineWatermarkConfig(computed(() => {
const disableFullPage = typeof frontmatter.value.watermark === 'object' && frontmatter.value.watermark.fullPage === false
return {
parent: !FP || disableFullPage ? '.plume-content' : 'body',
parent: !FP || disableFullPage ? '.vp-doc' : 'body',
}
}))
}

View File

@ -6,7 +6,7 @@ html:not(.dark) .vp-code span {
color: var(--shiki-light, rgba(60, 60, 67, 0.78));
}
.plume-content pre {
div[class*="language-"] pre {
padding: 1.3rem 1.5rem;
margin: 0 0 0.85rem;
overflow-x: auto;
@ -14,26 +14,27 @@ html:not(.dark) .vp-code span {
scrollbar-width: thin;
}
.plume-content pre code {
div[class*="language-"] code {
padding: 0;
font-size: var(--vp-code-font-size);
line-height: var(--vp-code-line-height);
color: var(--vp-code-block-color);
overflow-wrap: unset;
background-color: transparent;
border-radius: 0;
transition: background-color, var(--t-color), color var(--t-color);
transition: background-color var(--t-color), color var(--t-color);
-webkit-font-smoothing: auto;
-moz-osx-font-smoothing: auto;
}
@media (min-width: 640px) {
.plume-content pre {
div[class*="language-"] pre {
border-radius: 6px;
}
}
.plume-content .line-number {
.vp-doc .line-number {
font-family: var(--vp-font-family-mono);
}
@ -41,16 +42,16 @@ div[class*="language-"] {
position: relative;
margin: 0.85rem -1.5rem;
background-color: var(--vp-code-block-bg);
transition: background-color, var(--t-color);
transition: background-color var(--t-color);
}
.plume-content .code-tabs div[class*="language-"] {
.vp-doc .code-tabs div[class*="language-"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
@media (max-width: 639px) {
.plume-content li pre {
.vp-doc li pre {
border-radius: 8px 0 0 8px;
}
}
@ -62,7 +63,7 @@ div[class*="language-"]::before {
z-index: 3;
font-size: 0.75rem;
color: var(--vp-code-line-number-color);
content: attr(data-ext);
content: attr(data-title);
transition: color var(--t-color);
}
@ -146,7 +147,8 @@ div[class*="language-"].line-numbers-mode .line-numbers {
width: 2rem;
height: 100%;
padding-top: 1.3rem;
line-height: 1.4rem;
font-size: var(--vp-code-font-size);
line-height: var(--vp-code-line-height);
color: var(--vp-code-line-number-color);
text-align: center;
counter-reset: line-number;
@ -157,7 +159,6 @@ div[class*="language-"].line-numbers-mode .line-numbers {
div[class*="language-"].line-numbers-mode .line-numbers .line-number {
position: relative;
z-index: 3;
height: 1.5rem;
user-select: none;
}
@ -175,12 +176,12 @@ div[class*="language-"].line-numbers-mode .line-numbers .line-number::before {
}
@media (max-width: 639px) {
.plume-content li div[class*="language-"] {
.vp-doc li div[class*="language-"] {
border-radius: 8px 0 0 8px;
}
}
.plume-content div[class*="language-"] code .highlighted {
.vp-doc div[class*="language-"] code .highlighted {
z-index: 2;
display: inline-block;
width: calc(100% + 48px);
@ -190,15 +191,15 @@ div[class*="language-"].line-numbers-mode .line-numbers .line-number::before {
transition: background-color 0.5s;
}
.plume-content div[class*="language-"] code .highlighted.error {
.vp-doc div[class*="language-"] code .highlighted.error {
background-color: var(--vp-code-line-error-color);
}
.plume-content div[class*="language-"] code .highlighted.warning {
.vp-doc div[class*="language-"] code .highlighted.warning {
background-color: var(--vp-code-line-warning-color);
}
.plume-content div[class*="language-"] code .highlighted-word {
.vp-doc div[class*="language-"] code .highlighted-word {
padding: 1px 3px;
margin: -1px -3px;
background-color: var(--vp-c-gray-soft);
@ -206,24 +207,24 @@ div[class*="language-"].line-numbers-mode .line-numbers .line-number::before {
border-radius: 4px;
}
.plume-content div[class*="language-"] code .tab,
.plume-content div[class*="language-"] code .space {
.vp-doc div[class*="language-"] code .tab,
.vp-doc div[class*="language-"] code .space {
position: relative;
}
.plume-content div[class*="language-"] code .tab::before {
.vp-doc div[class*="language-"] code .tab::before {
position: absolute;
content: "⇥";
opacity: 0.3;
}
.plume-content div[class*="language-"] code .space::before {
.vp-doc div[class*="language-"] code .space::before {
position: absolute;
content: "·";
opacity: 0.3;
}
.plume-content div[class*="language-"] code .diff {
.vp-doc div[class*="language-"] code .diff {
display: inline-block;
width: calc(100% + 48px);
padding: 0 24px;
@ -231,39 +232,39 @@ div[class*="language-"].line-numbers-mode .line-numbers .line-number::before {
transition: background-color 0.5s;
}
.plume-content div[class*="language-"] code .diff::before {
.vp-doc div[class*="language-"] code .diff::before {
position: absolute;
left: 10px;
}
.plume-content div[class*="language-"] code .diff.remove {
.vp-doc div[class*="language-"] code .diff.remove {
background-color: var(--vp-code-line-diff-remove-color);
opacity: 0.7;
}
.plume-content div[class*="language-"] code .diff.remove::before {
.vp-doc div[class*="language-"] code .diff.remove::before {
color: var(--vp-code-line-diff-remove-symbol-color);
content: "-";
transform: translateX(-6px);
}
.plume-content div[class*="language-"] code .diff.add {
.vp-doc div[class*="language-"] code .diff.add {
background-color: var(--vp-code-line-diff-add-color);
}
.plume-content div[class*="language-"] code .diff.add::before {
.vp-doc div[class*="language-"] code .diff.add::before {
color: var(--vp-code-line-diff-add-symbol-color);
content: "+";
transform: translateX(-6px);
}
.plume-content div[class*="language-"] .has-focused-lines .line:not(.has-focus) {
.vp-doc div[class*="language-"] .has-focused-lines .line:not(.has-focus) {
filter: blur(0.095rem);
opacity: 0.7;
transition: filter 0.35s, opacity 0.35s;
}
.plume-content div[class*="language-"]:hover .has-focused-lines .line:not(.has-focus) {
.vp-doc div[class*="language-"]:hover .has-focused-lines .line:not(.has-focus) {
filter: blur(0);
opacity: 1;
}

View File

@ -1,32 +1,30 @@
.plume-content {
.vp-doc {
position: relative;
}
/**
* Headings
* -------------------------------------------------------------------------- */
.plume-content h1,
.plume-content h2,
.plume-content h3,
.plume-content h4,
.plume-content h5,
.plume-content h6 {
.vp-doc h1,
.vp-doc h2,
.vp-doc h3,
.vp-doc h4,
.vp-doc h5,
.vp-doc h6 {
position: relative;
margin: 16px 0;
font-weight: 600;
color: var(--vp-c-text-1);
overflow-wrap: break-word;
outline: none;
transition: color var(--t-color);
}
.plume-content h1 {
.vp-doc h1 {
font-size: 28px;
line-height: 40px;
letter-spacing: -0.02em;
}
.plume-content h2 {
.vp-doc h2 {
padding-top: 24px;
margin: 48px 0 16px;
font-size: 24px;
@ -36,37 +34,46 @@
transition: border-top var(--t-color), color var(--t-color);
}
.plume-content h2:first-of-type {
.vp-doc h2:first-of-type {
border-top: none;
}
.plume-content h3 {
margin: 32px 0 16px;
.vp-doc h3 {
margin: 32px 0 0;
font-size: 20px;
line-height: 28px;
letter-spacing: -0.01em;
}
.plume-content .header-anchor {
.vp-doc .header-anchor {
position: relative;
color: inherit;
text-decoration: none;
}
.plume-content .header-anchor:hover::before {
.vp-doc .header-anchor::before {
position: absolute;
left: -0.75em;
font-size: 0.8em;
color: var(--vp-c-brand-1);
content: var(--vp-header-anchor-symbol);
opacity: 0;
transition: color var(--t-color);
}
.plume-content .header-anchor:focus-visible {
.vp-doc .header-anchor:hover {
color: inherit;
}
.vp-doc .header-anchor:hover::before {
opacity: 1;
}
.vp-doc .header-anchor:focus-visible {
outline: none;
}
.plume-content .header-anchor:focus-visible::before {
.vp-doc .header-anchor:focus-visible::before {
position: absolute;
left: -0.75em;
color: var(--vp-c-brand-1);
@ -75,54 +82,50 @@
}
@media (min-width: 768px) {
.plume-content h1 {
.vp-doc h1 {
font-size: 32px;
line-height: 40px;
letter-spacing: -0.02em;
}
}
.plume-content img {
display: inline-block;
}
.plume-content img + img {
.vp-doc img + img {
margin-left: 0.5rem;
}
.plume-content a img + span {
.vp-doc a img + span {
margin-left: 0.2rem;
}
/**
* Paragraph and inline elements
* -------------------------------------------------------------------------- */
.plume-content p,
.plume-content summary {
.vp-doc p,
.vp-doc summary {
margin: 16px 0;
color: var(--vp-c-text-1);
transition: color var(--t-color);
}
.plume-content p {
.vp-doc p {
line-height: 28px;
}
.plume-content blockquote {
.vp-doc blockquote {
padding-left: 16px;
margin: 16px 0;
border-left: 2px solid var(--vp-c-divider);
transition: border-color var(--t-color);
}
.plume-content blockquote > p {
.vp-doc blockquote > p {
margin: 0;
font-size: 16px;
color: var(--vp-c-text-2);
transition: color var(--t-color);
}
.plume-content a {
.vp-doc a {
font-weight: 500;
color: var(--vp-c-brand-1);
text-decoration: underline;
@ -131,75 +134,79 @@
}
@media print {
.plume-content a[href^="http://"]::after, .plume-content a[href^="https://"]::after {
.vp-doc a[href^="http://"]::after, .vp-doc a[href^="https://"]::after {
content: " (" attr(href) ") ";
}
}
.plume-content :not(h1, h2, h3, h4, h5, h6) a:hover {
.vp-doc :not(h1, h2, h3, h4, h5, h6) a:hover {
color: var(--vp-c-brand-2);
text-underline-offset: 5px;
}
.plume-content strong {
.vp-doc strong {
font-weight: 600;
}
.vp-doc a > img {
display: inline-block;
}
/**
* Lists
* -------------------------------------------------------------------------- */
.plume-content ul,
.plume-content ol {
.vp-doc ul,
.vp-doc ol {
padding-left: 1.25rem;
margin: 16px 0;
}
.plume-content ul {
.vp-doc ul {
list-style: disc;
}
.plume-content ol {
.vp-doc ol {
list-style: decimal;
}
.plume-content li + li {
.vp-doc li + li {
margin-top: 8px;
}
.plume-content li > ol,
.plume-content li > ul {
.vp-doc li > ol,
.vp-doc li > ul {
margin: 8px 0 0;
}
/**
* Table
* -------------------------------------------------------------------------- */
.plume-content table {
.vp-doc table {
display: block;
margin: 20px 0;
overflow-x: auto;
border-collapse: collapse;
}
.plume-content tr {
.vp-doc tr {
background-color: var(--vp-c-bg);
border-top: 1px solid var(--vp-c-divider);
transition: var(--t-color);
transition-property: background-color, border-top;
}
.plume-content tr:nth-child(2n) {
.vp-doc tr:nth-child(2n) {
background-color: var(--vp-c-bg-soft);
}
.plume-content th,
.plume-content td {
.vp-doc th,
.vp-doc td {
padding: 8px 16px;
border: 1px solid var(--vp-c-divider);
transition: border var(--t-color);
}
.plume-content th {
.vp-doc th {
font-size: 14px;
font-weight: 600;
color: var(--vp-c-text-2);
@ -209,14 +216,14 @@
transition-property: color, background-color, border;
}
.plume-content td {
.vp-doc td {
font-size: 14px;
}
/**
* Decorational elements
* -------------------------------------------------------------------------- */
.plume-content hr {
.vp-doc hr {
margin: 16px 0;
border: none;
border-top: 1px solid var(--vp-c-divider);
@ -224,42 +231,41 @@
}
/**
* Code
* inline Code
* -------------------------------------------------------------------------- */
/* inline code */
.plume-content :not(pre, h1, h2, h3, h4, h5, h6) > code {
.vp-doc :not(pre, h1, h2, h3, h4, h5, h6) > code {
font-size: var(--vp-code-font-size);
color: var(--vp-code-color);
transition: color var(--t-color);
}
.plume-content :not(pre) > code {
.vp-doc :not(pre) > code {
padding: 3px 6px;
background-color: var(--vp-code-bg);
border-radius: 4px;
transition: color var(--t-color), background-color var(--t-color);
}
.plume-content h1 > code,
.plume-content h2 > code,
.plume-content h3 > code {
.vp-doc h1 > code,
.vp-doc h2 > code,
.vp-doc h3 > code {
font-size: 0.9em;
}
.plume-content a > code {
.vp-doc a > code {
color: var(--vp-code-link-color);
transition: color var(--t-color);
}
.plume-content a:hover > code {
.vp-doc a:hover > code {
color: var(--vp-code-link-hover-color);
}
/**
* External links
* -------------------------------------------------------------------------- */
:is(.vp-external-link-icon, .plume-content a[href*="://"], .plume-content a[target=_blank]):not(.no-icon)::after {
:is(.vp-external-link-icon, .vp-doc a[href*="://"], .vp-doc a[target=_blank]):not(.no-icon)::after {
--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");
display: inline-block;
@ -279,7 +285,7 @@
}
/* prettier-ignore */
.external-link-icon-enabled :is(.plume-content a[href*="://"], .plume-content a[target=_blank])::after {
.external-link-icon-enabled :is(.vp-doc a[href*="://"], .vp-doc a[target=_blank])::after {
color: currentcolor;
content: "";
}

View File

@ -1,7 +1,7 @@
/* stylelint-disable no-descending-specificity */
/* ------------------ Markdown Enhance: Hint Container ------------------ */
.plume-content .hint-container {
.vp-doc .hint-container {
padding: 16px 16px 8px;
font-size: var(--vp-custom-block-font-size);
line-height: 24px;
@ -9,144 +9,144 @@
border-radius: 8px;
}
.plume-content .hint-container .hint-container-title {
.vp-doc .hint-container .hint-container-title {
margin-top: 0;
font-weight: 600;
}
.plume-content .hint-container p + p {
.vp-doc .hint-container p + p {
margin: 8px 0;
}
.plume-content .hint-container code {
.vp-doc .hint-container code {
font-size: var(--vp-custom-block-code-font-size);
color: inherit;
}
.plume-content .hint-container th,
.plume-content .hint-container blockquote > p {
.vp-doc .hint-container th,
.vp-doc .hint-container blockquote > p {
font-size: var(--vp-custom-block-font-size);
color: inherit;
}
.plume-content .hint-container div[class*="language-"] {
.vp-doc .hint-container div[class*="language-"] {
margin: 8px 0;
}
.plume-content .hint-container .vp-code-tab div[class*="language-"] {
.vp-doc .hint-container .vp-code-tab div[class*="language-"] {
margin: 0 0 8px;
}
.plume-content .hint-container div[class*="language-"] code {
.vp-doc .hint-container div[class*="language-"] code {
font-weight: 400;
background-color: transparent;
}
.plume-content .hint-container div[class*="language-"].line-numbers-mode .line-numbers {
.vp-doc .hint-container div[class*="language-"].line-numbers-mode .line-numbers {
line-height: 1.5rem;
}
@media (max-width: 419px) {
.plume-content .hint-container div[class*="language-"] {
.vp-doc .hint-container div[class*="language-"] {
margin: 0.85rem -0.75rem 0.85rem -1rem;
}
.plume-content .hint-container .vp-code-tab div[class*="language-"] {
.vp-doc .hint-container .vp-code-tab div[class*="language-"] {
margin: 0 -0.75rem 0.85rem -1rem;
}
}
.plume-content .hint-container.note {
.vp-doc .hint-container.note {
color: var(--vp-c-text-3);
border-radius: 0;
}
.plume-content .hint-container.info {
.vp-doc .hint-container.info {
color: var(--vp-custom-block-info-text);
}
.plume-content .hint-container.tip {
.vp-doc .hint-container.tip {
color: var(--vp-custom-block-tip-text);
}
.plume-content .hint-container.warning {
.vp-doc .hint-container.warning {
color: var(--vp-custom-block-warning-text);
}
.plume-content .hint-container.caution {
.vp-doc .hint-container.caution {
color: var(--vp-custom-block-danger-text);
}
.plume-content .hint-container.detail {
.vp-doc .hint-container.detail {
color: var(--vp-custom-block-detail-text);
}
.plume-content .hint-container.detail summary {
.vp-doc .hint-container.detail summary {
margin: -1.5rem -1.5rem -1.1rem;
font-weight: 700;
color: var(--vp-c-text-1);
cursor: pointer;
}
.plume-content .hint-container.detail summary + p {
.vp-doc .hint-container.detail summary + p {
margin: 8px 0;
}
.plume-content .hint-container.note a,
.plume-content .hint-container.note code,
.plume-content .hint-container.info a,
.plume-content .hint-container.info code,
.plume-content .hint-container.tip a,
.plume-content .hint-container.tip code,
.plume-content .hint-container.detail a,
.plume-content .hint-container.detail code {
.vp-doc .hint-container.note a,
.vp-doc .hint-container.note code,
.vp-doc .hint-container.info a,
.vp-doc .hint-container.info code,
.vp-doc .hint-container.tip a,
.vp-doc .hint-container.tip code,
.vp-doc .hint-container.detail a,
.vp-doc .hint-container.detail code {
color: var(--vp-c-brand-1);
}
.plume-content .hint-container.note a:hover,
.plume-content .hint-container.info a:hover,
.plume-content .hint-container.tip a:hover,
.plume-content .hint-container.detail a:hover {
.vp-doc .hint-container.note a:hover,
.vp-doc .hint-container.info a:hover,
.vp-doc .hint-container.tip a:hover,
.vp-doc .hint-container.detail a:hover {
color: var(--vp-c-brand-2);
}
.plume-content .hint-container.important a,
.plume-content .hint-container.important code {
.vp-doc .hint-container.important a,
.vp-doc .hint-container.important code {
color: var(--vp-c-purple-1);
}
.plume-content .hint-container.important a:hover {
.vp-doc .hint-container.important a:hover {
color: var(--vp-c-purple-2);
}
.plume-content .hint-container.warning a,
.plume-content .hint-container.warning code {
.vp-doc .hint-container.warning a,
.vp-doc .hint-container.warning code {
color: var(--vp-c-warning-1);
}
.plume-content .hint-container.warning a:hover {
.vp-doc .hint-container.warning a:hover {
color: var(--vp-c-warning-2);
}
.plume-content .hint-container.caution a,
.plume-content .hint-container.caution code {
.vp-doc .hint-container.caution a,
.vp-doc .hint-container.caution code {
color: var(--vp-c-danger-1);
}
.plume-content .hint-container.caution a:hover {
.vp-doc .hint-container.caution a:hover {
color: var(--vp-c-danger-2);
}
.plume-content .hint-container [class*="language-"] .line-numbers {
.vp-doc .hint-container [class*="language-"] .line-numbers {
padding-top: 21px;
}
/* ------------------ Markdown Enhance: Code Tabs ----------------------- */
.plume-content .code-tabs-nav {
.vp-doc .code-tabs-nav {
margin-bottom: 0;
}
.plume-content .vp-code-tabs-nav {
.vp-doc .vp-code-tabs-nav {
padding: 0 12px;
margin: 0.85rem 0 0;
overflow-y: hidden;
@ -155,7 +155,7 @@
transition: background-color var(--t-color), box-shadow var(--t-color);
}
.plume-content .vp-code-tab-nav {
.vp-doc .vp-code-tab-nav {
position: relative;
padding: 0 12px;
font-size: 14px;
@ -167,11 +167,11 @@
transition: color var(--t-color);
}
.plume-content .vp-code-tab-nav::before {
.vp-doc .vp-code-tab-nav::before {
display: none;
}
.plume-content .vp-code-tab-nav::after {
.vp-doc .vp-code-tab-nav::after {
position: absolute;
right: 8px;
bottom: -1px;
@ -186,106 +186,106 @@
transition: background var(--t-color);
}
.plume-content .vp-code-tab-nav.active {
.vp-doc .vp-code-tab-nav.active {
color: var(--vp-code-tab-active-text-color);
background: transparent;
}
.plume-content .vp-code-tab-nav.active::after {
.vp-doc .vp-code-tab-nav.active::after {
background: var(--vp-code-tab-active-bar-color);
}
.plume-content .vp-code-tab-nav:hover {
.vp-doc .vp-code-tab-nav:hover {
background: transparent;
}
@media (max-width: 419px) {
.plume-content .vp-code-tabs-nav {
.vp-doc .vp-code-tabs-nav {
margin: 0 -1.5rem -0.85rem;
}
.plume-content .hint-container .vp-code-tabs-nav {
.vp-doc .hint-container .vp-code-tabs-nav {
margin: 0.85rem -0.75rem 0 -1rem;
}
}
/* -------------------- Markdown Enhance: Code Demo -------------------- */
.plume-content .vp-code-demo {
.vp-doc .vp-code-demo {
overflow: hidden;
border: solid 1px var(--vp-c-divider);
transition: border var(--t-color);
}
@media (max-width: 419px) {
.plume-content .vp-code-demo .vp-code-demo-codes div[class*="language-"] {
.vp-doc .vp-code-demo .vp-code-demo-codes div[class*="language-"] {
margin: 0;
border-radius: 0;
}
}
.plume-content .vp-code-demo:hover {
.vp-doc .vp-code-demo:hover {
box-shadow: none;
}
.plume-content .vp-code-demo .vp-code-demo-header {
.vp-doc .vp-code-demo .vp-code-demo-header {
padding: 8px 12px;
transition: background-color var(--t-color);
}
.plume-content .vp-code-demo .vp-code-demo-code-wrapper {
.vp-doc .vp-code-demo .vp-code-demo-code-wrapper {
margin-bottom: -0.9rem;
}
.plume-content .vp-code-demo .vp-code-demo-toggle-button {
.vp-doc .vp-code-demo .vp-code-demo-toggle-button {
margin: 0 12px 0 8px;
background-color: var(--vp-c-gray-2);
transition: background-color var(--t-color);
}
.plume-content .vp-code-demo .vp-code-demo-toggle-button:hover {
.vp-doc .vp-code-demo .vp-code-demo-toggle-button:hover {
background-color: var(--vp-c-gray-1);
}
.plume-content .vp-code-demo .vp-code-demo-title {
.vp-doc .vp-code-demo .vp-code-demo-title {
font-size: 1rem;
line-height: 1.75;
}
.plume-content .vp-code-demo .vp-code-demo-display {
.vp-doc .vp-code-demo .vp-code-demo-display {
border-bottom: transparent;
}
.plume-content .vp-code-demo .code-demo-jsfiddle .jsfiddle-button,
.plume-content .vp-code-demo .code-demo-codepen .codepen-button {
.vp-doc .vp-code-demo .code-demo-jsfiddle .jsfiddle-button,
.vp-doc .vp-code-demo .code-demo-codepen .codepen-button {
background-color: transparent;
}
.plume-content .vp-code-demo .vp-code-demo-codes div[class*="language-"] {
.vp-doc .vp-code-demo .vp-code-demo-codes div[class*="language-"] {
border-bottom: 2px dashed var(--vp-c-divider);
transition: border-bottom var(--t-color);
}
.plume-content .vp-code-demo .vp-code-demo-codes div[class*="language-"]:first-of-type {
.vp-doc .vp-code-demo .vp-code-demo-codes div[class*="language-"]:first-of-type {
border-top: 1px solid var(--vp-c-divider);
}
.plume-content .vp-code-demo .vp-code-demo-codes div[class*="language-"]:last-of-type {
.vp-doc .vp-code-demo .vp-code-demo-codes div[class*="language-"]:last-of-type {
border-bottom: none;
}
.plume-content .vp-code-demo .vp-code-demo-codes div[class*="language-"] pre {
.vp-doc .vp-code-demo .vp-code-demo-codes div[class*="language-"] pre {
margin-bottom: 0;
border-radius: 0;
}
@media (max-width: 419px) {
.plume-content .vp-code-demo {
.vp-doc .vp-code-demo {
margin: 8px -12px;
}
}
/* -------------------- Markdown Enhance: markdown Demo -------------------- */
.plume-content .vp-md-demo {
.vp-doc .vp-md-demo {
margin-bottom: 16px;
overflow: hidden;
border: solid 1px var(--vp-c-divider);
@ -293,84 +293,84 @@
}
@media (max-width: 419px) {
.plume-content .vp-md-demo .vp-md-demo-codes div[class*="language-"] {
.vp-doc .vp-md-demo .vp-md-demo-codes div[class*="language-"] {
margin: 0;
border-radius: 0;
}
}
.plume-content .vp-md-demo:hover {
.vp-doc .vp-md-demo:hover {
box-shadow: none;
}
.plume-content .vp-md-demo .vp-md-demo-header {
.vp-doc .vp-md-demo .vp-md-demo-header {
padding: 8px 12px;
font-size: 16px;
line-height: 1.7;
transition: background-color var(--t-color);
}
.plume-content .vp-md-demo .vp-md-demo-toggle-button {
.vp-doc .vp-md-demo .vp-md-demo-toggle-button {
margin: 0 12px 0 8px;
background-color: var(--vp-c-gray-2);
transition: background-color var(--t-color);
}
.plume-content .vp-md-demo .vp-md-demo-toggle-button:hover {
.vp-doc .vp-md-demo .vp-md-demo-toggle-button:hover {
background-color: var(--vp-c-gray-1);
}
.plume-content .vp-md-demo .vp-md-demo-title {
.vp-doc .vp-md-demo .vp-md-demo-title {
font-size: 1rem;
line-height: 1.75;
}
.plume-content .vp-md-demo .vp-md-demo-display {
.vp-doc .vp-md-demo .vp-md-demo-display {
border-bottom: transparent;
}
.plume-content .vp-md-demo .vp-md-demo-codes div[class*="language-"] {
.vp-doc .vp-md-demo .vp-md-demo-codes div[class*="language-"] {
border-bottom: 2px dashed var(--vp-c-divider);
transition: border-bottom var(--t-color);
}
.plume-content .vp-md-demo .vp-md-demo-codes div[class*="language-"]:first-of-type {
.vp-doc .vp-md-demo .vp-md-demo-codes div[class*="language-"]:first-of-type {
border-top: 1px solid var(--vp-c-divider);
}
.plume-content .vp-md-demo .vp-md-demo-codes div[class*="language-"]:last-of-type {
.vp-doc .vp-md-demo .vp-md-demo-codes div[class*="language-"]:last-of-type {
border-bottom: none;
}
.plume-content .vp-md-demo .vp-md-demo-codes div[class*="language-"] pre {
.vp-doc .vp-md-demo .vp-md-demo-codes div[class*="language-"] pre {
margin-bottom: 0;
border-radius: 0;
}
@media (max-width: 419px) {
.plume-content .vp-md-demo {
.vp-doc .vp-md-demo {
margin: 8px -12px;
}
}
/* ---------------------- Markdown Enhance: Task List ---------------------- */
.plume-content .task-list-container {
.vp-doc .task-list-container {
padding-left: 0;
}
.plume-content .task-list-container .task-list-item input {
.vp-doc .task-list-container .task-list-item input {
width: 0;
height: 0;
padding: 0;
margin: 0;
}
.plume-content .task-list-container .task-list-item label {
.vp-doc .task-list-container .task-list-item label {
margin-left: 1.2em;
}
.plume-content .task-list-container .task-list-item input::before,
.plume-content .task-list-container .task-list-item input::after {
.vp-doc .task-list-container .task-list-item input::before,
.vp-doc .task-list-container .task-list-item input::after {
position: absolute;
top: -1em;
left: 0;
@ -379,34 +379,34 @@
content: none;
}
.plume-content .task-list-container .task-list-item input::after {
.vp-doc .task-list-container .task-list-item input::after {
content: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 32 32"%3E%3Cpath fill="%23c2c2c4" d="M26 27.5H6A1.5 1.5 0 0 1 4.5 26V6c0-.83.67-1.5 1.5-1.5h20c.828 0 1.5.67 1.5 1.5v20a1.5 1.5 0 0 1-1.5 1.5m-18.5-3h17v-17h-17z"%2F%3E%3C%2Fsvg%3E');
background-color: transparent;
border: none;
}
.plume-content .task-list-container .task-list-item input:checked[disabled]::after {
.vp-doc .task-list-container .task-list-item input:checked[disabled]::after {
content: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 32 32"%3E%3Cpath fill="%23299764" d="M29.548 3.043a2.5 2.5 0 0 0-3.513.4L16 16.067l-3.508-4.414a2.5 2.5 0 0 0-3.915 3.112l5.465 6.875c.474.597 1.195.943 1.957.943s1.482-.35 1.957-.944L29.95 6.555c.86-1.08.68-2.654-.402-3.513zM24.5 24.5h-17v-17h12.756l2.385-3H6c-.83 0-1.5.67-1.5 1.5v20c0 .828.67 1.5 1.5 1.5h20a1.5 1.5 0 0 0 1.5-1.5V12.85l-3 3.774z"%2F%3E%3C%2Fsvg%3E');
background-color: transparent;
border: none;
}
/* ---------------------------- Markdown Enhance: Tabs ----------------------------- */
.plume-content .vp-tabs {
.vp-doc .vp-tabs {
margin: 1.5rem -0.75rem;
overflow: hidden;
border: 1px solid var(--vp-c-divider);
transition: border var(--t-color);
}
.plume-content .vp-tabs-nav {
.vp-doc .vp-tabs-nav {
padding: 0 12px;
background-color: var(--vp-code-tab-bg);
box-shadow: inset 0 -1px var(--vp-code-tab-divider);
transition: background-color var(--t-color), box-shadow var(--t-color);
}
.plume-content .vp-tab-nav {
.vp-doc .vp-tab-nav {
position: relative;
padding: 0 12px;
font-size: 14px;
@ -418,11 +418,11 @@
transition: color var(--t-color);
}
.plume-content .vp-tab-nav::before {
.vp-doc .vp-tab-nav::before {
display: none;
}
.plume-content .vp-tab-nav::after {
.vp-doc .vp-tab-nav::after {
position: absolute;
right: 8px;
bottom: -1px;
@ -437,49 +437,49 @@
transition: background var(--t-color);
}
.plume-content .vp-tab-nav.active {
.vp-doc .vp-tab-nav.active {
color: var(--vp-code-tab-active-text-color);
background: transparent;
}
.plume-content .vp-tab-nav.active::after {
.vp-doc .vp-tab-nav.active::after {
background: var(--vp-code-tab-active-bar-color);
}
.plume-content .vp-tab-nav:hover {
.vp-doc .vp-tab-nav:hover {
background: transparent;
}
@media (min-width: 419px) {
.plume-content .vp-tabs {
.vp-doc .vp-tabs {
margin: 1.5rem 0;
}
}
.plume-content .hint-container .vp-tabs {
.vp-doc .hint-container .vp-tabs {
margin: 1rem -0.45rem 1rem -0.75rem;
}
.plume-content .hint-container .vp-tabs .vp-tabs-nav {
.vp-doc .hint-container .vp-tabs .vp-tabs-nav {
background: var(--vp-c-default-soft);
}
.plume-content .hint-container .vp-tabs .vp-tab {
.vp-doc .hint-container .vp-tabs .vp-tab {
padding: 0.45rem 0.75rem;
font-size: 14px;
background: transparent;
}
.plume-content .hint-container .vp-tabs .vp-tab p {
.vp-doc .hint-container .vp-tabs .vp-tab p {
margin: 8px 0;
}
/* --------------------- Markdown Enhance: Footnote -------------------------------- */
.plume-content .footnotes-sep {
.vp-doc .footnotes-sep {
margin-top: 48px;
}
.plume-content .footnotes {
.vp-doc .footnotes {
position: relative;
padding: 48px 0 12px 16px;
margin-left: -16px;
@ -488,12 +488,12 @@
}
@media (max-width: 419px) {
.plume-content .footnotes {
.vp-doc .footnotes {
margin-left: 0;
}
}
.plume-content .footnotes::before {
.vp-doc .footnotes::before {
position: absolute;
top: 12px;
left: 16px;
@ -501,50 +501,50 @@
font-weight: 700;
}
[lang="zh-CN"] .plume-content .footnotes::before {
[lang="zh-CN"] .vp-doc .footnotes::before {
content: "脚注:";
}
[lang="en-US"] .plume-content .footnotes::before {
[lang="en-US"] .vp-doc .footnotes::before {
content: "Footnotes:";
}
.plume-content .footnotes ol {
.vp-doc .footnotes ol {
margin: 0;
}
.plume-content .footnotes ol p {
.vp-doc .footnotes ol p {
margin: 8px 0;
}
.plume-content .footnotes ol li:first-of-type p:first-of-type {
.vp-doc .footnotes ol li:first-of-type p:first-of-type {
margin-top: 0;
}
.plume-content .footnotes ol li:last-of-type p:last-of-type {
.vp-doc .footnotes ol li:last-of-type p:last-of-type {
margin-bottom: 0;
}
.plume-content .footnote-item {
.vp-doc .footnote-item {
padding-top: 0;
margin-top: 0;
}
.plume-content .footnote-item > p {
.vp-doc .footnote-item > p {
margin-bottom: 0;
}
.plume-content .footnote-backref {
.vp-doc .footnote-backref {
position: relative;
color: transparent;
text-decoration: none;
}
.plume-content .footnote-backref:hover {
.vp-doc .footnote-backref:hover {
color: transparent;
}
.plume-content .footnote-backref::before {
.vp-doc .footnote-backref::before {
position: absolute;
top: -0.4em;
left: 0;
@ -552,12 +552,12 @@
content: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="1em" height="1em" viewBox="0 0 48 48"%3E%3Cg fill="none" stroke="%23c2c2c4" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"%3E%3Cpath d="m13 8l-7 6l7 7"%2F%3E%3Cpath d="M6 14h22.994c6.883 0 12.728 5.62 12.996 12.5c.284 7.27-5.723 13.5-12.996 13.5H11.998"%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
}
.plume-content .footnote-anchor {
.vp-doc .footnote-anchor {
top: 0;
}
/* -------------- Markdown Enhance: Image Figure --------------------- */
.plume-content figure {
.vp-doc figure {
position: relative;
display: flex;
flex-direction: column;
@ -566,29 +566,29 @@
text-align: center;
}
.plume-content figure img {
.vp-doc figure img {
margin: 0 auto;
overflow: hidden;
}
@media print {
.plume-content figure > a[href^="http://"]::after, .plume-content figure > a[href^="https://"]::after {
.vp-doc figure > a[href^="http://"]::after, .vp-doc figure > a[href^="https://"]::after {
content: "";
}
}
.plume-content figure > a .external-icon {
.vp-doc figure > a .external-icon {
display: none;
}
.plume-content figure figcaption {
.vp-doc figure figcaption {
display: inline-block;
margin: 6px auto;
font-size: 0.8rem;
}
/* --------------------- demo-wrapper ------------------------ */
.plume-content .demo-wrapper {
.vp-doc .demo-wrapper {
display: flex;
flex-direction: column;
min-height: 40px;
@ -600,29 +600,29 @@
transition-property: border, box-shadow;
}
.plume-content .demo-wrapper.has-title .demo-head {
.vp-doc .demo-wrapper.has-title .demo-head {
border-bottom-color: transparent;
}
.plume-content .demo-wrapper.only-img {
.vp-doc .demo-wrapper.only-img {
overflow: hidden;
}
.plume-content .demo-wrapper.only-img img {
.vp-doc .demo-wrapper.only-img img {
display: block;
}
.plume-content .demo-wrapper.only-img .demo-container,
.plume-content .demo-wrapper.no-padding .demo-container {
.vp-doc .demo-wrapper.only-img .demo-container,
.vp-doc .demo-wrapper.no-padding .demo-container {
padding: 0;
}
.plume-content .demo-wrapper.has-height .demo-container {
.vp-doc .demo-wrapper.has-height .demo-container {
height: var(--demo-container-height);
overflow-y: auto;
}
.plume-content .demo-wrapper .demo-head {
.vp-doc .demo-wrapper .demo-head {
display: flex;
align-items: center;
justify-content: flex-start;
@ -631,7 +631,7 @@
transition: border-bottom var(--t-color);
}
.plume-content .demo-wrapper .demo-ctrl {
.vp-doc .demo-wrapper .demo-ctrl {
display: flex;
gap: 5px;
align-items: center;
@ -639,7 +639,7 @@
padding: 5px 0 5px 8px;
}
.plume-content .demo-wrapper .demo-ctrl i {
.vp-doc .demo-wrapper .demo-ctrl i {
display: inline-block;
width: 10px;
height: 10px;
@ -648,19 +648,19 @@
transition: background-color var(--t-color);
}
.plume-content .demo-wrapper .demo-ctrl i:nth-child(1) {
.vp-doc .demo-wrapper .demo-ctrl i:nth-child(1) {
background-color: var(--vp-c-danger-3);
}
.plume-content .demo-wrapper .demo-ctrl i:nth-child(2) {
.vp-doc .demo-wrapper .demo-ctrl i:nth-child(2) {
background-color: var(--vp-c-warning-3);
}
.plume-content .demo-wrapper .demo-ctrl i:nth-child(3) {
.vp-doc .demo-wrapper .demo-ctrl i:nth-child(3) {
background-color: var(--vp-c-green-3);
}
.plume-content .demo-wrapper .demo-title {
.vp-doc .demo-wrapper .demo-title {
position: relative;
min-width: 0;
padding: 0 16px;
@ -675,7 +675,7 @@
transition-property: color, background-color;
}
.plume-content .demo-wrapper .demo-title p {
.vp-doc .demo-wrapper .demo-title p {
max-width: 100%;
margin: 0;
overflow: hidden;
@ -683,8 +683,8 @@
text-wrap: nowrap;
}
.plume-content .demo-wrapper .demo-title::after,
.plume-content .demo-wrapper .demo-title::before {
.vp-doc .demo-wrapper .demo-title::after,
.vp-doc .demo-wrapper .demo-title::before {
position: absolute;
bottom: 0;
z-index: 1;
@ -694,17 +694,17 @@
transition: background var(--t-color);
}
.plume-content .demo-wrapper .demo-title::before {
.vp-doc .demo-wrapper .demo-title::before {
left: 100%;
background: radial-gradient(16px at right top, transparent 50%, var(--vp-c-bg-alt) 50%);
}
.plume-content .demo-wrapper .demo-title::after {
.vp-doc .demo-wrapper .demo-title::after {
right: 100%;
background: radial-gradient(16px at left top, transparent 50%, var(--vp-c-bg-alt) 50%);
}
.plume-content .demo-wrapper .demo-container {
.vp-doc .demo-wrapper .demo-container {
min-height: 0;
padding: 20px;
font-size: 14px;
@ -715,16 +715,16 @@
transition: background-color var(--t-color);
}
.plume-content .demo-wrapper .demo-container > *:first-child {
.vp-doc .demo-wrapper .demo-container > *:first-child {
margin-top: 0;
}
.plume-content .demo-wrapper .demo-container > *:last-child {
.vp-doc .demo-wrapper .demo-container > *:last-child {
margin-bottom: 0;
}
@media (min-width: 419px) {
.plume-content .demo-wrapper {
.vp-doc .demo-wrapper {
margin: 40px 0;
}
}

View File

@ -264,9 +264,11 @@ vite-error-overlay {
mjx-container {
display: inline-block;
margin: auto 2px -2px;
margin: auto 2px;
vertical-align: middle;
}
mjx-container > svg {
display: inline-block;
margin: auto;
}

View File

@ -1,3 +0,0 @@
export function toArray<T>(value: T | T[]): T[] {
return Array.isArray(value) ? value : [value]
}

View File

@ -3,4 +3,3 @@ export * from './dom.js'
export * from './resolveEditLink.js'
export * from './resolveRepoType.js'
export * from './resolveNavLink.js'
export * from './base.js'

View File

@ -1,10 +1,14 @@
export const EXTERNAL_URL_RE = /^[a-z]+:/i
export const PATHNAME_PROTOCOL_RE = /^pathname:\/\//
export const HASH_RE = /#.*$/
export const EXT_RE = /(index)?\.(md|html)$/
export const EXT_RE = /(index|README)?\.(md|html)$/
export const inBrowser = typeof document !== 'undefined'
export function toArray<T>(value: T | T[]): T[] {
return Array.isArray(value) ? value : [value]
}
export function isActive(
currentPath: string,
matchPath?: string,