]> BookStack Code Mirror - bookstack/blob - resources/assets/sass/_text.scss
972eafddd64fb369a0e32bc1d9f77ec6c9f61916
[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: #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   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 .list-heading {
83   font-size: 2rem;
84 }
85
86 h2.list-heading {
87   font-size: 1.333rem;
88 }
89
90 /*
91  * Link styling
92  */
93 a, .link {
94   color: $primary;
95   cursor: pointer;
96   text-decoration: none;
97   transition: color ease-in-out 80ms;
98   line-height: 1.6;
99   &:hover {
100     text-decoration: underline;
101     color: darken($primary, 20%);
102   }
103   &.icon {
104     display: inline-block;
105   }
106   svg {
107     position: relative;
108     display: inline-block;
109   }
110 }
111
112 .blended-links a {
113   color: inherit;
114   svg {
115     fill: currentColor;
116   }
117 }
118
119 /*
120  * Other HTML Text Elements
121  */
122 p, ul, ol, pre, table, blockquote {
123   margin-top: 0.3em;
124   margin-bottom: 1.375em;
125 }
126
127 hr {
128   border: 0;
129   height: 1px;
130   background: #EAEAEA;
131   margin-bottom: $-l;
132   &.faded {
133     background-image: linear-gradient(to right, #FFF, #e3e0e0 20%, #e3e0e0 80%, #FFF);
134   }
135   &.margin-top, &.even {
136     margin-top: $-l;
137   }
138 }
139
140 strong, b, .bold, .strong {
141   font-weight: bold;
142   > strong, > b, > .bold, > .strong {
143     font-weight: bolder;
144   }
145 }
146
147 em, i, .italic {
148   font-style: italic;
149 }
150
151 small, p.small, span.small, .text-small {
152   font-size: 0.85em;
153   color: lighten($text-dark, 10%);
154   small, p.small, span.small, .text-small {
155     font-size: 1em;
156   }
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 $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 .code-base {
217     background-color: #F8F8F8;
218     font-size: 0.80em;
219     border: 1px solid #DDD;
220     border-radius: 3px;
221 }
222
223 code {
224   @extend .code-base;
225   display: inline;
226   padding: 1px 3px;
227   white-space:pre;
228   line-height: 1.2em;
229   margin-bottom: 1.2em;
230 }
231
232 span.code {
233   @extend .code-base;
234   padding: 1px $-xs;
235 }
236
237 pre code {
238   background-color: transparent;
239   border: 0;
240   font-size: 1em;
241   display: block;
242   line-height: 1.6;
243 }
244
245 span.highlight {
246   //background-color: rgba($primary, 0.2);
247   font-weight: bold;
248   padding: 2px 4px;
249 }
250
251 /*
252  * Lists
253  */
254 ul, ol {
255   overflow: hidden;
256   p {
257     margin: 0;
258   }
259 }
260 ul {
261   padding-left: $-m * 1.3;
262   padding-right: $-m * 1.3;
263   list-style: disc;
264   ul {
265     list-style: circle;
266     margin-top: 0;
267     margin-bottom: 0;
268   }
269   label {
270     margin: 0;
271   }
272 }
273
274 ol {
275   list-style: decimal;
276   padding-left: $-m * 2;
277   padding-right: $-m * 2;
278 }
279
280 li.checkbox-item, li.task-list-item {
281   list-style: none;
282   margin-left: - ($-m * 1.3);
283   input[type="checkbox"] {
284     margin-right: $-xs;
285   }
286 }
287
288 /*
289  * Generic text styling classes
290  */
291 .underlined {
292   text-decoration: underline;
293 }
294
295 .text-center {
296   text-align: center;
297 }
298
299 .text-left {
300   text-align: left;
301 }
302
303 .text-right {
304   text-align: right;
305 }
306
307 .text-bigger {
308   font-size: 1.1em;
309 }
310
311 .text-large {
312   font-size: 1.6666em;
313 }
314
315 .no-color {
316   color: inherit;
317 }
318
319 .break-text {
320   word-wrap: break-word;
321   overflow-wrap: break-word;
322 }
323
324 /**
325  * Grouping
326  */
327 .header-group {
328   margin: $-m 0;
329   h1, h2, h3, h4, h5, h6 {
330     margin: 0;
331   }
332 }
333
334 span.sep {
335   color: #BBB;
336   padding: 0 $-xs;
337 }
338
339 .list > * {
340   display: block;
341 }
342
343 /**
344   * Icons
345   */
346 i {
347   padding-right: $-xs;
348 }
349
350 .svg-icon {
351   width: 1em;
352   height: 1em;
353   display: inline-block;
354   position: relative;
355   bottom: -0.105em;
356   margin-right: $-xs;
357 }
358