aboutsummaryrefslogtreecommitdiffstats
path: root/public/less/_base.less
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2019-02-02 17:58:28 +0100
committerzeripath <art27@cantab.net>2019-02-02 16:58:28 +0000
commit12ee544411e2c3de410459494ab40536b45941bc (patch)
tree2f76cf6c53feaa11be9583ea5c504aa93ba89e48 /public/less/_base.less
parentaf22df8314a0ddfe180de04d70d4b3d70fdbf23d (diff)
downloadgitea-12ee544411e2c3de410459494ab40536b45941bc.tar.gz
gitea-12ee544411e2c3de410459494ab40536b45941bc.zip
Fix wrapping long code lines in UI (#5927)
Wrapping was initially added in https://github.com/go-gitea/gitea/pull/2789 but it is currently disabled because the rule that applies wrapping to the wrap class did not have enough CSS specificity. Resolved the issue by using a general selector that matches all code boxes. The previous wrap class was removed because it had only been inconsistenly applied to various code boxes and because I found no easy way to add classes to code boxes rendered in Markdown. Also removed a seemingly useless :before on code view and added padding to restore the spacing.
Diffstat (limited to 'public/less/_base.less')
-rw-r--r--public/less/_base.less23
1 files changed, 6 insertions, 17 deletions
diff --git a/public/less/_base.less b/public/less/_base.less
index 7f156839df..d7cc518175 100644
--- a/public/less/_base.less
+++ b/public/less/_base.less
@@ -27,26 +27,15 @@ pre, code {
line-height: 1.5;
overflow: auto;
}
- &.wrap {
- white-space: pre-wrap; /* CSS 3 */
-// white-space: -moz-normal; /* Mozilla, since 1999 */
-// white-space: -normal; /* Opera 4-6 */
-// white-space: -o-normal; /* Opera 7 */
-
- -ms-word-break: break-all;
- word-break: break-all;
-
- /* These are technically the same, but use both */
- overflow-wrap: break-word;
- word-wrap: break-word;
- }
+}
+/* Wrap long lines of code. This will also apply to Markdown code boxes. */
+pre > code {
+ white-space: pre-wrap !important;
+ word-break: break-all !important;
+ overflow-wrap: break-word !important;
}
.dont-break-out {
- /* These are technically the same, but use both */
overflow-wrap: break-word;
- word-wrap: break-word;
-
- -ms-word-break: break-all;
word-break: break-all;
/* Adds a hyphen where the word breaks, if supported (No Blink) */