Skip to content

Commit d0a7817

Browse files
hrasoameta-codesync[bot]
authored andcommitted
fix home dark theme code highlight (#5094)
Summary: Fixes #4615 #4020 Pull Request resolved: #5094 Reviewed By: tyao1 Differential Revision: D87452537 Pulled By: captbaritone fbshipit-source-id: eb10732047ef2856f0998cf2bcaeb60a5a04d25e
1 parent a71cbb1 commit d0a7817

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

website/src/css/custom.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,15 @@ html[data-theme="light"] .homePage .container {
188188
}
189189

190190
.exampleSection .wrapperInner > div:nth-child(even) pre {
191-
margin-left: 3em;
192191
padding-top: 0;
193192
}
194193

195194
pre {
196195
background-color: var(--pre-background-color);
197196
}
198197

199-
pre.outerPre {
200-
box-shadow: var(--pre-box-shadow);
201-
border: 1px solid var(--pre-border-color);
198+
.outerPre {
199+
margin-left: 3em;
202200
}
203201

204202
.exampleSection p {
@@ -207,6 +205,8 @@ pre.outerPre {
207205

208206
.exampleSection pre {
209207
margin-top: 15px;
208+
border: 1px solid var(--pre-border-color);
209+
font-size: 80%;
210210
}
211211

212212
/* Text section */
@@ -454,6 +454,10 @@ pre.outerPre {
454454
.exampleSection .wrapperInner > div:nth-child(even) pre {
455455
margin-left: 0em;
456456
}
457+
458+
.outerPre {
459+
margin-left: 0;
460+
}
457461
}
458462

459463
@media only screen and (max-width: 768px) {

website/src/pages/index.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
* @oncall relay
99
*/
1010

11-
import Code from '../core/Code.js';
1211
import Container from '../core/Container';
1312
import GridBlock from '../core/GridBlock';
1413
import Link from '@docusaurus/Link';
1514
import useBaseUrl, {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
1615
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
16+
import CodeBlock from '@theme/CodeBlock';
1717
import Layout from '@theme/Layout';
1818
import * as React from 'react';
1919

@@ -201,10 +201,9 @@ const Index = () => {
201201
</div>
202202

203203
<div className="radiusLeft">
204-
<pre className="outerPre">
205-
<Code>
206-
{`
207-
import React from "react";
204+
<div className="outerPre">
205+
<CodeBlock>
206+
{`import React from "react";
208207
import { graphql, usePreloadedQuery, /* ... */ } from "react-relay";
209208
210209
const artistsQuery = graphql\`
@@ -239,10 +238,9 @@ function ArtistView() {
239238
{data?.artist && <ArtistCard artist={data?.artist} />}
240239
</>
241240
);
242-
}
243-
`}
244-
</Code>
245-
</pre>
241+
}`}
242+
</CodeBlock>
243+
</div>
246244
</div>
247245
</div>
248246
</Container>
@@ -273,11 +271,11 @@ function ArtistView() {
273271
fragments are fetched as part of that parent query.
274272
</p>
275273
</div>
274+
276275
<div>
277-
<pre className="outerPre">
278-
<Code>
279-
{`
280-
import React from "react";
276+
<div className="outerPre">
277+
<CodeBlock>
278+
{`import React from "react";
281279
import { graphql, useFragment} from "react-relay";
282280
283281
export default function ArtistCard(props) {
@@ -303,10 +301,9 @@ export default function ArtistCard(props) {
303301
</Link>
304302
</Card>
305303
);
306-
}
307-
`}
308-
</Code>
309-
</pre>
304+
}`}
305+
</CodeBlock>
306+
</div>
310307
</div>
311308
</div>
312309
</Container>

0 commit comments

Comments
 (0)