mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-06-15 18:08:15 +08:00
Fix font family in pre > code
This commit is contained in:
6
packages/react-dev-utils/failFast.js
vendored
6
packages/react-dev-utils/failFast.js
vendored
@@ -86,6 +86,10 @@
|
||||
'font-size': '1.1em'
|
||||
}
|
||||
|
||||
const codeStyle = {
|
||||
'font-family': 'Consolas, Menlo, monospace',
|
||||
}
|
||||
|
||||
function calcWidth(width) {
|
||||
if (width >= 1200) return '1170px'
|
||||
if (width >= 992) return '970px'
|
||||
@@ -147,6 +151,8 @@
|
||||
const htmlHighlight = ansiHTML(ansiHighlight)
|
||||
const code = document.createElement('code')
|
||||
code.innerHTML = htmlHighlight
|
||||
applyStyles(code, codeStyle)
|
||||
|
||||
const pre = document.createElement('pre')
|
||||
applyStyles(pre, preStyle)
|
||||
pre.appendChild(code)
|
||||
|
||||
Reference in New Issue
Block a user