]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_text.scss
Fixed inline code overflowing off of page in issue #1575.
[bookstack] / resources / assets / sass / _text.scss
1 /**
2  * Fonts
3  */
4
5 body, button, input, select, label, textarea {
6   font-family: $text;
7 }
8 .Codemirror, pre, #markdown-editor-input, .editor-toolbar, .code-base {
9   font-family: $mono;
10 }
11
12 /*
13  * Header Styles
14  */
15
16 h1 {
17   font-size: 3.425em;
18   line-height: 1.22222222em;
19   margin-top: 0.48888889em;
20   margin-bottom: 0.48888889em;
21 }
22 h2 {
23   font-size: 2.8275em;
24   line-height: 1.294117647em;
25   margin-top: 0.8627451em;
26   margin-bottom: 0.43137255em;
27 }
28 h3 {
29   font-size: 2.333em;
30   line-height: 1.221428572em;
31   margin-top: 0.78571429em;
32   margin-bottom: 0.43137255em;
33 }
34 h4 {
35   font-size: 1.666em;
36   line-height: 1.375em;
37   margin-top: 0.78571429em;
38   margin-bottom: 0.43137255em;
39 }
40
41 h1, h2, h3, h4, h5, h6 {
42   font-weight: 400;
43   position: relative;
44   display: block;
45   color: #222;
46   .subheader {
47     font-size: 0.5em;
48     line-height: 1em;
49     color: lighten($text-dark, 32%);
50   }
51 }
52
53 h5 {
54   font-size: 1.4em;
55 }
56
57 h5, h6 {
58   line-height: 1.2em;
59   margin-top: 0.78571429em;
60   margin-bottom: 0.66em;
61 }
62
63 @include smaller-than($s) {
64   h1 {
65     font-size: 2.8275em;
66   }
67   h2 {
68     font-size: 2.333em;
69   }
70   h3 {
71     font-size: 1.666em;
72   }
73   h4 {
74     font-size: 1.333em;
75   }
76   h5 {
77     font-size: 1.161616em;
78   }
79 }
80
81 .list-heading {
82   font-size: 2rem;
83 }
84
85 h2.list-heading {
86   font-size: 1.333rem;
87 }
88
89 /*
90  * Link styling
91  */
92 a {
93   color: $primary;
94   cursor: pointer;
95   text-decoration: none;
96   transition: color ease-in-out 80ms;
97   line-height: 1.6;
98   &:hover {
99     text-decoration: underline;
100     color: darken($primary, 20%);
101   }
102   &.icon {
103     display: inline-block;
104   }
105   svg {
106     position: relative;
107     display: inline-block;
108   }
109 }
110
111 .blended-links a {
112   color: inherit;
113   svg {
114     fill: currentColor;
115   }
116 }
117
118 /*
119  * Other HTML Text Elements
120  */
121 p, ul, ol, pre, table, blockquote {
122   margin-top: 0.3em;
123   margin-bottom: 1.375em;
124 }
125
126 hr {
127   border: 0;
128   height: 1px;
129   background: #EAEAEA;
130   margin-bottom: $-l;
131   &.faded {
132     background-image: linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF);
133   }
134   &.margin-top, &.even {
135     margin-top: $-l;
136   }
137 }
138
139 strong, b, .bold, .strong {
140   font-weight: bold;
141   > strong, > b, > .bold, > .strong {
142     font-weight: bolder;
143   }
144 }
145
146 em, i, .italic {
147   font-style: italic;
148 }
149
150 small, p.small, span.small, .text-small {
151   font-size: 0.75rem;
152   color: lighten($text-dark, 10%);
153 }
154
155 sup, .superscript {
156   vertical-align: super;
157   font-size: 0.8em;
158 }
159
160 sub, .subscript {
161   vertical-align: sub;
162   font-size: 0.8em;
163 }
164
165 pre {
166   font-size: 12px;
167   background-color: #f5f5f5;
168   border: 1px solid #DDD;
169   padding-left: 31px;
170   position: relative;
171   padding-top: 3px;
172   padding-bottom: 3px;
173   &:after {
174     content: '';
175     display: block;
176     position: absolute;
177     top: 0;
178     width: 29px;
179     left: 0;
180     background-color: #f5f5f5;
181     height: 100%;
182     border-right: 1px solid #DDD;
183   }
184 }
185
186 @media print {
187   pre {
188     padding-left: 12px;
189   }
190   pre:after {
191     display: none;
192   }
193 }
194
195 blockquote {
196   display: block;
197   position: relative;
198   border-left: 4px solid $primary;
199   background-color: #F8F8F8;
200   padding: $-s $-m $-s $-xl;
201   &:before {
202     content: "\201C";
203     font-size: 2em;
204     font-weight: bold;
205     position: absolute;
206     top: $-s;
207     left: $-s;
208     color: lighten($text-dark, 20%);
209   }
210 }
211
212 .code-base {
213     background-color: #F8F8F8;
214     font-size: 0.80em;
215     border: 1px solid #DDD;
216     border-radius: 3px;
217 }
218
219 code {
220   @extend .code-base;
221   display: inline;
222   padding: 1px 3px;
223   white-space:pre-wrap;
224   line-height: 1.2em;
225   margin-bottom: 1.2em;
226 }
227
228 span.code {
229   @extend .code-base;
230   padding: 1px $-xs;
231 }
232
233 pre code {
234   background-color: transparent;
235   border: 0;
236   font-size: 1em;
237   display: block;
238   line-height: 1.6;
239 }
240
241 span.highlight {
242   //background-color: rgba($primary, 0.2);
243   font-weight: bold;
244   padding: 2px 4px;
245 }
246
247 /*
248  * Lists
249  */
250 ul, ol {
251   overflow: hidden;
252   p {
253     margin: 0;
254   }
255 }
256 ul {
257   padding-left: $-m * 1.3;
258   padding-right: $-m * 1.3;
259   list-style: disc;
260   ul {
261     list-style: circle;
262     margin-top: 0;
263     margin-bottom: 0;
264   }
265   label {
266     margin: 0;
267   }
268 }
269
270 ol {
271   list-style: decimal;
272   padding-left: $-m * 2;
273   padding-right: $-m * 2;
274 }
275
276 li.checkbox-item, li.task-list-item {
277   list-style: none;
278   margin-left: - ($-m * 1.3);
279   input[type="checkbox"] {
280     margin-right: $-xs;
281   }
282 }
283
284 /*
285  * Generic text styling classes
286  */
287 .underlined {
288   text-decoration: underline;
289 }
290
291 .text-center {
292   text-align: center;
293 }
294 .text-left {
295   text-align: left;
296 }
297 .text-right {
298   text-align: right;
299 }
300
301 @each $sizeLetter, $size in $screen-sizes {
302   @include larger-than($size) {
303     .text-#{$sizeLetter}-center {
304       text-align: center;
305     }
306     .text-#{$sizeLetter}-left {
307       text-align: left;
308     }
309     .text-#{$sizeLetter}-right {
310       text-align: right;
311     }
312   }
313 }
314
315 .text-bigger {
316   font-size: 1.1em;
317 }
318
319 .text-large {
320   font-size: 1.6666em;
321 }
322
323 .no-color {
324   color: inherit;
325 }
326
327 .break-text {
328   word-wrap: break-word;
329   overflow-wrap: break-word;
330 }
331
332 .limit-text {
333   white-space: nowrap;
334   overflow: hidden;
335   text-overflow: ellipsis;
336 }
337
338 /**
339  * Grouping
340  */
341 .header-group {
342   margin: $-m 0;
343   h1, h2, h3, h4, h5, h6 {
344     margin: 0;
345   }
346 }
347
348 span.sep {
349   color: #BBB;
350   padding: 0 $-xs;
351 }
352
353 .list > * {
354   display: block;
355 }
356
357 /**
358   * Icons
359   */
360 .svg-icon {
361   width: 1em;
362   height: 1em;
363   display: inline-block;
364   position: relative;
365   bottom: -0.105em;
366   margin-right: $-xs;
367   pointer-events: none;
368 }