Skip to content

Commit

Permalink
core: update whole styles
Browse files Browse the repository at this point in the history
  • Loading branch information
TalexDreamSoul committed Aug 26, 2023
1 parent bd02b33 commit 40a7fa1
Show file tree
Hide file tree
Showing 13 changed files with 676 additions and 194 deletions.
6 changes: 3 additions & 3 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
themeConfig: {
nav,
sidebar,
aside: false,
aside: true,
docFooter: {
prev: "this.prevPage();",
next: "this.nextPage();",
Expand All @@ -21,7 +21,7 @@ export default defineConfig({
text: "编辑本页内容",
},
lastUpdatedText: "本页更新于",
outline: false,
outline: 'deep',
siteTitle: "PluginDiary",
socialLinks: [
{
Expand All @@ -37,7 +37,7 @@ export default defineConfig({
},
],
},
appearance: false,
appearance: true,
lastUpdated: true,
markdown: {
theme: "css-variables",
Expand Down
46 changes: 46 additions & 0 deletions .vitepress/theme/addon/nav-modifier.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@media (min-width: 960px) {
header.VPNav div.VPNavBar:not(.has-sidebar):not(.top) {
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.75;
background-color: var(--vp-c-bg-soft);
/* border-bottom: 1px solid transparent; */
z-index: -1;
}
backdrop-filter: blur(18px) saturate(180%);

background-color: transparent;
/* border-bottom-color: transparent; */
}
}

@media (min-width: 960px) {
.VPNavBar:not(.top) .content-body {
&::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.75;
background-color: var(--vp-c-bg) !important;
/* border-bottom: 1px solid transparent; */
z-index: -1;
}
background-color: transparent !important;
backdrop-filter: blur(18px) saturate(180%);
}

html:has(header + div.VPContent.is-home) .VPNavBar:not(.top) .content-body {
&:before {
display: none;
}
backdrop-filter: none;
}
}
49 changes: 49 additions & 0 deletions .vitepress/theme/addon/page-modifier.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
html.dark .vp-doc iframe {

opacity: .5;
filter: invert(.15) brightness(1.1) contrast(1.1);
&:hover {
opacity: 1;
filter: invert(0) brightness(1) contrast(1);
}
}

.vp-doc iframe {
padding: 4px;

border-radius: 12px;
border: 2px solid var(--vp-c-bg-soft);
box-shadow: 0px 0px 4px 0px var(--vp-c-bg-soft);

height: 96px;

box-sizing: border-box;
}

/* 在黑暗模式下调低图片透明度,以免损坏眼睛 */
/* 对已经适配的 .ignore img 忽略 */
html.dark .vp-doc p img:not(.ignore) {
opacity: 0.95;
filter: invert(.25);
&:hover {
opacity: 1;
filter: invert(0);
}
}

.vp-doc p img {
border-radius: 8px;

cursor: pointer;
transition: .25s;
&:hover {
border-radius: 0;
transform: scale(1.025);
}
}

/* 在主页的黑暗模式下,对整个页面做滤镜 */
html.dark div.VPContent.is-home {
opacity: .85;
filter: invert(.15) brightness(1.1) contrast(1.1);
}
109 changes: 72 additions & 37 deletions .vitepress/theme/button.css
Original file line number Diff line number Diff line change
@@ -1,57 +1,92 @@
.btn-unconfirmed {
/* 确认行动结束按钮 */
color: #fff;
background-color: #17a2b8;
border-color: #17a2b8;
border-radius: 0.25rem;
padding-top: 6px;
padding-bottom: 6px;
font-size: 16px;
&:hover {
box-shadow: 0 0 2px 4px #17a2b8;
}
/* 确认行动结束按钮 */
/* color: #fff; */
border: 2px solid #17a2b8;
border-radius: 0.25rem;
padding-top: 6px;
padding-bottom: 6px;
font-size: 16px;

box-shadow: 0 0 2px 4px transparent;
}

.btn-unconfirmed:hover {
/* 光标悬浮时加深颜色 */
color: #fff;
background-color: #138496;
border-color: #117a8b;
/* 光标悬浮时加深颜色 */
color: #fff;
background-color: #138496;
border-color: #117a8b;
}

.btn-unconfirmed:focus {
/* 点按后显示阴影 */
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
/* 点按后显示阴影 */
box-shadow: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);
}

.btn-confirmed {
/* 恭喜按钮 */
color: #fff;
background-color: #28a745;
border-color: #28a745;
&:before, &:after {
z-index: -1;
content: "";
position: absolute;

width: 100%;
height: 100%;

left: 0;
top: 0;

border: solid 2px #28a745;
border-radius: 0.25rem;
padding-top: 6px;
padding-bottom: 6px;
font-size: 16px;
animation: shining-success 1.25s infinite;
}
&:after {
animation: shining-success .75s infinite;
}
position: relative;

/* 恭喜按钮 */
color: #fff;
background-color: #28a745;
border-color: #28a745;
border-radius: 0.25rem;
padding-top: 6px;
padding-bottom: 6px;
font-size: 16px;
}

@keyframes shining-success {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(1.0125);
}
}

.btn-confirmed:hover {
/* 光标悬浮时加深颜色 */
color: #fff;
background-color: #218838;
border-color: #1e7e34;
/* 光标悬浮时加深颜色 */
color: #fff;
background-color: #218838;
border-color: #1e7e34;
}

.btn-confirmed:focus {
/* 点按后显示阴影 */
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
/* 点按后显示阴影 */
box-shadow: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);
}

