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