aboutsummaryrefslogtreecommitdiff
path: root/htmx/static/pico-1.5.11/scss/content/_code.scss
blob: e03b19198c7ba82581d443dac26b46639f02d6af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
 * Code
 */

// Reboot based on :
// - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
// - sanitize.css v13.0.0 | CC0 1.0 Universal | github.com/csstools/sanitize.css
// ––––––––––––––––––––

// 1. Correct the inheritance and scaling of font size in all browsers
// 2. Correct the odd `em` font sizing in all browsers
pre,
code,
kbd,
samp {
  font-size: 0.875em; // 2
  font-family: var(--font-family); // 1
}

// Prevent overflow of the container in all browsers (opinionated)
pre {
  -ms-overflow-style: scrollbar;
  overflow: auto;
}

// Pico
// ––––––––––––––––––––

pre,
code,
kbd {
  border-radius: var(--border-radius);
  background: var(--code-background-color);
  color: var(--code-color);
  font-weight: var(--font-weight);
  line-height: initial;
}

code,
kbd {
  display: inline-block;
  padding: 0.375rem 0.5rem;
}

pre {
  display: block;
  margin-bottom: var(--spacing);
  overflow-x: auto;

  > code {
    display: block;
    padding: var(--spacing);
    background: none;
    font-size: 14px;
    line-height: var(--line-height);
  }
}

// Code Syntax
code {
  // Tags
  b {
    color: var(--code-tag-color);
    font-weight: var(--font-weight);
  }

  // Properties
  i {
    color: var(--code-property-color);
    font-style: normal;
  }

  // Values
  u {
    color: var(--code-value-color);
    text-decoration: none;
  }

  // Comments
  em {
    color: var(--code-comment-color);
    font-style: normal;
  }
}

// kbd
kbd {
  background-color: var(--code-kbd-background-color);
  color: var(--code-kbd-color);
  vertical-align: baseline;
}