Skip to content

Commit d9ac270

Browse files
committed
theme styling
1 parent 719003f commit d9ac270

File tree

5 files changed

+79
-23
lines changed

5 files changed

+79
-23
lines changed

Diff for: docs/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration
22

3-
## `.vuepress/config.js`
3+
## .vuepress/config.js
44

55
### base
66

@@ -22,4 +22,4 @@
2222

2323
### evergreen
2424

25-
## Browser Compatibility
25+
## Note on Browser Compatibility

Diff for: docs/markdown.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ meta:
4242

4343
**Input**
4444

45-
``` markdown
45+
```
4646
[[toc]]
4747
```
4848

@@ -54,7 +54,7 @@ meta:
5454

5555
**Input**
5656

57-
``` markdown
57+
```
5858
::: tip
5959
This is a tip
6060
:::
@@ -86,7 +86,7 @@ This is a dangerous thing
8686

8787
**Input**
8888

89-
```` markdown
89+
````
9090
``` js{4}
9191
export default {
9292
data () {
@@ -114,7 +114,7 @@ export default {
114114

115115
**Input**
116116

117-
``` markdown
117+
```
118118
:tada: :100:
119119
```
120120

Diff for: docs/using-vue.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Templating
44

5+
### Interpolation
6+
57
Each markdown file is first compiled into HTML and then passed on as a Vue component to `vue-loader`. This means you can use Vue-style interpolation in text:
68

79
**Input**
@@ -14,6 +16,8 @@ Each markdown file is first compiled into HTML and then passed on as a Vue compo
1416

1517
<pre><code>{{ 1 + 1 }}</code></pre>
1618

19+
### Directives
20+
1721
Directives also work:
1822

1923
**Input**
@@ -26,6 +30,8 @@ Directives also work:
2630

2731
<pre><code><span v-for="i in 3">{{ i }} </span></code></pre>
2832

33+
### Access to Site & Page Data
34+
2935
The compiled component does not have any private data but do have access to the [site metadata](./theming.md#site-and-page-metadata). For example:
3036

3137
**Input**

Diff for: lib/default-theme/theme.stylus

+65-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,72 @@
11
.theme-container
22
font-family -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif
3+
-webkit-font-smoothing antialiased
4+
-moz-osx-font-smoothing grayscale
35
padding 0 30px
6+
font-size 16px
7+
color #2c3e50
8+
9+
blockquote
10+
font-size 1.25em
11+
color #999
12+
border-left .25em solid #dfe2e5
13+
margin-left 0
14+
padding-left 1em
15+
16+
ul, ol
17+
padding-left 1.5em
418

519
a
620
color #41b883
721
text-decoration none
822

23+
strong
24+
font-weight 600
25+
926
h1, h2, h3, h4, h5, h6
27+
font-weight 600
28+
line-height 1.25
29+
&:not(:first-child)
30+
margin-top 1.5em
1031
&:hover .header-anchor
1132
opacity: 1
1233

34+
h1
35+
font-size 2.3em
36+
37+
h2
38+
font-size 1.8em
39+
padding-bottom .3em
40+
border-bottom 1px solid #eaecef
41+
42+
h3
43+
font-size 1.4em
44+
1345
a.header-anchor
14-
font-size 0.8em
46+
font-size 0.85em
1547
float left
16-
padding-right 4px
17-
margin-left -20px
18-
margin-top 3px
48+
margin-left -0.87em
49+
padding-right 0.23em
50+
margin-top 0.125em
1951
opacity 0
2052

53+
code
54+
font-family source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace
55+
56+
p, ul, ol
57+
line-height 1.5
58+
59+
p, h1, h2, h3, h4, h5, h6
60+
code
61+
padding 0.2em 0.5em
62+
margin 0
63+
font-size 0.85em
64+
background-color rgba(27,31,35,0.05)
65+
border-radius 3px
66+
67+
p code
68+
color lighten(#2c3e50, 20%)
69+
2170
pre, pre[class*="language-"]
2271
background-color #2d2d2d
2372
color white
@@ -28,9 +77,7 @@ pre, pre[class*="language-"]
2877
word-break break-word
2978
overflow auto
3079
code
31-
font-family source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace
32-
font-size 14px
33-
-webkit-font-smoothing antialiased
80+
font-size .88em
3481

3582
.highlighted-line
3683
background-color #14161a
@@ -39,14 +86,20 @@ pre, pre[class*="language-"]
3986
padding 0.2rem 1.575rem 0
4087

4188
div
89+
&.tip, &.warning, &.danger
90+
padding .1em 1.4em
91+
border-left-width .5em
92+
border-left-style solid
93+
margin 1em 0
4294
&.tip
43-
color white
44-
background-color green
95+
background-color #f1f3f5
96+
border-color #42b983
4597
&.warning
46-
background-color yellow
98+
background-color rgba(255,229,100,.3)
99+
border-color #ffe564
47100
&.danger
48-
color white
49-
background-color red
101+
background-color #ffe6e6
102+
border-color red
50103

51104
p
52105
&.demo

Diff for: lib/markdown/index.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ const anchor = require('markdown-it-anchor')
88
const container = require('markdown-it-container')
99
const toc = require('markdown-it-table-of-contents')
1010

11-
// TODO allow configuring markdown behavior
12-
// TODO extract <style> blocks and <script> blocks
13-
// TODO support inline demo
14-
1511
module.exports = ({ markdown = {}}) => {
1612
const md = require('markdown-it')({
1713
html: true,
@@ -27,7 +23,8 @@ module.exports = ({ markdown = {}}) => {
2723
.use(emoji)
2824
.use(anchor, Object.assign({
2925
permalink: true,
30-
permalinkBefore: true // TODO use an svg?
26+
permalinkBefore: true,
27+
permalinkSymbol: '#'
3128
}, markdown.anchor))
3229
.use(toc, Object.assign({
3330
includeLevel: [2, 3]

0 commit comments

Comments
 (0)