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