]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_text.scss
Merge branch 'master' into bug/image-upload
[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: #555;
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   font-weight: 500;
59   line-height: 1.2em;
60   margin-top: 0.78571429em;
61   margin-bottom: 0.66em;
62 }
63
64 @include smaller-than($s) {
65   h1 {
66     font-size: 2.8275em;
67   }
68   h2 {
69     font-size: 2.333em;
70   }
71   h3 {
72     font-size: 1.666em;
73   }
74   h4 {
75     font-size: 1.333em;
76   }
77   h5 {
78     font-size: 1.161616em;
79   }
80 }
81
82 /*
83  * Link styling
84  */
85 a, .link {
86   color: $primary;
87   cursor: pointer;
88   text-decoration: none;
89   transition: color ease-in-out 80ms;
90   line-height: 1.6;
91   &:hover {
92     text-decoration: underline;
93     color: darken($primary, 20%);
94   }
95   &.icon {
96     display: inline-block;
97   }
98   svg {
99     position: relative;
100     display: inline-block;
101   }
102 }
103
104 /*
105  * Other HTML Text Elements
106  */
107 p, ul, ol, pre, table, blockquote {
108   margin-top: 0.3em;
109   margin-bottom: 1.375em;
110 }
111
112 hr {
113   border: 0;
114   height: 1px;
115   background: #EAEAEA;
116   margin-bottom: $-l;
117   &.faded {
118     background-image: linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF);
119   }
120   &.margin-top, &.even {
121     margin-top: $-l;
122   }
123 }
124
125 strong, b, .bold, .strong {
126   font-weight: bold;
127   > strong, > b, > .bold, > .strong {
128     font-weight: bolder;
129   }
130 }
131
132 em, i, .italic {
133   font-style: italic;
134 }
135
136 small, p.small, span.small, .text-small {
137   font-size: 0.8em;
138   color: lighten($text-dark, 20%);
139   small, p.small, span.small, .text-small {
140     font-size: 1em;
141   }
142 }
143
144 sup, .superscript {
145   vertical-align: super;
146   font-size: 0.8em;
147 }
148
149 sub, .subscript {
150   vertical-align: sub;
151   font-size: 0.8em;
152 }
153
154 pre {
155   font-size: 12px;
156   background-color: #f5f5f5;
157   border: 1px solid #DDD;
158   padding-left: 31px;
159   position: relative;
160   padding-top: 3px;
161   padding-bottom: 3px;
162   &:after {
163     content: '';
164     display: block;
165     position: absolute;
166     top: 0;
167     width: 29px;
168     left: 0;
169     background-color: #f5f5f5;
170     height: 100%;
171     border-right: 1px solid #DDD;
172   }
173 }
174
175 @media print {
176   pre {
177     padding-left: 12px;
178   }
179   pre:after {
180     display: none;
181   }
182 }
183
184 blockquote {
185   display: block;
186   position: relative;
187   border-left: 4px solid $primary;
188   background-color: #F8F8F8;
189   padding: $-s $-m $-s $-xl;
190   &:before {
191     content: "\201C";
192     font-size: 2em;
193     font-weight: bold;
194     position: absolute;
195     top: $-s;
196     left: $-s;
197     color: lighten($text-dark, 20%);
198   }
199 }
200
201 .code-base {
202     background-color: #F8F8F8;
203     font-size: 0.80em;
204     border: 1px solid #DDD;
205     border-radius: 3px;
206 }
207
208 code {
209   @extend .code-base;
210   display: inline;
211   padding: 1px 3px;
212   white-space:pre;
213   line-height: 1.2em;
214   margin-bottom: 1.2em;
215 }
216
217 span.code {
218   @extend .code-base;
219   padding: 1px $-xs;
220 }
221
222 pre code {
223   background-color: transparent;
224   border: 0;
225   font-size: 1em;
226   display: block;
227   line-height: 1.6;
228 }
229 /*
230  * Text colors
231  */
232 p.pos, p .pos, span.pos, .text-pos {
233   color: $positive;
234   fill: $positive;
235   &:hover {
236     color: $positive;
237     fill: $positive;
238   }
239 }
240
241 p.neg, p .neg, span.neg, .text-neg {
242   color: $negative;
243   fill: $negative;
244   &:hover {
245     color: $negative;
246     fill: $negative;
247   }
248 }
249
250 p.muted, p .muted, span.muted, .text-muted {
251         color: lighten($text-dark, 26%);
252         fill: lighten($text-dark, 26%);
253     &.small, .small {
254       color: lighten($text-dark, 32%);
255       fill: lighten($text-dark, 32%);
256     }
257 }
258
259 p.primary, p .primary, span.primary, .text-primary {
260         color: $primary;
261         fill: $primary;
262   &:hover {
263     color: $primary;
264     fill: $primary;
265   }
266 }
267
268 p.secondary, p .secondary, span.secondary, .text-secondary {
269         color: $secondary;
270         fill: $secondary;
271   &:hover {
272     color: $secondary;
273     fill: $secondary;
274   }
275 }
276
277 .text-book {
278   color: $color-book;
279   fill: $color-book;
280   &:hover {
281     color: $color-book;
282     fill: $color-book;
283   }
284 }
285 .text-page {
286   color: $color-page;
287   fill: $color-page;
288   &:hover {
289     color: $color-page;
290     fill: $color-page;
291   }
292   &.draft {
293     color: $color-page-draft;
294     fill: $color-page-draft;
295   }
296   &.draft:hover {
297     color: $color-page-draft;
298     fill: $color-page-draft;
299   }
300 }
301 .text-chapter {
302   color: $color-chapter;
303   fill: $color-chapter;
304   &:hover {
305     color: $color-chapter;
306     fill: $color-chapter;
307   }
308 }
309 .faded .text-book:hover {
310   color: $color-book !important;
311   fill: $color-book !important;
312 }
313 .faded .text-chapter:hover {
314   color: $color-chapter !important;
315   fill: $color-chapter !important;
316 }
317 .faded .text-page:hover {
318   color: $color-page !important;
319   fill: $color-page !important;
320 }
321
322 span.highlight {
323   //background-color: rgba($primary, 0.2);
324   font-weight: bold;
325   padding: 2px 4px;
326 }
327
328 /*
329  * Lists
330  */
331 ul, ol {
332   overflow: hidden;
333   p {
334     margin: 0;
335   }
336 }
337 ul {
338   padding-left: $-m * 1.3;
339   list-style: disc;
340   ul {
341     list-style: circle;
342     margin-top: 0;
343     margin-bottom: 0;
344   }
345   label {
346     margin: 0;
347   }
348 }
349
350 ol {
351   list-style: decimal;
352   padding-left: $-m * 2;
353 }
354
355 li.checkbox-item, li.task-list-item {
356   list-style: none;
357   margin-left: - ($-m * 1.3);
358   input[type="checkbox"] {
359     margin-right: $-xs;
360   }
361 }
362
363 /*
364  * Generic text styling classes
365  */
366 .underlined {
367   text-decoration: underline;
368 }
369
370 .text-center {
371   text-align: center;
372 }
373
374 .text-left {
375   text-align: left;
376 }
377
378 .text-right {
379   text-align: right;
380 }
381
382 .text-bigger {
383   font-size: 1.1em;
384 }
385
386 .text-large {
387   font-size: 1.6666em;
388 }
389
390 .no-color {
391   color: inherit;
392 }
393
394 .break-text {
395   word-wrap: break-word;
396   overflow-wrap: break-word;
397 }
398
399 /**
400  * Grouping
401  */
402 .header-group {
403   margin: $-m 0;
404   h1, h2, h3, h4, h5, h6 {
405     margin: 0;
406   }
407 }
408
409 span.sep {
410   color: #BBB;
411   padding: 0 $-xs;
412 }
413
414 .list > * {
415   display: block;
416 }
417
418 /**
419   * Icons
420   */
421 i {
422   padding-right: $-xs;
423 }
424
425 .svg-icon {
426   width: 1em;
427   display: inline-block;
428   position: relative;
429   bottom: -0.105em;
430   margin-right: $-xs;
431 }
432