.btn-event {
/* 单击开始事件模拟按钮 */
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
background-color: #ffe0f0;

margin-top: 32px;
margin-bottom: 32px;
}
/* 单击开始事件模拟按钮 */
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
background-color: #ffe0f0;

margin-top: 32px;
margin-bottom: 32px;
}
24 changes: 12 additions & 12 deletions .vitepress/theme/code.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@
/* 调整背景颜色 */
--vp-code-tab-bg: #E3E3E3;
--vp-code-tab-text-color: #333333;
--vp-code-block-color: rgb(51, 51, 51);
--vp-code-block-bg: rgb(247, 247, 247);
--vp-c-text-code: #333333;
/* --vp-code-block-color: rgb(51, 51, 51); */
/* --vp-code-block-bg: rgb(247, 247, 247); */
/* --vp-c-text-code: #333333; */

/* 复制按钮改浅 */
--vp-code-copy-code-bg: #808080;
--vp-code-copy-code-hover-bg: #606060;
--vp-code-copy-code-active-text: #FFFFFF;
/* --vp-code-copy-code-bg: #808080; */
/* --vp-code-copy-code-hover-bg: #606060; */
/* --vp-code-copy-code-active-text: #FFFFFF; */
/* 复制按钮图标由灰色改白色 */
--vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(255,255,255,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2'/%3E%3C/svg%3E");
--vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' height='20' width='20' stroke='rgba(255,255,255,1)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2M9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-6 9 2 2 4-4'/%3E%3C/svg%3E");

/* 容器中的代码块沿用正文格式 */
--vp-custom-block-code-font-size: 0.95em;
--vp-custom-block-info-code-bg: #E3E3E3;
--vp-custom-block-danger-code-bg: #E3E3E3;
/* --vp-custom-block-info-code-bg: #E3E3E3; */
/* --vp-custom-block-danger-code-bg: #E3E3E3; */
}

.vp-doc :not(pre)>code {
/* 小段代码,背景改深 */
background-color: #E3E3E3;
color: #333333;
/* background-color: #E3E3E3; */
/* color: #333333; */
}

.vp-doc [class*=language-]>span.lang {
/* 大段代码右上角的语言类型,颜色加深,调整字体 */
font-family: Inconsolata, Consolas, Menlo, Monaco, "Andale Mono WT",
"Andale Mono", "Lucida Console", "DejaVu Sans Mono", "Bitstream Vera Sans Mono",
"Courier New", Courier, monospace;
color: rgb(51, 51, 51);
/* color: rgb(51, 51, 51); */
}

.vp-doc .custom-block code {
Expand All @@ -49,7 +49,7 @@

:root {
/* 代码高亮 */
--shiki-color-text: #333333;
/* --shiki-color-text: #333333; */
--shiki-color-background: #333333;
--shiki-token-constant: #0077AA;
--shiki-token-comment: #6E8090;
Expand Down
Loading

0 comments on commit 40a7fa1

Please sign in to comment.