Skip to content

Commit 5bf923f

Browse files
committed
Add style overrides to docs layout components.
1 parent e36a36e commit 5bf923f

File tree

5 files changed

+50
-14
lines changed

5 files changed

+50
-14
lines changed

packages/react-renderer-demo/src/app/pages/_document.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,28 @@ class MyDocument extends Document {
2323
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
2424
<link rel="stylesheet" type="text/css" href="//wpcc.io/lib/1.0.2/cookieconsent.min.css" />
2525
<script src="//wpcc.io/lib/1.0.2/cookieconsent.min.js"></script>
26+
<style dangerouslySetInnerHTML={{__html: `
27+
html {
28+
box-sizing: border-box;
29+
-webkit-font-smoothing: antialiased;
30+
-moz-osx-font-smoothing: grayscale;
31+
}
32+
*, *::before, *::after {
33+
box-sizing: inherit;
34+
}
35+
strong, b {
36+
font-weight: bolder !important;
37+
}
38+
body {
39+
color: rgba(0, 0, 0, 0.87) !important;
40+
margin: 0 !important;
41+
font-size: 0.875rem !important;
42+
font-family: "Roboto", "Helvetica", "Arial", sans-serif !important;
43+
font-weight: 400 !important;
44+
line-height: 1.43 !important;
45+
letter-spacing: 0.01071em !important;
46+
background-color: #fafafa !important;
47+
}`}} />
2648
</Head>
2749
<body>
2850
<Main />

packages/react-renderer-demo/src/app/src/components/footer.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ import NpmSvgIcon from './common/npm-svg-icon';
2020
import TwitterIcon from './common/twitter-svg-icon';
2121
import DiscordIcon from './common/discord-svg-icon';
2222

23+
const useRepoLinkStyles = makeStyles(() => ({
24+
listLink: {
25+
paddingLeft: 0,
26+
paddingRight: 0,
27+
fontWeight: 'inherit'
28+
}
29+
}));
30+
2331
const RepoLink = ({ href, label }) => {
24-
const classes = makeStyles(() => ({
25-
listLink: {
26-
paddingLeft: 0,
27-
paddingRight: 0
28-
}
29-
}));
32+
const classes = useRepoLinkStyles();
3033
return (
3134
<ListItem>
3235
<ListItemText

packages/react-renderer-demo/src/app/src/components/mdx/mdx-components.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const CodeEditor = dynamic(import('../code-editor'), {
2525
const useHeadingStyles = makeStyles(() => ({
2626
anchor: {
2727
textDecoration: 'none',
28-
color: 'inherit'
28+
color: 'inherit',
29+
fontWeight: 'inherit'
2930
},
3031
heading: {
3132
'& button': {
@@ -38,6 +39,9 @@ const useHeadingStyles = makeStyles(() => ({
3839
offset: {
3940
paddingTop: 92, // compensate for fixed header size and spacing
4041
marginTop: -92 // compensate for fixed header size and spacing
42+
},
43+
link: {
44+
fontWeight: 'initial'
4145
}
4246
}));
4347

@@ -94,16 +98,18 @@ const MdxComponents = {
9498
</div>
9599
);
96100
},
97-
a: ({ href, children }) =>
98-
href.startsWith('/') ? (
101+
a: ({ href, children }) => {
102+
const classes = useHeadingStyles();
103+
return href.startsWith('/') ? (
99104
<RouterLink href={href}>
100105
<Link href={href}>{children}</Link>
101106
</RouterLink>
102107
) : (
103-
<Link href={href} rel="noopener noreferrer" target="_blank">
108+
<Link className={classes.link} href={href} rel="noopener noreferrer" target="_blank">
104109
{children}
105110
</Link>
106-
),
111+
);
112+
},
107113
h1: (props) => <Heading {...props} level={4} component="h1" />,
108114
h2: (props) => <Heading {...props} level={5} component="h2" />,
109115
h3: (props) => <Heading {...props} level={6} component="h3" />,

packages/react-renderer-demo/src/app/src/components/navigation/nav-styles.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ export const navStyles = (theme) => ({
3030
listRoot: {
3131
width: '100%',
3232
maxWidth: 360,
33-
backgroundColor: theme.palette.background.paper
33+
backgroundColor: theme.palette.background.paper,
34+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
35+
fontSize: '0.875rem'
3436
},
3537
nested: {
3638
padding: '8px 16px !important',
37-
justifyContent: 'flex-start !important'
39+
justifyContent: 'flex-start !important',
40+
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
41+
fontSize: '0.875rem'
3842
},
3943
listItem: {
4044
padding: '8px 16px !important',

packages/react-renderer-demo/src/app/src/helpers/list-of-contents.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ const useLinkStyles = makeStyles((theme) => ({
2929
paddingLeft: 16,
3030
paddingRight: 16,
3131
paddingTop: 8,
32-
paddingBottom: 8
32+
paddingBottom: 8,
33+
fontWeight: 'inherit'
3334
}
3435
}));
3536

0 commit comments

Comments
 (0)