Skip to content

Commit 5ef9ba7

Browse files
committed
feat: 添加重要信息的样式支持,优化自定义块的视觉效果
1 parent 2195f73 commit 5ef9ba7

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ reimu_cursor:
172172
text: ../images/cursor/reimu-cursor-text.png
173173

174174
# set to false to enable fontawesome
175-
icon_font: 4552607_cs6s86l0wm9
175+
icon_font: 4552607_4k4bc36ef96
176176

177177
# Font loading strategy
178178
# Custom Font -> Google Fonts -> Local FallBack Font

source/css/_partial/container.styl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
--color-tip-text: hsl(152, 95%, 28%)
1717
--color-tip-shadow: hsl(138, 100%, 98%)
1818

19+
--color-important-bg: hsl(270, 80%, 96%)
20+
--color-important-text: hsl(270, 80%, 45%)
21+
--color-important-shadow: hsl(270, 80%, 98%)
22+
1923
[data-theme="dark"]
2024
&:root
2125
--color-info-bg: hsl(210, 30%, 25%)
@@ -34,6 +38,10 @@
3438
--color-tip-text: hsl(138, 80%, 70%)
3539
--color-tip-shadow: hsl(138, 30%, 16%)
3640

41+
--color-important-bg: hsl(270, 30%, 25%)
42+
--color-important-text: hsl(270, 80%, 70%)
43+
--color-important-shadow: hsl(270, 30%, 16%)
44+
3745
.custom-block
3846
margin: 1.8em 0
3947
border-radius: post-radius
@@ -105,6 +113,23 @@
105113
content: "\f058"
106114
font-weight: 900
107115
margin-right: 0.5em
116+
117+
&.important
118+
background: var(--color-important-bg)
119+
color: var(--color-important-text)
120+
box-shadow: 0 0 5px 2px var(--color-important-shadow)
121+
border-left: 6px var(--color-important-text) solid
122+
123+
.custom-block-title:before
124+
font-weight: normal
125+
if hexo-config("icon_font")
126+
font-family: font-icon
127+
content: "\e649"
128+
else
129+
font-family: var(--font-icon)
130+
content: "\f192"
131+
font-weight: 900
132+
margin-right: 0.5em
108133
p
109134
margin: 0.8em 0
110135

0 commit comments

Comments
 (0)