UNPKG

16.9 kBSCSSView Raw
1// Name: Base
2// Description: Default values for HTML elements
3//
4// Component: `uk-link`
5// `uk-h1`, `uk-h2`, `uk-h3`, `uk-h4`, `uk-h5`, `uk-h6`
6// `uk-hr`
7//
8// ========================================================================
9
10
11// Variables
12// ========================================================================
13
14$base-body-background: $global-background !default;
15$base-body-font-family: $global-font-family !default;
16$base-body-font-weight: normal !default;
17$base-body-font-size: $global-font-size !default;
18$base-body-line-height: $global-line-height !default;
19$base-body-color: $global-color !default;
20
21$base-link-color: $global-link-color !default;
22$base-link-text-decoration: none !default;
23$base-link-hover-color: $global-link-hover-color !default;
24$base-link-hover-text-decoration: underline !default;
25
26$base-strong-font-weight: bolder !default;
27$base-code-font-size: $global-small-font-size !default;
28$base-code-font-family: Consolas, monaco, monospace !default;
29$base-code-color: $global-danger-background !default;
30$base-em-color: $global-danger-background !default;
31$base-ins-background: #ffd !default;
32$base-ins-color: $global-color !default;
33$base-mark-background: #ffd !default;
34$base-mark-color: $global-color !default;
35$base-quote-font-style: italic !default;
36$base-small-font-size: 80% !default;
37
38$base-margin-vertical: $global-margin !default;
39
40$base-heading-font-family: $global-font-family !default;
41$base-heading-font-weight: normal !default;
42$base-heading-color: $global-emphasis-color !default;
43$base-heading-text-transform: none !default;
44$base-heading-margin-top: $global-medium-margin !default;
45$base-h1-font-size-m: $global-xxlarge-font-size !default;
46$base-h1-font-size: $base-h1-font-size-m * 0.85 !default;
47$base-h1-line-height: 1.2 !default;
48$base-h2-font-size-m: $global-xlarge-font-size !default;
49$base-h2-font-size: $base-h2-font-size-m * 0.85 !default;
50$base-h2-line-height: 1.3 !default;
51$base-h3-font-size: $global-large-font-size !default;
52$base-h3-line-height: 1.4 !default;
53$base-h4-font-size: $global-medium-font-size !default;
54$base-h4-line-height: 1.4 !default;
55$base-h5-font-size: $global-font-size !default;
56$base-h5-line-height: 1.4 !default;
57$base-h6-font-size: $global-small-font-size !default;
58$base-h6-line-height: 1.4 !default;
59
60$base-list-padding-left: 30px !default;
61
62$base-hr-margin-vertical: $global-margin !default;
63$base-hr-border-width: $global-border-width !default;
64$base-hr-border: $global-border !default;
65
66$base-blockquote-font-size: $global-medium-font-size !default;
67$base-blockquote-line-height: 1.5 !default;
68$base-blockquote-font-style: italic !default;
69$base-blockquote-margin-vertical: $global-margin !default;
70$base-blockquote-footer-margin-top: $global-small-margin !default;
71$base-blockquote-footer-font-size: $global-small-font-size !default;
72$base-blockquote-footer-line-height: 1.5 !default;
73
74$base-pre-font-size: $global-small-font-size !default;
75$base-pre-line-height: 1.5 !default;
76$base-pre-font-family: $base-code-font-family !default;
77$base-pre-color: $global-color !default;
78
79$base-selection-background: #39f !default;
80$base-selection-color: $global-inverse-color !default;
81
82
83/* ========================================================================
84 Component: Base
85 ========================================================================== */
86
87/*
88 * 1. Set `font-size` to support `rem` units
89 * Not using `font` property because a leading hyphen (e.g. -apple-system) causes the font to break in IE11 and Edge
90 * 2. Prevent adjustments of font size after orientation changes in iOS.
91 * 3. Style
92 */
93
94html {
95 /* 1 */
96 font-family: $base-body-font-family;
97 font-size: $base-body-font-size;
98 font-weight: $base-body-font-weight;
99 line-height: $base-body-line-height;
100 /* 2 */
101 -webkit-text-size-adjust: 100%;
102 /* 3 */
103 background: $base-body-background;
104 color: $base-body-color;
105 @if(mixin-exists(hook-base-body)) {@include hook-base-body();}
106}
107
108/*
109 * Remove the margin in all browsers.
110 */
111
112body { margin: 0; }
113
114
115/* Links
116 ========================================================================== */
117
118/*
119 * Remove the outline on focused links when they are also active or hovered
120 */
121
122a:active,
123a:hover { outline: none; }
124
125/*
126 * Style
127 */
128
129a,
130.uk-link {
131 color: $base-link-color;
132 text-decoration: $base-link-text-decoration;
133 cursor: pointer;
134 @if(mixin-exists(hook-base-link)) {@include hook-base-link();}
135}
136
137a:hover,
138.uk-link:hover,
139.uk-link-toggle:hover .uk-link,
140.uk-link-toggle:focus .uk-link {
141 color: $base-link-hover-color;
142 text-decoration: $base-link-hover-text-decoration;
143 @if(mixin-exists(hook-base-link-hover)) {@include hook-base-link-hover();}
144}
145
146
147/* Text-level semantics
148 ========================================================================== */
149
150/*
151 * 1. Add the correct text decoration in Edge.
152 * 2. The shorthand declaration `underline dotted` is not supported in Safari.
153 */
154
155abbr[title] {
156 /* 1 */
157 text-decoration: underline dotted;
158 /* 2 */
159 -webkit-text-decoration-style: dotted;
160}
161
162/*
163 * Add the correct font weight in Chrome, Edge, and Safari.
164 */
165
166b,
167strong { font-weight: $base-strong-font-weight; }
168
169/*
170 * 1. Consolas has a better baseline in running text compared to `Courier`
171 * 2. Correct the odd `em` font sizing in all browsers.
172 * 3. Style
173 */
174
175:not(pre) > code,
176:not(pre) > kbd,
177:not(pre) > samp {
178 /* 1 */
179 font-family: $base-code-font-family;
180 /* 2 */
181 font-size: $base-code-font-size;
182 /* 3 */
183 color: $base-code-color;
184 white-space: nowrap;
185 @if(mixin-exists(hook-base-code)) {@include hook-base-code();}
186}
187
188/*
189 * Emphasize
190 */
191
192em { color: $base-em-color; }
193
194/*
195 * Insert
196 */
197
198ins {
199 background: $base-ins-background;
200 color: $base-ins-color;
201 text-decoration: none;
202}
203
204/*
205 * Mark
206 */
207
208mark {
209 background: $base-mark-background;
210 color: $base-mark-color;
211}
212
213/*
214 * Quote
215 */
216
217q { font-style: $base-quote-font-style; }
218
219/*
220 * Add the correct font size in all browsers.
221 */
222
223small { font-size: $base-small-font-size; }
224
225/*
226 * Prevents `sub` and `sup` affecting `line-height` in all browsers.
227 */
228
229sub,
230sup {
231 font-size: 75%;
232 line-height: 0;
233 position: relative;
234 vertical-align: baseline;
235}
236
237sup { top: -0.5em; }
238sub { bottom: -0.25em; }
239
240
241/* Embedded content
242 ========================================================================== */
243
244/*
245 * Remove the gap between embedded content and the bottom of their containers.
246 */
247
248audio,
249canvas,
250iframe,
251img,
252svg,
253video { vertical-align: middle; }
254
255/*
256 * 1. Add responsiveness.
257 * 2. Auto-scale the height. Only needed if `height` attribute is present.
258 * 3. Corrects responsive `max-width` behavior if padding and border are used.
259 * 4. Exclude SVGs for IE11 because they don't preserve their aspect ratio.
260 */
261
262canvas,
263img,
264video {
265 /* 1 */
266 max-width: 100%;
267 /* 2 */
268 height: auto;
269 /* 3 */
270 box-sizing: border-box;
271}
272
273/* 4 */
274@supports (display: block) {
275
276 svg {
277 max-width: 100%;
278 height: auto;
279 box-sizing: border-box;
280 }
281
282}
283
284/*
285 * Hide the overflow in IE.
286 */
287
288svg:not(:root) { overflow: hidden; }
289
290/*
291 * 1. Fix lazy loading images if parent element is set to `display: inline` and has `overflow: hidden`.
292 * 2. Hide `alt` text for lazy loading images.
293 * Note: Selector for background while loading img[data-src*='.jpg'][src*='data:image'] { background: grey; }
294 */
295
296img:not([src]) {
297 /* 1 */
298 min-width: 1px;
299 /* 2 */
300 visibility: hidden;
301}
302
303/*
304 * Iframe
305 * Remove border in all browsers
306 */
307
308iframe { border: 0; }
309
310
311/* Block elements
312 ========================================================================== */
313
314/*
315 * Margins
316 */
317
318p,
319ul,
320ol,
321dl,
322pre,
323address,
324fieldset,
325figure { margin: 0 0 $base-margin-vertical 0; }
326
327/* Add margin if adjacent element */
328* + p,
329* + ul,
330* + ol,
331* + dl,
332* + pre,
333* + address,
334* + fieldset,
335* + figure { margin-top: $base-margin-vertical; }
336
337
338/* Headings
339 ========================================================================== */
340
341h1, .uk-h1,
342h2, .uk-h2,
343h3, .uk-h3,
344h4, .uk-h4,
345h5, .uk-h5,
346h6, .uk-h6,
347.uk-heading-small,
348.uk-heading-medium,
349.uk-heading-large,
350.uk-heading-xlarge,
351.uk-heading-2xlarge {
352 margin: 0 0 $base-margin-vertical 0;
353 font-family: $base-heading-font-family;
354 font-weight: $base-heading-font-weight;
355 color: $base-heading-color;
356 text-transform: $base-heading-text-transform;
357 @if(mixin-exists(hook-base-heading)) {@include hook-base-heading();}
358}
359
360/* Add margin if adjacent element */
361* + h1, * + .uk-h1,
362* + h2, * + .uk-h2,
363* + h3, * + .uk-h3,
364* + h4, * + .uk-h4,
365* + h5, * + .uk-h5,
366* + h6, * + .uk-h6,
367* + .uk-heading-small,
368* + .uk-heading-medium,
369* + .uk-heading-large,
370* + .uk-heading-xlarge,
371* + .uk-heading-2xlarge { margin-top: $base-heading-margin-top; }
372
373/*
374 * Sizes
375 */
376
377h1, .uk-h1 {
378 font-size: $base-h1-font-size;
379 line-height: $base-h1-line-height;
380 @if(mixin-exists(hook-base-h1)) {@include hook-base-h1();}
381}
382
383h2, .uk-h2 {
384 font-size: $base-h2-font-size;
385 line-height: $base-h2-line-height;
386 @if(mixin-exists(hook-base-h2)) {@include hook-base-h2();}
387}
388
389h3, .uk-h3 {
390 font-size: $base-h3-font-size;
391 line-height: $base-h3-line-height;
392 @if(mixin-exists(hook-base-h3)) {@include hook-base-h3();}
393}
394
395h4, .uk-h4 {
396 font-size: $base-h4-font-size;
397 line-height: $base-h4-line-height;
398 @if(mixin-exists(hook-base-h4)) {@include hook-base-h4();}
399}
400
401h5, .uk-h5 {
402 font-size: $base-h5-font-size;
403 line-height: $base-h5-line-height;
404 @if(mixin-exists(hook-base-h5)) {@include hook-base-h5();}
405}
406
407h6, .uk-h6 {
408 font-size: $base-h6-font-size;
409 line-height: $base-h6-line-height;
410 @if(mixin-exists(hook-base-h6)) {@include hook-base-h6();}
411}
412
413/* Tablet landscape and bigger */
414@media (min-width: $breakpoint-medium) {
415
416 h1, .uk-h1 { font-size: $base-h1-font-size-m; }
417 h2, .uk-h2 { font-size: $base-h2-font-size-m; }
418
419}
420
421
422/* Lists
423 ========================================================================== */
424
425ul,
426ol { padding-left: $base-list-padding-left; }
427
428/*
429 * Reset margin for nested lists
430 */
431
432ul > li > ul,
433ul > li > ol,
434ol > li > ol,
435ol > li > ul { margin: 0; }
436
437
438/* Description lists
439 ========================================================================== */
440
441dt { font-weight: bold; }
442dd { margin-left: 0; }
443
444
445/* Horizontal rules
446 ========================================================================== */
447
448/*
449 * 1. Show the overflow in Chrome, Edge and IE.
450 * 2. Add the correct text-align in Edge and IE.
451 * 3. Style
452 */
453
454hr, .uk-hr {
455 /* 1 */
456 overflow: visible;
457 /* 2 */
458 text-align: inherit;
459 /* 3 */
460 margin: 0 0 $base-hr-margin-vertical 0;
461 border: 0;
462 border-top: $base-hr-border-width solid $base-hr-border;
463 @if(mixin-exists(hook-base-hr)) {@include hook-base-hr();}
464}
465
466/* Add margin if adjacent element */
467* + hr,
468* + .uk-hr { margin-top: $base-hr-margin-vertical }
469
470
471/* Address
472 ========================================================================== */
473
474address { font-style: normal; }
475
476
477/* Blockquotes
478 ========================================================================== */
479
480blockquote {
481 margin: 0 0 $base-blockquote-margin-vertical 0;
482 font-size: $base-blockquote-font-size;
483 line-height: $base-blockquote-line-height;
484 font-style: $base-blockquote-font-style;
485 @if(mixin-exists(hook-base-blockquote)) {@include hook-base-blockquote();}
486}
487
488/* Add margin if adjacent element */
489* + blockquote { margin-top: $base-blockquote-margin-vertical; }
490
491/*
492 * Content
493 */
494
495blockquote p:last-of-type { margin-bottom: 0; }
496
497blockquote footer {
498 margin-top: $base-blockquote-footer-margin-top;
499 font-size: $base-blockquote-footer-font-size;
500 line-height: $base-blockquote-footer-line-height;
501 @if(mixin-exists(hook-base-blockquote-footer)) {@include hook-base-blockquote-footer();}
502}
503
504
505/* Preformatted text
506 ========================================================================== */
507
508/*
509 * 1. Contain overflow in all browsers.
510 */
511
512pre {
513 font: $base-pre-font-size unquote("/") $base-pre-line-height $base-pre-font-family;
514 color: $base-pre-color;
515 -moz-tab-size: 4;
516 tab-size: 4;
517 /* 1 */
518 overflow: auto;
519 @if(mixin-exists(hook-base-pre)) {@include hook-base-pre();}
520}
521
522pre code { font-family: $base-pre-font-family; }
523
524
525/* Selection pseudo-element
526 ========================================================================== */
527
528::selection {
529 background: $base-selection-background;
530 color: $base-selection-color;
531 text-shadow: none;
532}
533
534
535/* HTML5 elements
536 ========================================================================== */
537
538/*
539 * 1. Add the correct display in Edge, IE 10+, and Firefox.
540 * 2. Add the correct display in IE.
541 */
542
543details, /* 1 */
544main { /* 2 */
545 display: block;
546}
547
548/*
549 * Add the correct display in all browsers.
550 */
551
552summary { display: list-item; }
553
554/*
555 * Add the correct display in IE.
556 */
557
558template { display: none; }
559
560
561/* Pass media breakpoints to JS
562 ========================================================================== */
563
564/*
565 * Breakpoints
566 */
567
568.uk-breakpoint-s::before { content: '#{$breakpoint-small}'; }
569.uk-breakpoint-m::before { content: '#{$breakpoint-medium}'; }
570.uk-breakpoint-l::before { content: '#{$breakpoint-large}'; }
571.uk-breakpoint-xl::before { content: '#{$breakpoint-xlarge}'; }
572
573:root {
574 --uk-breakpoint-s: #{$breakpoint-small};
575 --uk-breakpoint-m: #{$breakpoint-medium};
576 --uk-breakpoint-l: #{$breakpoint-large};
577 --uk-breakpoint-xl: #{$breakpoint-xlarge};
578}
579
580// Hooks
581// ========================================================================
582
583@if(mixin-exists(hook-base-misc)) {@include hook-base-misc();}
584
585// @mixin hook-base-body(){}
586// @mixin hook-base-link(){}
587// @mixin hook-base-link-hover(){}
588// @mixin hook-base-code(){}
589// @mixin hook-base-heading(){}
590// @mixin hook-base-h1(){}
591// @mixin hook-base-h2(){}
592// @mixin hook-base-h3(){}
593// @mixin hook-base-h4(){}
594// @mixin hook-base-h5(){}
595// @mixin hook-base-h6(){}
596// @mixin hook-base-hr(){}
597// @mixin hook-base-blockquote(){}
598// @mixin hook-base-blockquote-footer(){}
599// @mixin hook-base-pre(){}
600// @mixin hook-base-misc(){}
601
602
603// Inverse
604// ========================================================================
605
606$inverse-base-color: $inverse-global-color !default;
607$inverse-base-link-color: $inverse-global-emphasis-color !default;
608$inverse-base-link-hover-color: $inverse-global-emphasis-color !default;
609$inverse-base-code-color: $inverse-global-color !default;
610$inverse-base-em-color: $inverse-global-emphasis-color !default;
611$inverse-base-heading-color: $inverse-global-emphasis-color !default;
612$inverse-base-hr-border: $inverse-global-border !default;
613
614
615
616// @mixin hook-inverse-base-link(){}
617// @mixin hook-inverse-base-link-hover(){}
618// @mixin hook-inverse-base-code(){}
619// @mixin hook-inverse-base-heading(){}
620// @mixin hook-inverse-base-h1(){}
621// @mixin hook-inverse-base-h2(){}
622// @mixin hook-inverse-base-h3(){}
623// @mixin hook-inverse-base-h4(){}
624// @mixin hook-inverse-base-h5(){}
625// @mixin hook-inverse-base-h6(){}
626// @mixin hook-inverse-base-blockquote(){}
627// @mixin hook-inverse-base-blockquote-footer(){}
628// @mixin hook-inverse-base-hr(){}