]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_text.scss
Fixes issue with having to click the delete icon for attachment twice.
[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-book {
285   color: $color-book;
286   fill: $color-book;
287   &:hover {
288     color: $color-book;
289     fill: $color-book;
290   }
291 }
292 .text-page {
293   color: $color-page;
294   fill: $color-page;
295   &:hover {
296     color: $color-page;
297     fill: $color-page;
298   }
299   &.draft {
300     color: $color-page-draft;
301     fill: $color-page-draft;
302   }
303   &.draft:hover {
304     color: $color-page-draft;
305     fill: $color-page-draft;
306   }
307 }
308 .text-chapter {
309   color: $color-chapter;
310   fill: $color-chapter;
311   &:hover {
312     color: $color-chapter;
313     fill: $color-chapter;
314   }
315 }
316 .faded .text-book:hover {
317   color: $color-book !important;
318   fill: $color-book !important;
319 }
320 .faded .text-chapter:hover {
321   color: $color-chapter !important;
322   fill: $color-chapter !important;
323 }
324 .faded .text-page:hover {
325   color: $color-page !important;
326   fill: $color-page !important;
327 }
328
329 span.highlight {
330   //background-color: rgba($primary, 0.2);
331   font-weight: bold;
332   padding: 2px 4px;
333 }
334
335 /*
336  * Lists
337  */
338 ul, ol {
339   overflow: hidden;
340   p {
341     margin: 0;
342   }
343 }
344 ul {
345   padding-left: $-m * 1.3;
346   list-style: disc;
347   ul {
348     list-style: circle;
349     margin-top: 0;
350     margin-bottom: 0;
351   }
352   label {
353     margin: 0;
354   }
355 }
356
357 ol {
358   list-style: decimal;
359   padding-left: $-m * 2;
360 }
361
362 li.checkbox-item, li.task-list-item {
363   list-style: none;
364   margin-left: - ($-m * 1.3);
365   input[type="checkbox"] {
366     margin-right: $-xs;
367   }
368 }
369
370 /*
371  * Generic text styling classes
372  */
373 .underlined {
374   text-decoration: underline;
375 }
376
377 .text-center {
378   text-align: center;
379 }
380
381 .text-left {
382   text-align: left;
383 }
384
385 .text-right {
386   text-align: right;
387 }
388
389 .text-bigger {
390   font-size: 1.1em;
391 }
392
393 .text-large {
394   font-size: 1.6666em;
395 }
396
397 .no-color {
398   color: inherit;
399 }
400
401 .break-text {
402   word-wrap: break-word;
403   overflow-wrap: break-word;
404 }
405
406 /**
407  * Grouping
408  */
409 .header-group {
410   margin: $-m 0;
411   h1, h2, h3, h4, h5, h6 {
412     margin: 0;
413   }
414 }
415
416 span.sep {
417   color: #BBB;
418   padding: 0 $-xs;
419 }
420
421 .list > * {
422   display: block;
423 }
424
425 /**
426   * Icons
427   */
428 i {
429   padding-right: $-xs;
430 }
431
432 .svg-icon {
433   width: 1em;
434   height: 1em;
435   display: inline-block;
436   position: relative;
437   bottom: -0.105em;
438   margin-right: $-xs;
439 }
440