From: Dan Allen Date: Thu, 10 Dec 2020 23:11:22 +0000 (-0700) Subject: fix word-wrap (aka overflow-wrap) setting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=96d099840cf24b3e77b9839dc5f0fbebdcedf2ef;p=eg-antora.git fix word-wrap (aka overflow-wrap) setting - enable word-wrap anywhere by default - disable word-wrap (reset to normal) in tables (except content cell of admonition table) --- diff --git a/src/css/base.css b/src/css/base.css index 7a9e1c3..6264031 100644 --- a/src/css/base.css +++ b/src/css/base.css @@ -27,6 +27,7 @@ body { font-family: var(--body-font-family); line-height: var(--body-line-height); margin: 0; + word-wrap: anywhere; /* aka overflow-wrap; used when hyphens are disabled or aren't sufficient */ } a { @@ -62,10 +63,6 @@ strong strong { /* stylelint-disable-line */ font-weight: normal; } -table { - border-collapse: collapse; -} - button { cursor: pointer; font-family: inherit; @@ -78,3 +75,8 @@ button::-moz-focus-inner { border: none; padding: 0; } + +table { + border-collapse: collapse; + word-wrap: normal; /* table widths aren't computed as expected when word-wrap is enabled */ +} diff --git a/src/css/body.css b/src/css/body.css index 2532306..1d4db3d 100644 --- a/src/css/body.css +++ b/src/css/body.css @@ -1,7 +1,3 @@ -.body { - word-wrap: break-word; /* aka overflow-wrap; used when hyphens are disabled or don't do the trick */ -} - @media screen and (min-width: 1024px) { .body { display: flex; diff --git a/src/css/doc.css b/src/css/doc.css index 15ec988..caa6fd1 100644 --- a/src/css/doc.css +++ b/src/css/doc.css @@ -116,11 +116,16 @@ color: var(--link_hover-font-color); } +.doc a.bare { + hyphens: none; +} + .doc a.unresolved { color: var(--link_unresolved-font-color); } .doc i.fa { + hyphens: none; font-style: normal; } @@ -133,6 +138,11 @@ padding: 0.125em 0.25em; } +.doc code, +.doc pre { + hyphens: none; +} + .doc pre { font-size: calc(16 / var(--rem-base) * 1rem); line-height: 1.5; @@ -261,6 +271,7 @@ padding: 1rem 1rem 0.75rem; background: var(--admonition-background); width: 100%; + word-wrap: anywhere; } .doc .admonitionblock .icon { @@ -641,7 +652,7 @@ } .doc b.button { - white-space: nowrap; + white-space: nowrap; /* effectively ignores hyphens setting */ } .doc b.button::before { @@ -663,7 +674,7 @@ box-shadow: 0 1px 0 var(--kbd-border-color), 0 0 0 0.1em var(--body-background) inset; padding: 0.25em 0.5em; vertical-align: text-bottom; - white-space: nowrap; + white-space: nowrap; /* effectively ignores hyphens setting */ } .doc kbd, @@ -687,24 +698,14 @@ margin-right: 0; } +.doc .menuseq, +.doc .path { + hyphens: none; +} + .doc .menuseq i.caret::before { content: "\203a"; font-size: 1.1em; font-weight: var(--body-font-weight-bold); line-height: calc(1 / 1.1); } - -.doc a.bare, -.doc b.button, -.doc code, -.doc .path, -.doc kbd, -.doc .menuseq, -.doc .icon i::after { - hyphens: none; -} - -.doc th.tableblock, -.doc td.tableblock { - word-break: break-word; /* overflow-wrap for table cells; gives space higher precedence than hyphen opportunity */ -} diff --git a/src/css/header.css b/src/css/header.css index c919f83..04b07f3 100644 --- a/src/css/header.css +++ b/src/css/header.css @@ -14,7 +14,6 @@ body { position: fixed; top: 0; width: 100%; - word-wrap: break-word; z-index: var(--z-index-navbar); }