Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit cd64558

Browse files
nisarhassan12christin
andauthored
Make the editing docs button more visible and prominent. (#918)
* Make the editing docs button more visible and prominent. Fixes gitpod-io/website#905 * adjust colors Co-authored-by: christin <[email protected]>
1 parent 0f672e7 commit cd64558

File tree

4 files changed

+54
-26
lines changed

4 files changed

+54
-26
lines changed

src/components/docs/EditInGitpod.tsx

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,61 @@
11
import React from 'react'
22

33
import styled from '@emotion/styled'
4-
import { colors } from '../../styles/variables'
54

6-
const StyledEditInGitpod = styled.div`
7-
position: absolute;
8-
top: 2rem;
9-
right: 2rem;
10-
11-
.pen {
12-
fill: ${colors.white};
13-
transition: all .2s;
14-
height: 2.5rem;
15-
width: 2.5rem;
5+
const StyledEditInGitpod = styled.div`
6+
svg {
7+
height: 3.5rem;
168
}
179
1810
a {
19-
display: flex;
20-
justify-content: center;
21-
align-items: center;
22-
height: 4.5rem;
23-
width: 4.5rem;
24-
background: ${colors.offWhite1};
25-
border-radius: 50%;
26-
transition: all .2s;
27-
28-
&:hover,
29-
&:focus {
30-
background: ${colors.text};
11+
&:hover {
12+
rect {
13+
transition: all .2s;
14+
fill: #287EF7;
15+
}
3116
}
3217
}
3318
`
3419

3520
const EditInGitpod = ({ editUrl }: { editUrl: string }) => (
3621
<StyledEditInGitpod className="pen-container">
3722
<a href={editUrl} title="Edit this page in Gitpod" target="_blank">
38-
<svg className="pen" xmlns="http://www.w3.org/2000/svg" width="22.454" height="25.307" viewBox="0 0 22.454 25.307"><title>Edit this page in Gitpod</title><path d="M25.088,13.816,12.516,27.982h0L8.063,22.964,20.635,8.8l4.453,5.018Zm.787-.887L27.8,10.763a2.744,2.744,0,0,0,.011-3.55l-1.313-1.48a2.048,2.048,0,0,0-3.151.012L21.422,7.911l4.453,5.018ZM11.729,28.869l-.163.184L6,30.307l1.113-6.272.163-.184,4.453,5.018Z" transform="translate(-6 -5) translate(6 5) translate(-6 -5)" /></svg>
23+
<svg
24+
xmlns="http://www.w3.org/2000/svg"
25+
width="138"
26+
height="32"
27+
viewBox="0 0 1380 320"
28+
>
29+
<g fill="none" fillRule="evenodd">
30+
<rect width="1380" height="320" fill="#1966D2" rx="40"></rect>
31+
<text
32+
fill="#FFF"
33+
fontFamily="Arial,Helvetica,sans-serif"
34+
fontWeight="400"
35+
fontSize="140"
36+
opacity="0.704"
37+
>
38+
<tspan x="650" y="210">
39+
in Gitpod
40+
</tspan>
41+
</text>
42+
<text
43+
fill="#FFF"
44+
fontFamily="Arial,Helvetica,sans-serif"
45+
fontWeight="400"
46+
fontSize="140"
47+
>
48+
<tspan x="350" y="210">
49+
Edit
50+
</tspan>
51+
</text>
52+
<g fill="#FFF">
53+
<path d="M129.74 201.58v-81.01L112 110.33v101.44l87.77 50.66V241.7z"></path>
54+
<path d="M199.77 220.95V161l-52.03-30.04v60.19zm1.58-143.4l70.14 40.42 17.72-10.23L201.35 57l-87.86 50.73 17.78 10.26z"></path>
55+
<path d="M253.48 128.37l-52.12-30.04-52.09 30.05 52.08 30.07zm-50.71 92.69l52.25-29.92v-20.48l-36.01 20.49v-20.71l54.01-30.74v61.88l-70.25 40.21v20.74l87.93-50.75V110.35l-87.93 50.75zm-1.42-60.88v.01-.01z"></path>
56+
</g>
57+
</g>
58+
</svg>
3959
</a>
4060
</StyledEditInGitpod>
4161
)

src/layouts/docs.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ const StyledDocsLayout = styled.div`
2727
padding: 3rem 1rem;
2828
position: relative;
2929
30+
&__header {
31+
display: flex;
32+
justify-content: space-between;
33+
}
34+
3035
@media(min-width: calc(${sizes.breakpoints.lg} + 1px)) {
3136
width: 70%;
3237
}

src/resources/edit-in-gitpod.svg

Lines changed: 1 addition & 0 deletions
Loading

src/templates/doc.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ const DocTemplate: React.SFC<DocTemplateProps> = ({ data }) => {
4444
canonical={data.markdownRemark.frontmatter.url || `${data.markdownRemark.fields.slug.toLowerCase()}`} title={`${menuCtx.thisEntry != undefined ? menuCtx.thisEntry!.title || 'Docs' : 'Docs'}`}
4545
body={
4646
<div className="article">
47-
<h4 style={{ color: colors.textLight, marginBottom: 0, marginTop: 30 }}>Docs</h4>
48-
<EditInGitpod editUrl={editUrl}/>
47+
<div className="article__header">
48+
<h4 style={{ color: colors.textLight, marginBottom: 0, marginTop: 30 }}>Docs</h4>
49+
<EditInGitpod editUrl={editUrl}/>
50+
</div>
4951
<div dangerouslySetInnerHTML={{ __html: data.markdownRemark.html }} />
5052
<NavigationArrows menuCtx={menuCtx} />
5153
<ReachOut />

0 commit comments

Comments
 (0)