From bb08577f8f1ac59f04f6ed4e3761e4d6f0a7ea2c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 7 Jan 2015 13:56:15 +0100 Subject: [PATCH] SONAR-6028 Fix formatting of issue comments --- .../src/main/less/components/issues.less | 2 + .../src/main/less/components/typography.less | 80 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 server/sonar-web/src/main/less/components/typography.less diff --git a/server/sonar-web/src/main/less/components/issues.less b/server/sonar-web/src/main/less/components/issues.less index a0b8ae54b8b..c28351bdd77 100644 --- a/server/sonar-web/src/main/less/components/issues.less +++ b/server/sonar-web/src/main/less/components/issues.less @@ -1,6 +1,7 @@ @import (reference) "../variables"; @import (reference) "../mixins"; @import (reference) "../ui"; +@import (reference) "../components/typography"; @leftPadding: 10px; @rightPadding: 10px; @@ -163,6 +164,7 @@ padding-left: 5px; padding-right: 5px; line-height: 18px; + .formatted; } .issue-comment-actions { diff --git a/server/sonar-web/src/main/less/components/typography.less b/server/sonar-web/src/main/less/components/typography.less new file mode 100644 index 00000000000..24d960ff196 --- /dev/null +++ b/server/sonar-web/src/main/less/components/typography.less @@ -0,0 +1,80 @@ +@import (reference) "../variables"; +@import (reference) "../mixins"; +@import (reference) "../ui"; + +.formatted() { + max-width: 1020px; + line-height: 1.5; + + p, ul, ol, pre, blockquote, table, h2, h3, h4, h5, h6 { + margin: 1em 0; + } + + h2 { + font-size: @bigFontSize; + font-weight: 400; + } + + h3, h4, h5, h6 { + font-size: @baseFontSize; + font-weight: 500; + } + + pre, code { + font-family: @monoFontFamily; + font-size: @smallFontSize; + } + + pre { + max-width: 1020px; + padding: 10px; + border-top: 1px solid @barBorderColor; + border-bottom: 1px solid @barBorderColor; + line-height: 18px; + overflow: auto; + } + + code { + font-weight: 600; + } + + blockquote { + line-height: 1.5; + padding-left: 15px; + padding-right: 15px; + } + + ul { + padding-left: 40px; + list-style: disc; + } + + li > ul { + margin: 0.3em 0; + } + + ol { + padding-left: 40px; + list-style: decimal; + } + + table { + min-width: 50%; + border-collapse: collapse; + border: 1px solid @barBorderColor; + } + + th { + padding: 5px 10px; + border: 1px solid @barBorderColor; + background-color: @barBackgroundColor; + font-weight: 500; + text-align: center; + } + + td { + padding: 5px 10px; + border: 1px solid @barBorderColor; + } + +} -- 2.39.5