fix word-wrap (aka overflow-wrap) setting
authorDan Allen <dan@opendevise.com>
Thu, 10 Dec 2020 23:11:22 +0000 (16:11 -0700)
committerDan Allen <dan@opendevise.com>
Thu, 10 Dec 2020 23:11:22 +0000 (16:11 -0700)
- enable word-wrap anywhere by default
- disable word-wrap (reset to normal) in tables (except content cell of admonition table)

src/css/base.css
src/css/body.css
src/css/doc.css
src/css/header.css

index 7a9e1c3..6264031 100644 (file)
@@ -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 */
+}
index 2532306..1d4db3d 100644 (file)
@@ -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;
index 15ec988..caa6fd1 100644 (file)
   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;
 }
 
   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;
   padding: 1rem 1rem 0.75rem;
   background: var(--admonition-background);
   width: 100%;
+  word-wrap: anywhere;
 }
 
 .doc .admonitionblock .icon {
 }
 
 .doc b.button {
-  white-space: nowrap;
+  white-space: nowrap; /* effectively ignores hyphens setting */
 }
 
 .doc b.button::before {
   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,
   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 */
-}
index c919f83..04b07f3 100644 (file)
@@ -14,7 +14,6 @@ body {
   position: fixed;
   top: 0;
   width: 100%;
-  word-wrap: break-word;
   z-index: var(--z-index-navbar);
 }