Skip to content

Commit d29a630

Browse files
Fine-tune prism syntax highlighting and change <pre> and <kbd> font
1 parent e1eebba commit d29a630

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

web/components/DescriptiveItem.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
import React from 'react'
22
import Highlight, { defaultProps } from 'prism-react-renderer'
33
import styled from 'styled-components'
4-
import duotoneLight from 'prism-react-renderer/themes/duotoneLight'
4+
import duotoneLight from 'prism-react-renderer/themes/oceanicNext'
55

6-
// TODO: fix text overflow
76
const Pre = styled.pre`
8-
font-family: 'Courier Prime', monospace;
7+
font-family: 'Inconsolata', monospace;
98
font-size: .9em;
109
overflow: auto;
1110
text-align: left;
12-
/* margin: 1em 0; */
13-
padding: 0.5em;
11+
padding: 0.5em 0.5em 0.5em 0;
1412
& .token-line {
1513
line-height: 1.4em;
1614
height: 1.3em;
1715
}
1816
`
1917
const LineNo = styled.span`
2018
display: inline-block;
21-
padding-right: 1em;
19+
text-align: right;
20+
width: 1.5em;
21+
margin: 0 1em 0 0;
2222
user-select: none;
2323
opacity: 0.5;
24+
color: rgb(144, 210, 245);
2425
`
25-
// const Line = styled.div`
26-
// display: table-row;
27-
// `
28-
// const LineContent = styled.span`
29-
// display: table-cell;
30-
// `
3126

3227
export default function DescriptiveItem({ section }) {
3328
console.log('DescriptiveItem props: ', section)

web/src/styles/global.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@200;300;400;500;600&display=swap');
66

7-
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');
7+
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300;400;500&display=swap');
88

99
* {
1010
padding: 0;
@@ -211,7 +211,7 @@ tr th:first-child, tr td:first-child {
211211
}
212212

213213
kbd {
214-
font-family: 'Courier Prime', monospace;
214+
font-family: 'Inconsolata', monospace;
215215
background-color: rgb(34, 34, 34);
216216
color: white;
217217
padding: 5px;
@@ -220,10 +220,6 @@ kbd {
220220
font-size: .9em;
221221
}
222222

223-
/* pre {
224-
font-family: 'Courier Prime', monospace;
225-
} */
226-
227223
footer {
228224
height: 100px;
229225
margin: 40px 0 0;

0 commit comments

Comments
 (0)