summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone <annabel.dunstone@gmail.com>2016-08-04 14:29:45 -0500
committerAnnabel Dunstone <annabel.dunstone@gmail.com>2016-08-12 17:17:23 -0500
commit3eba2e4f70f18f2a86d0134e264e963d67cbac45 (patch)
tree863c2839292eeb4f3c5971cad696fb9955ad06bf
parent11eefba891f214eefc1efa334adbcc9e979c0ce3 (diff)
downloadgitlab-ce-3eba2e4f70f18f2a86d0134e264e963d67cbac45.tar.gz
Wrap single lines of code; horizontally scroll multi-line code blocks
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/stylesheets/framework/typography.scss10
-rw-r--r--app/assets/stylesheets/pages/detail_page.scss8
3 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 96965a20f69..11ca5a414bc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -95,6 +95,7 @@ v 8.11.0 (unreleased)
- Sensible state specific default sort order for issues and merge requests !5453 (tomb0y)
- Fix bug where destroying a namespace would not always destroy projects
- Fix RequestProfiler::Middleware error when code is reloaded in development
+ - Allow horizontal scrolling of code blocks in issue body
- Catch what warden might throw when profiling requests to re-throw it
- Avoid commit lookup on diff_helper passing existing local variable to the helper method
- Add description to new_issue email and new_merge_request_email in text/plain content type. !5663 (dixpac)
diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss
index 8659604cb8b..06874a993fa 100644
--- a/app/assets/stylesheets/framework/typography.scss
+++ b/app/assets/stylesheets/framework/typography.scss
@@ -14,12 +14,20 @@
margin-top: 0;
}
+ // Single code lines should wrap
code {
font-family: $monospace_font;
- white-space: pre;
+ white-space: pre-wrap;
word-wrap: normal;
}
+ // Multi-line code blocks should scroll horizontally
+ pre {
+ code {
+ white-space: pre;
+ }
+ }
+
kbd {
display: inline-block;
padding: 3px 5px;
diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss
index 1b389d83525..742984d6c7a 100644
--- a/app/assets/stylesheets/pages/detail_page.scss
+++ b/app/assets/stylesheets/pages/detail_page.scss
@@ -36,9 +36,17 @@
}
.wiki {
+ // Single lines of code should wrap
code {
white-space: pre-wrap;
word-break: keep-all;
}
+
+ // Code blocks should scroll horizontally
+ pre {
+ code {
+ white-space: pre;
+ }
+ }
}
}