]> BookStack Code Mirror - bookstack/blob - resources/sass/_text.scss
e629724978b6933afbeba7a37d6a6c3f0523ff8f
[bookstack] / resources / 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   @include lightDark(color, #222, #BBB);
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: var(--color-primary);
94   fill: currentColor;
95   cursor: pointer;
96   text-decoration: none;
97   transition: filter ease-in-out 80ms;
98   line-height: 1.6;
99   @include whenDark {
100     filter: brightness(1.3) saturate(0.7);
101   }
102   &:hover {
103     text-decoration: underline;
104   }
105   &.icon {
106     display: inline-block;
107   }
108   svg {
109     position: relative;
110     display: inline-block;
111   }
112   &:focus img:only-child {
113     outline: 2px dashed var(--color-primary);
114     outline-offset: 2px;
115   }
116 }
117
118 .blended-links a {
119   color: inherit;
120   svg {
121     fill: currentColor;
122   }
123 }
124
125 /*
126  * Other HTML Text Elements
127  */
128 p, ul, ol, pre, table, blockquote {
129   margin-top: 0.3em;
130   margin-bottom: 1.375em;
131 }
132
133 hr {
134   border: 0;
135   height: 1px;
136   @include lightDark(background, #eaeaea, #222);
137   margin-bottom: $-l;
138   &.faded {
139     background-image: linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF);
140   }
141   &.margin-top, &.even {
142     margin-top: $-l;
143   }
144 }
145
146 strong, b, .bold, .strong {
147   font-weight: bold;
148   > strong, > b, > .bold, > .strong {
149     font-weight: bolder;
150   }
151 }
152
153 em, i, .italic {
154   font-style: italic;
155 }
156
157 small, p.small, span.small, .text-small {
158   font-size: 0.75rem;
159   @include lightDark(color, #5e5e5e, #999);
160 }
161
162 sup, .superscript {
163   vertical-align: super;
164   font-size: 0.8em;
165 }
166
167 sub, .subscript {
168   vertical-align: sub;
169   font-size: 0.8em;
170 }
171
172 pre {
173   font-size: 12px;
174   border: 1px solid #DDD;
175   @include lightDark(background-color, #f5f5f5, #2B2B2B);
176   @include lightDark(border-color, #DDD, #111);
177   padding-left: 31px;
178   position: relative;
179   padding-top: 3px;
180   padding-bottom: 3px;
181   &:after {
182     content: '';
183     display: block;
184     position: absolute;
185     top: 0;
186     width: 29px;
187     left: 0;
188     height: 100%;
189     @include lightDark(background-color, #f5f5f5, #313335);
190     @include lightDark(border-right, 1px solid #DDD, none);
191   }
192 }
193
194 @media print {
195   pre {
196     padding-left: 12px;
197   }
198   pre:after {
199     display: none;
200   }
201 }
202
203 blockquote {
204   display: block;
205   position: relative;
206   border-left: 4px solid var(--color-primary);
207   background-color: #F8F8F8;
208   padding: $-s $-m $-s $-xl;
209   &:before {
210     content: "\201C";
211     font-size: 2em;
212     font-weight: bold;
213     position: absolute;
214     top: $-s;
215     left: $-s;
216     color: lighten($text-dark, 20%);
217   }
218 }
219
220 .text-mono {
221   font-family: $mono;
222 }
223
224 .text-uppercase {
225   text-transform: uppercase;
226 }
227
228 .text-capitals {
229   text-transform: capitalize;
230 }
231
232 .code-base {
233   font-size: 0.84em;
234   border: 1px solid #DDD;
235   border-radius: 3px;
236   @include lightDark(background-color, #f8f8f8f, #2b2b2b);
237   @include lightDark(border-color, #DDD, #444);
238 }
239
240 code {
241   @extend .code-base;
242   display: inline;
243   padding: 1px 3px;
244   white-space:pre-wrap;
245   line-height: 1.2em;
246 }
247
248 span.code {
249   @extend .code-base;
250   padding: 1px $-xs;
251 }
252
253 pre code {
254   background-color: transparent;
255   border: 0;
256   font-size: 1em;
257   display: block;
258   line-height: 1.6;
259 }
260
261 span.highlight {
262   font-weight: bold;
263   padding: 2px 4px;
264 }
265
266 /*
267  * Lists
268  */
269 ul, ol {
270   p {
271     margin: 0;
272   }
273 }
274 ul {
275   padding-left: $-m * 1.3;
276   padding-right: $-m * 1.3;
277   list-style: disc;
278   ul {
279     list-style: circle;
280     margin-top: 0;
281     margin-bottom: 0;
282   }
283   label {
284     margin: 0;
285   }
286 }
287
288 ol {
289   list-style: decimal;
290   padding-left: $-m * 2;
291   padding-right: $-m * 2;
292 }
293
294 li.checkbox-item, li.task-list-item {
295   list-style: none;
296   margin-left: - ($-m * 1.3);
297   input[type="checkbox"] {
298     margin-right: $-xs;
299   }
300 }
301
302 li > ol, li > ul {
303   margin-block-end: 0px;
304   margin-block-start: 0px;
305   padding-block-end: 0px;
306   padding-block-start: 0px;
307 }
308
309 /*
310  * Generic text styling classes
311  */
312 .underlined {
313   text-decoration: underline;
314 }
315
316 .text-center {
317   text-align: center;
318 }
319 .text-left {
320   text-align: start;
321 }
322 .text-right {
323   text-align: end;
324 }
325
326 @each $sizeLetter, $size in $screen-sizes {
327   @include larger-than($size) {
328     .text-#{$sizeLetter}-center {
329       text-align: center;
330     }
331     .text-#{$sizeLetter}-left {
332       text-align: start;
333     }
334     .text-#{$sizeLetter}-right {
335       text-align: end;
336     }
337   }
338 }
339
340 .text-bigger {
341   font-size: 1.1em;
342 }
343
344 .text-large {
345   font-size: 1.6666em;
346 }
347
348 .no-color {
349   color: inherit;
350 }
351
352 .break-text {
353   word-wrap: break-word;
354   overflow-wrap: break-word;
355 }
356
357 .limit-text {
358   white-space: nowrap;
359   overflow: hidden;
360   text-overflow: ellipsis;
361 }
362
363 /**
364  * Grouping
365  */
366 .header-group {
367   margin: $-m 0;
368   h1, h2, h3, h4, h5, h6 {
369     margin: 0;
370   }
371 }
372
373 span.sep {
374   color: #BBB;
375   padding: 0 $-xs;
376 }
377
378 .list > * {
379   display: block;
380 }
381
382 /**
383   * Icons
384   */
385 .svg-icon {
386   width: 1em;
387   height: 1em;
388   display: inline-block;
389   position: relative;
390   bottom: -0.105em;
391   margin-inline-end: $-xs;
392   pointer-events: none;
393   fill: currentColor;
394 }