Skip to content

Commit d485171

Browse files
authored
feat: make Edit footer less prominent (#197)
1 parent 1d98226 commit d485171

File tree

2 files changed

+67
-68
lines changed

2 files changed

+67
-68
lines changed

src/.vuepress/theme/components/PageEdit.vue

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
<template>
22
<footer class="page-edit">
3-
<div v-if="editLink" class="edit-link">
4-
Caught a mistake or want to contribute to the documentation?
5-
<a :href="editLink" target="_blank" rel="noopener noreferrer">{{
6-
editLinkText
7-
}}</a>
8-
<OutboundLink />
9-
</div>
10-
11-
<div>
12-
Deployed on <a href="https://url.netlify.com/HJ8X2mxP8">Netlify</a>
13-
</div>
14-
15-
<div v-if="lastUpdated" class="last-updated">
16-
<span class="prefix">{{ lastUpdatedText }}:</span>
17-
<span class="time">{{ lastUpdated }}</span>
3+
<div class="container">
4+
<p>
5+
Deployed on
6+
<a href="https://url.netlify.com/HJ8X2mxP8">Netlify</a>.
7+
<span v-if="editLink" class="edit-link">
8+
Caught a mistake or want to contribute to the documentation?
9+
<a
10+
:href="editLink"
11+
target="_blank"
12+
rel="noopener noreferrer"
13+
>
14+
{{ editLinkText }}
15+
<OutboundLink />
16+
</a>
17+
</span>
18+
<template v-if="lastUpdated" class="last-updated">
19+
<br />
20+
<span class="prefix">{{ lastUpdatedText }}:</span>
21+
<span class="time">{{ lastUpdated }}</span>
22+
</template>
23+
</p>
1824
</div>
1925
</footer>
2026
</template>
@@ -104,7 +110,9 @@ export default {
104110
}
105111
</script>
106112

107-
<style>
113+
<style lang="scss" scoped>
114+
@import '@theme/styles/_settings.scss';
115+
108116
/*
109117
This entire style block is MVP style wise and will likely
110118
be changed with the new atomic theme. Changes are welcome!
@@ -115,10 +123,20 @@ export default {
115123
116124
.page-edit {
117125
padding: 0 1.5rem;
118-
display: flex;
119-
align-items: center;
120-
flex-direction: column;
121126
max-width: 740px;
122127
margin: 0 auto;
128+
font-size: 0.95em;
129+
color: $light;
130+
text-align: center;
131+
132+
p {
133+
margin: 0.8rem auto;
134+
}
135+
136+
.container {
137+
border: 1px solid #eaecef;
138+
border-radius: 5px;
139+
padding: 0 1.5rem;
140+
}
123141
}
124142
</style>
Lines changed: 30 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<template>
2-
<div
3-
v-if="prev || next"
4-
class="page-nav"
5-
>
2+
<div v-if="prev || next" class="page-nav">
63
<p class="inner">
7-
<span
8-
v-if="prev"
9-
class="prev"
10-
>
4+
<span v-if="prev" class="prev">
115
126
<a
137
v-if="prev.type === 'external'"
@@ -17,41 +11,24 @@
1711
rel="noopener noreferrer"
1812
>
1913
{{ prev.title || prev.path }}
20-
2114
<OutboundLink />
2215
</a>
2316

24-
<RouterLink
25-
v-else
26-
class="prev"
27-
:to="prev.path"
28-
>
29-
{{ prev.title || prev.path }}
30-
</RouterLink>
17+
<RouterLink v-else class="prev" :to="prev.path">{{ prev.title || prev.path }}</RouterLink>
3118
</span>
3219

33-
<span
34-
v-if="next"
35-
class="next"
36-
>
20+
<span v-if="next" class="next">
3721
<a
3822
v-if="next.type === 'external'"
3923
:href="next.path"
4024
target="_blank"
4125
rel="noopener noreferrer"
4226
>
4327
{{ next.title || next.path }}
44-
4528
<OutboundLink />
4629
</a>
4730

48-
<RouterLink
49-
v-else
50-
:to="next.path"
51-
>
52-
{{ next.title || next.path }}
53-
</RouterLink>
54-
31+
<RouterLink v-else :to="next.path">{{ next.title || next.path }}</RouterLink>→
5532
</span>
5633
</p>
5734
</div>
@@ -68,21 +45,21 @@ export default {
6845
props: ['sidebarItems'],
6946
7047
computed: {
71-
prev () {
48+
prev() {
7249
return resolvePageLink(LINK_TYPES.PREV, this)
7350
},
7451
75-
next () {
52+
next() {
7653
return resolvePageLink(LINK_TYPES.NEXT, this)
7754
}
7855
}
7956
}
8057
81-
function resolvePrev (page, items) {
58+
function resolvePrev(page, items) {
8259
return find(page, items, -1)
8360
}
8461
85-
function resolveNext (page, items) {
62+
function resolveNext(page, items) {
8663
return find(page, items, 1)
8764
}
8865
@@ -99,7 +76,7 @@ const LINK_TYPES = {
9976
}
10077
}
10178
102-
function resolvePageLink (
79+
function resolvePageLink(
10380
linkType,
10481
{ $themeConfig, $page, $route, $site, sidebarItems }
10582
) {
@@ -123,7 +100,7 @@ function resolvePageLink (
123100
}
124101
}
125102
126-
function find (page, items, offset) {
103+
function find(page, items, offset) {
127104
const res = []
128105
flatten(items, res)
129106
for (let i = 0; i < res.length; i++) {
@@ -134,7 +111,7 @@ function find (page, items, offset) {
134111
}
135112
}
136113
137-
function flatten (items, res) {
114+
function flatten(items, res) {
138115
for (let i = 0, l = items.length; i < l; i++) {
139116
if (items[i].type === 'group') {
140117
flatten(items[i].children || [], res)
@@ -146,18 +123,22 @@ function flatten (items, res) {
146123
</script>
147124

148125
<style lang="stylus">
149-
@require '../styles/wrapper.styl'
150-
151-
.page-nav
152-
@extend $wrapper
153-
padding-top 1rem
154-
padding-bottom 0
155-
.inner
156-
min-height 2rem
157-
margin-top 0
158-
border-top 1px solid $borderColor
159-
padding-top 1rem
160-
overflow auto // clear float
161-
.next
162-
float right
126+
@require '../styles/wrapper.styl';
127+
128+
.page-nav {
129+
@extend $wrapper;
130+
padding-top: 1rem;
131+
padding-bottom: 0;
132+
133+
.inner {
134+
min-height: 2rem;
135+
margin-top: 0;
136+
padding-top: 1rem;
137+
overflow: auto; // clear float
138+
}
139+
140+
.next {
141+
float: right;
142+
}
143+
}
163144
</style>

0 commit comments

Comments
 (0)