Skip to content

Commit 7188a97

Browse files
committed
fix: 整理 viewer 样式
1 parent 11dab35 commit 7188a97

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

packages/hexon-web/src/components/HViewerContent.vue

+23-22
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const theme = useTheme<HTheme>()!;
1010
const { content } = toRefs(props);
1111
const styleVars = computed(() => ({
1212
primary: theme.value.color.primary.n,
13+
mainColor: theme.value.color.foreground.main,
14+
base3BgColor: theme.value.color.background.base3,
15+
base2BgColor: theme.value.color.background.base2,
1316
}));
1417
</script>
1518
<template>
@@ -18,11 +21,11 @@ const styleVars = computed(() => ({
1821
<style lang="stylus">
1922
2023
// Colors
21-
color-default = #555
24+
color-default = v-bind('styleVars.mainColor')
2225
color-grey = #999
2326
color-border = #ddd
2427
color-link = v-bind('styleVars.primary')
25-
color-background = #eee
28+
color-background = v-bind('styleVars.base3BgColor')
2629
color-sidebar-text = #777
2730
color-widget-background = #ddd
2831
color-widget-border = #ccc
@@ -69,19 +72,19 @@ mq-mobile = "screen and (max-width: 479px)"
6972
mq-tablet = "screen and (min-width: 480px) and (max-width: 767px)"
7073
mq-normal = "screen and (min-width: 768px)"
7174
72-
$base-style
75+
.article-entry
7376
h1
74-
font-size: 2em
77+
@apply text-4xl
7578
h2
76-
font-size: 1.5em
79+
@apply text-2xl
7780
h3
78-
font-size: 1.3em
81+
@apply text-xl
7982
h4
80-
font-size: 1.2em
83+
@apply text-lg
8184
h5
82-
font-size: 1em
85+
@apply text-base
8386
h6
84-
font-size: 1em
87+
@apply text-base
8588
color: color-grey
8689
hr
8790
border: 1px dashed color-border
@@ -90,7 +93,7 @@ $base-style
9093
em, cite
9194
font-style: italic
9295
sup, sub
93-
font-size: 0.75em
96+
@apply text-xs
9497
line-height: 0
9598
position: relative
9699
vertical-align: baseline
@@ -99,7 +102,7 @@ $base-style
99102
sub
100103
bottom: -0.2em
101104
small
102-
font-size: 0.85em
105+
@apply text-xs
103106
acronym, abbr
104107
border-bottom: 1px dotted
105108
ul, ol, dl
@@ -115,9 +118,6 @@ $base-style
115118
list-style: decimal
116119
dt
117120
font-weight: bold
118-
119-
.article-entry
120-
@extend $base-style
121121
margin: 0 auto
122122
max-width: 768px
123123
clearfix()
@@ -158,11 +158,14 @@ $base-style
158158
border-bottom: 1px solid color-border
159159
padding: 10px 0
160160
blockquote
161-
font-size: 1.4em
162-
margin: line-height 20px
163-
text-align: center
161+
margin: line-height 0
162+
background: v-bind('styleVars.base2BgColor')
163+
@apply border-l-4 px-3 py-3
164+
p:first-of-type
165+
@apply mt-0
166+
p:last-of-type
167+
@apply mb-0
164168
footer
165-
font-size: font-size
166169
margin: line-height 0
167170
cite
168171
&:before
@@ -219,7 +222,6 @@ $code-block
219222
padding: 15px article-padding
220223
border-style: solid
221224
border-color: color-border
222-
border-width: 1px 0
223225
overflow: auto
224226
color: highlight-foreground
225227
line-height: font-size * line-height
@@ -233,8 +235,7 @@ $line-numbers
233235
font-family: font-mono
234236
code
235237
background: color-background
236-
text-shadow: 0 1px #fff
237-
padding: 0 0.3em
238+
@apply rounded-md py-0 px-1 my-0 mx-1
238239
pre
239240
@extend $code-block
240241
code
@@ -243,7 +244,7 @@ $line-numbers
243244
padding: 0
244245
.highlight
245246
@extend $code-block
246-
border-radius: 0.375rem
247+
@apply rounded-md
247248
pre
248249
border: none
249250
margin: 0

0 commit comments

Comments
 (0)