Skip to content

Commit 3d6a296

Browse files
Minor changes to website style (#3879)
1 parent b5e3c75 commit 3d6a296

File tree

9 files changed

+40
-36
lines changed

9 files changed

+40
-36
lines changed

website/gatsby-config.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ module.exports = {
6868
viewBox="0 0 512 512"
6969
width="16"
7070
height="16"
71+
fill="var(--heading-text-color)"
7172
>
7273
<path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z" />
7374
</svg>`,
@@ -173,13 +174,8 @@ module.exports = {
173174
}`,
174175
setup: (options) => {
175176
const { pathPrefix } = options.query.site;
176-
const {
177-
author,
178-
company,
179-
description,
180-
siteUrl,
181-
title,
182-
} = options.query.site.siteMetadata;
177+
const { author, company, description, siteUrl, title } =
178+
options.query.site.siteMetadata;
183179
const baseUrl = siteUrl + pathPrefix;
184180
const currentYear = new Date().getUTCFullYear();
185181

website/src/components/mdx/code-block.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React, { FunctionComponent } from "react";
2-
import styled from "styled-components";
31
import Highlight, { Language } from "prism-react-renderer";
42
import Prism from "prismjs";
3+
import React, { FunctionComponent } from "react";
4+
import styled from "styled-components";
55
import { Copy } from "./copy";
66

77
interface CodeBlockProps {
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React, { FunctionComponent } from "react";
2+
import styled from "styled-components";
3+
4+
export const InlineCode: FunctionComponent = ({ children }) => {
5+
return <Container>{children}</Container>;
6+
};
7+
8+
const Container = styled.code`
9+
padding: 2px 5px;
10+
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
11+
font-size: var(--font-size);
12+
`;

website/src/components/misc/global-style.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export const GlobalStyle = createGlobalStyle`
2828
:root {
2929
--brand-color: #f40010;
3030
--brand-color-hover: #b7020a;
31+
--text-color: #667;
32+
--heading-text-color: #334;
3133
--text-color-contrast: #fff;
3234
--border-radius: 4px;
3335
--font-size: .833rem;
@@ -42,7 +44,7 @@ export const GlobalStyle = createGlobalStyle`
4244
body {
4345
font-size: 18px;
4446
line-height: 30px;
45-
color: #667;
47+
color: var(--text-color);
4648
scroll-behavior: smooth;
4749

4850
-webkit-font-smoothing: antialiased;
@@ -88,18 +90,12 @@ export const GlobalStyle = createGlobalStyle`
8890
font-weight: bold;
8991
line-height: 1.250em;
9092
text-rendering: optimizeLegibility;
91-
color: #334;
93+
color: var(--heading-text-color);
9294
}
9395

9496
p {
9597
margin-bottom: 20px;
9698
line-height: 1.667em;
97-
98-
code {
99-
padding: 2px 5px;
100-
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
101-
font-size: var(--font-size);
102-
}
10399
}
104100

105101
h1 {

website/src/components/misc/marketing-elements.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import styled from "styled-components";
2-
32
import CheckIconSvg from "../../images/check.svg";
43
import EnvelopeIconSvg from "../../images/envelope.svg";
54
import SlackIconSvg from "../../images/slack.svg";
@@ -85,7 +84,7 @@ export const ContentContainer = styled.div<{ noImage?: boolean }>`
8584
export const SectionTitle = styled.h1<{ centerAlways?: boolean }>`
8685
flex: 0 0 auto;
8786
font-size: 1.75em;
88-
color: #667;
87+
color: var(--text-color);
8988
text-align: center;
9089

9190
@media only screen and (min-width: 768px) {

website/src/components/misc/search.tsx

+13-14
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ import {
1717
InstantSearch,
1818
Snippet,
1919
} from "react-instantsearch-dom";
20-
import { useDispatch, useStore, useSelector } from "react-redux";
20+
import { useDispatch, useSelector, useStore } from "react-redux";
2121
import styled from "styled-components";
22+
import AlgoliaLogoSvg from "../../images/algolia-logo.svg";
2223
import { State } from "../../state";
2324
import { changeSearchQuery } from "../../state/common";
2425
import { Link } from "./link";
2526

26-
import AlgoliaLogoSvg from "../../images/algolia-logo.svg";
27-
2827
interface SearchProperties {
2928
siteUrl: string;
3029
}
@@ -133,17 +132,17 @@ const Stats = connectStateResults(
133132
}` as any)
134133
);
135134

136-
const DocHit = (siteUrl: string, clickHandler: () => void) => ({
137-
hit,
138-
}: HitComponentProperties) => {
139-
const slug = (hit.url as string).replace(siteUrl, "");
135+
const DocHit =
136+
(siteUrl: string, clickHandler: () => void) =>
137+
({ hit }: HitComponentProperties) => {
138+
const slug = (hit.url as string).replace(siteUrl, "");
140139

141-
return (
142-
<Link to={slug} onClick={clickHandler}>
143-
<Snippet attribute="content" hit={hit} tagName="mark" />
144-
</Link>
145-
);
146-
};
140+
return (
141+
<Link to={slug} onClick={clickHandler}>
142+
<Snippet attribute="content" hit={hit} tagName="mark" />
143+
</Link>
144+
);
145+
};
147146

148147
const Container = styled.div`
149148
display: flex;
@@ -199,7 +198,7 @@ const HitsWrapper = styled.div<{ show: boolean }>`
199198
color: var(--brand-color);
200199

201200
&:hover {
202-
color: #667;
201+
color: var(--text-color);
203202
}
204203
}
205204
}

website/src/components/structure/layout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MDXProvider } from "@mdx-js/react";
22
import React, { FunctionComponent } from "react";
33
import { CodeBlock } from "../mdx/code-block";
4+
import { InlineCode } from "../mdx/inline-code";
45
import { CookieConsent } from "../misc/cookie-consent";
56
import { GlobalLayoutStyle, GlobalStyle } from "../misc/global-style";
67
import { Header } from "./header";
@@ -9,6 +10,7 @@ import { MainContentContainer } from "./main-content-container/main-content-cont
910
export const Layout: FunctionComponent = ({ children }) => {
1011
const components = {
1112
pre: CodeBlock,
13+
inlineCode: InlineCode,
1214
};
1315

1416
return (

website/src/pages/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ const ArticleMetadata = styled.div`
533533
align-items: center;
534534
margin: 15px 20px 7px;
535535
font-size: 0.778em;
536-
color: #667;
536+
color: var(--text-color);
537537
`;
538538

539539
const ArticleTitle = styled.h1`
@@ -555,7 +555,7 @@ const Logo = styled.div<{ width?: number }>`
555555
width: ${({ width }) => width || 160}px;
556556

557557
> a > svg {
558-
fill: #667;
558+
fill: var(--text-color);
559559
transition: fill 0.2s ease-in-out;
560560

561561
&:hover {

website/src/partials/sales-partial.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const SwiterContainer = styled.div`
135135
const Title = styled.h1`
136136
flex: 0 0 auto;
137137
font-size: 1.75em;
138-
color: #667;
138+
color: var(--text-color);
139139
text-align: center;
140140

141141
${IsPhablet(`

0 commit comments

Comments
 (0)