]> BookStack Code Mirror - bookstack/blob - resources/sass/_text.scss
Fix build:js:watch not building at first launch in Docker
[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   &: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   @include lightDark(background, #eaeaea, #555);
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   @include lightDark(color, #5e5e5e, #999);
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   border: 1px solid #DDD;
172   @include lightDark(background-color, #f5f5f5, #2B2B2B);
173   @include lightDark(border-color, #DDD, #111);
174   padding-left: 31px;
175   position: relative;
176   padding-top: 3px;
177   padding-bottom: 3px;
178   &:after {
179     content: '';
180     display: block;
181     position: absolute;
182     top: 0;
183     width: 29px;
184     left: 0;
185     height: 100%;
186     @include lightDark(background-color, #f5f5f5, #313335);
187     @include lightDark(border-right, 1px solid #DDD, none);
188   }
189 }
190
191 @media print {
192   pre {
193     padding-left: 12px;
194   }
195   pre:after {
196     display: none;
197   }
198 }
199
200 blockquote {
201   display: block;
202   position: relative;
203   border-left: 4px solid var(--color-primary);
204   @include lightDark(background-color, #f8f8f8, #333);
205   padding: $-s $-m $-s $-xl;
206   overflow: auto;
207   &:before {
208     content: "\201C";
209     font-size: 2em;
210     font-weight: bold;
211     position: absolute;
212     top: $-s;
213     left: $-s;
214     color: lighten($text-dark, 20%);
215   }
216 }
217
218 .text-mono {
219   font-family: $mono;
220 }
221
222 .text-uppercase {
223   text-transform: uppercase;
224 }
225
226 .text-capitals {
227   text-transform: capitalize;
228 }
229
230 .code-base {
231   font-size: 0.84em;
232   border: 1px solid #DDD;
233   border-radius: 3px;
234   @include lightDark(background-color, #f8f8f8, #2b2b2b);
235   @include lightDark(border-color, #DDD, #444);
236 }
237
238 code {
239   @extend .code-base;
240   display: inline;
241   padding: 1px 3px;
242   white-space:pre-wrap;
243   line-height: 1.2em;
244 }
245
246 span.code {
247   @extend .code-base;
248   padding: 1px $-xs;
249 }
250
251 pre code {
252   background-color: transparent;
253   border: 0;
254   font-size: 1em;
255   display: block;
256   line-height: 1.6;
257 }
258
259 span.highlight {
260   font-weight: bold;
261   padding: 2px 4px;
262 }
263
264 /*
265  * Lists
266  */
267 ul, ol {
268   p {
269     margin: 0;
270   }
271 }
272 ul {
273   padding-left: $-m * 1.3;
274   padding-right: $-m * 1.3;
275   list-style: disc;
276   ul {
277     list-style: circle;
278     margin-top: 0;
279     margin-bottom: 0;
280   }
281   label {
282     margin: 0;
283   }
284 }
285
286 ol {
287   list-style: decimal;
288   padding-left: $-m * 2;
289   padding-right: $-m * 2;
290 }
291
292 li.checkbox-item, li.task-list-item {
293   list-style: none;
294   margin-left: - ($-m * 1.3);
295   input[type="checkbox"] {
296     margin-right: $-xs;
297   }
298 }
299
300 li > ol, li > ul {
301   margin-block-end: 0px;
302   margin-block-start: 0px;
303   padding-block-end: 0px;
304   padding-block-start: 0px;
305 }
306
307 /*
308  * Generic text styling classes
309  */
310 .underlined {
311   text-decoration: underline;
312 }
313
314 .text-center {
315   text-align: center;
316 }
317 .text-left {
318   text-align: start;
319 }
320 .text-right {
321   text-align: end;
322 }
323
324 @each $sizeLetter, $size in $screen-sizes {
325   @include larger-than($size) {
326     .text-#{$sizeLetter}-center {
327       text-align: center;
328     }
329     .text-#{$sizeLetter}-left {
330       text-align: start;
331     }
332     .text-#{$sizeLetter}-right {
333       text-align: end;
334     }
335   }
336 }
337
338 .text-bigger {
339   font-size: 1.1em;
340 }
341
342 .text-large {
343   font-size: 1.6666em;
344 }
345
346 .no-color {
347   color: inherit;
348 }
349
350 .break-text {
351   word-wrap: break-word;
352   overflow-wrap: break-word;
353 }
354
355 .limit-text {
356   white-space: nowrap;
357   overflow: hidden;
358   text-overflow: ellipsis;
359 }
360
361 /**
362  * Grouping
363  */
364 .header-group {
365   margin: $-m 0;
366   h1, h2, h3, h4, h5, h6 {
367     margin: 0;
368   }
369 }
370
371 span.sep {
372   color: #BBB;
373   padding: 0 $-xs;
374 }
375
376 .list > * {
377   display: block;
378 }
379
380 /**
381   * Icons
382   */
383 .svg-icon {
384   width: 1em;
385   height: 1em;
386   display: inline-block;
387   position: relative;
388   bottom: -0.105em;
389   margin-inline-end: $-xs;
390   pointer-events: none;
391   fill: currentColor;
392 }