Skip to content

Commit b0b808b

Browse files
authored
resolves #27 fix word wrap (PR #34)
* apply word-wrap anywhere to body * reset word-wrap to normal for tables * reapply word-wrap anywhere to admonition content cell * disable hyphens in more cases * move assignments with context
1 parent 775b9ec commit b0b808b

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

src/css/base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ body {
2727
font-family: var(--body-font-family);
2828
line-height: var(--body-line-height);
2929
margin: 0;
30+
word-wrap: anywhere; /* aka overflow-wrap; used when hyphens are disabled or aren't sufficient */
3031
}
3132

3233
a {

src/css/body.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.body {
2-
word-wrap: anywhere; /* aka overflow-wrap; used when hyphens are disabled or aren't sufficient */
3-
}
4-
51
@media screen and (min-width: 1024px) {
62
.body {
73
display: flex;

src/css/doc.css

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@
106106
margin: 0;
107107
}
108108

109-
.doc .tableblock p {
110-
font-size: inherit;
109+
.doc table {
110+
word-wrap: normal; /* don't do arbitrary word breaking */
111111
}
112112

113113
.doc a {
@@ -119,11 +119,16 @@
119119
/* -webkit-text-stroke-width: 0.01em; */
120120
}
121121

122+
.doc a.bare {
123+
hyphens: none;
124+
}
125+
122126
.doc a.unresolved {
123127
color: var(--link_unresolved-font-color);
124128
}
125129

126130
.doc i.fa {
131+
hyphens: none;
127132
font-style: normal;
128133
}
129134

@@ -136,6 +141,11 @@
136141
padding: 0.125em 0.25em;
137142
}
138143

144+
.doc code,
145+
.doc pre {
146+
hyphens: none;
147+
}
148+
139149
.doc pre {
140150
font-size: calc(16 / var(--rem-base) * 1rem);
141151
line-height: 1.5;
@@ -195,7 +205,6 @@
195205
/* alternative is to wrap table in div and set overflow-x: auto on the wrapper */
196206
/* another alternative is to set overflow-x: auto and display: block on table (but this breaks table borders) */
197207
/* table-layout: fixed; */
198-
word-wrap: normal; /* don't do arbitrary word breaking */
199208
/*
200209
display: block;
201210
overflow-x: auto;
@@ -277,6 +286,10 @@
277286
background: var(--table-stripe-background);
278287
}
279288

289+
.doc .tableblock p {
290+
font-size: inherit;
291+
}
292+
280293
.doc .halign-left {
281294
text-align: left;
282295
}
@@ -329,7 +342,11 @@
329342
.doc .admonitionblock td.content {
330343
padding: 1rem 1rem 0.75rem;
331344
background: var(--admonition-background);
345+
/*
346+
border: 1px solid var(--color-smoke-90);
347+
*/
332348
width: 100%;
349+
word-wrap: anywhere;
333350
}
334351

335352
.doc .admonitionblock .icon {
@@ -779,7 +796,7 @@
779796
}
780797

781798
.doc b.button {
782-
white-space: nowrap;
799+
white-space: nowrap; /* effectively ignores hyphens setting */
783800
}
784801

785802
.doc b.button::before {
@@ -801,7 +818,7 @@
801818
box-shadow: 0 1px 0 var(--kbd-border-color), 0 0 0 0.1em var(--body-background) inset;
802819
padding: 0.25em 0.5em;
803820
vertical-align: text-bottom;
804-
white-space: nowrap;
821+
white-space: nowrap; /* effectively ignores hyphens setting */
805822
}
806823

807824
.doc kbd,
@@ -825,19 +842,14 @@
825842
margin-right: 0;
826843
}
827844

845+
.doc .menuseq,
846+
.doc .path {
847+
hyphens: none;
848+
}
849+
828850
.doc .menuseq i.caret::before {
829851
content: "\203a";
830852
font-size: 1.1em;
831853
font-weight: var(--body-font-weight-bold);
832854
line-height: calc(1 / 1.1);
833855
}
834-
835-
.doc a.bare,
836-
.doc b.button,
837-
.doc code,
838-
.doc .path,
839-
.doc kbd,
840-
.doc .menuseq,
841-
.doc .icon i::after {
842-
hyphens: none;
843-
}

0 commit comments

Comments
 (0)