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