From 5727d677efcc00eedad1f2a63f4e21696682ed8f Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Tue, 9 Feb 2021 11:51:09 +0100 Subject: [PATCH] SONAR-14207 Add Ubuntu Mono as a font for the source code viewer --- server/sonar-web/src/main/js/app/styles/init/base.css | 2 +- server/sonar-web/src/main/js/app/styles/init/forms.css | 2 +- server/sonar-web/src/main/js/app/styles/init/type.css | 2 +- server/sonar-web/src/main/js/app/styles/style.css | 4 ++-- server/sonar-web/src/main/js/app/theme.js | 3 +-- server/sonar-web/src/main/js/apps/coding-rules/styles.css | 4 ++-- .../src/main/js/components/SourceViewer/components/Line.css | 2 +- 7 files changed, 9 insertions(+), 10 deletions(-) diff --git a/server/sonar-web/src/main/js/app/styles/init/base.css b/server/sonar-web/src/main/js/app/styles/init/base.css index c46e372bdda..30a7838c64c 100644 --- a/server/sonar-web/src/main/js/app/styles/init/base.css +++ b/server/sonar-web/src/main/js/app/styles/init/base.css @@ -102,7 +102,7 @@ code, kbd, samp, tt { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); font-size: var(--smallFontSize); line-height: 18px; } diff --git a/server/sonar-web/src/main/js/app/styles/init/forms.css b/server/sonar-web/src/main/js/app/styles/init/forms.css index 75c9ee6bd69..188d3d1b0fb 100644 --- a/server/sonar-web/src/main/js/app/styles/init/forms.css +++ b/server/sonar-web/src/main/js/app/styles/init/forms.css @@ -180,7 +180,7 @@ select { } .input-code { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); font-size: var(--smallFontSize); } diff --git a/server/sonar-web/src/main/js/app/styles/init/type.css b/server/sonar-web/src/main/js/app/styles/init/type.css index 843b7e76c7d..b03a9fcd4df 100644 --- a/server/sonar-web/src/main/js/app/styles/init/type.css +++ b/server/sonar-web/src/main/js/app/styles/init/type.css @@ -295,6 +295,6 @@ small, .monospaced { line-height: 18px; - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); font-size: var(--smallFontSize); } diff --git a/server/sonar-web/src/main/js/app/styles/style.css b/server/sonar-web/src/main/js/app/styles/style.css index 3ce76afe13a..fe11bc45891 100644 --- a/server/sonar-web/src/main/js/app/styles/style.css +++ b/server/sonar-web/src/main/js/app/styles/style.css @@ -122,7 +122,7 @@ .markdown pre, .rule-desc code, .markdown code { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); font-size: var(--smallFontSize); } @@ -211,7 +211,7 @@ code.rule { border: 1px dashed #aaa; box-sizing: border-box; font-size: var(--smallFontSize); - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); } .property blockquote, diff --git a/server/sonar-web/src/main/js/app/theme.js b/server/sonar-web/src/main/js/app/theme.js index 431e5654be6..2485185bba5 100644 --- a/server/sonar-web/src/main/js/app/theme.js +++ b/server/sonar-web/src/main/js/app/theme.js @@ -176,8 +176,7 @@ module.exports = { fonts: { baseFontFamily: "'Helvetica Neue', Helvetica, Arial, sans-serif", systemFontFamily: "-apple-system,'BlinkMacSystemFont','Helvetica','Arial',sans-serif", - sonarcloudFontFamily: - "Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif" + sourceCodeFontFamily: "Consolas, 'Ubuntu Mono', 'Liberation Mono', Menlo, Courier, monospace" }, // z-index diff --git a/server/sonar-web/src/main/js/apps/coding-rules/styles.css b/server/sonar-web/src/main/js/apps/coding-rules/styles.css index 1e1d6ccdc90..1f1d1535502 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/styles.css +++ b/server/sonar-web/src/main/js/apps/coding-rules/styles.css @@ -59,7 +59,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); } .coding-rules-detail-quality-profile-parameter + .coding-rules-detail-quality-profile-parameter { @@ -135,7 +135,7 @@ } .coding-rules-detail-parameter-value { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); word-break: break-all; } diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.css b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.css index 43615d8adee..311e044f4e6 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.css +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.css @@ -87,7 +87,7 @@ .source-line-number, .source-line-scm { line-height: 18px; - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-family: var(--sourceCodeFontFamily); font-size: var(--smallFontSize); } -- 2.39.5