Skip to content

Commit

Permalink
Use relative size for markdown code font size
Browse files Browse the repository at this point in the history
Fixes #74125
  • Loading branch information
mjbvz committed May 22, 2019
1 parent b92e571 commit f250d19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions extensions/markdown-language-features/media/markdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

body {
html, body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif;
font-size: 14px;
padding: 0 26px;
Expand Down Expand Up @@ -32,7 +32,6 @@ body {
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}


body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
Expand Down Expand Up @@ -169,19 +168,14 @@ blockquote {

code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 14px;
line-height: 19px;
font-size: 1rem;
line-height: 1.357rem;
}

body.wordWrap pre {
white-space: pre-wrap;
}

.mac code {
font-size: 12px;
line-height: 18px;
}

pre:not(.hljs),
pre.hljs code > div {
padding: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class MarkdownContentProvider {

private getSettingsOverrideStyles(nonce: string, config: MarkdownPreviewConfiguration): string {
return `<style nonce="${nonce}">
body {
html, body {
${config.fontFamily ? `font-family: ${config.fontFamily};` : ''}
${isNaN(config.fontSize) ? '' : `font-size: ${config.fontSize}px;`}
${isNaN(config.lineHeight) ? '' : `line-height: ${config.lineHeight};`}
Expand Down

0 comments on commit f250d19

Please sign in to comment.