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