UNPKG

1.67 kBSCSSView Raw
1/**
2 * Code
3 */
4
5// Reboot based on :
6// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
7// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
8// ––––––––––––––––––––
9
10// 1. Correct the inheritance and scaling of font size in all browsers
11// 2. Correct the odd `em` font sizing in all browsers
12pre,
13code,
14kbd,
15samp {
16 font-size: 0.875em; // 2
17 font-family: var(--font-family); // 1
18}
19
20// Prevent overflow of the container in all browsers (opinionated)
21pre {
22 -ms-overflow-style: scrollbar;
23 overflow: auto;
24}
25
26// Pico
27// ––––––––––––––––––––
28
29pre,
30code,
31kbd {
32 border-radius: var(--border-radius);
33 background: var(--code-background-color);
34 color: var(--code-color);
35 font-weight: var(--font-weight);
36 line-height: initial;
37}
38
39code,
40kbd {
41 display: inline-block;
42 padding: 0.375rem 0.5rem;
43}
44
45pre {
46 display: block;
47 margin-bottom: var(--spacing);
48 overflow-x: auto;
49
50 > code {
51 display: block;
52 padding: var(--spacing);
53 background: none;
54 font-size: 14px;
55 line-height: var(--line-height);
56 }
57}
58
59// Code Syntax
60code {
61 // Tags
62 b {
63 color: var(--code-tag-color);
64 font-weight: var(--font-weight);
65 }
66
67 // Properties
68 i {
69 color: var(--code-property-color);
70 font-style: normal;
71 }
72
73 // Values
74 u {
75 color: var(--code-value-color);
76 text-decoration: none;
77 }
78
79 // Comments
80 em {
81 color: var(--code-comment-color);
82 font-style: normal;
83 }
84}
85
86// kbd
87kbd {
88 background-color: var(--code-kbd-background-color);
89 color: var(--code-kbd-color);
90 vertical-align: baseline;
91}