mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
3 days ago 280f71a57ab3b801e672158b607acc301bc22377
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
pre, .pre  {
  overflow-x: auto;
  overflow-y: hidden;
}
 
pre code {
  display: block;
  padding: 1.5em 1.5em;
  white-space: pre;
  line-height: 2;
}
 
pre {
  background-color: #222;
  color: #ddd;
  white-space: pre;
  hyphens: none;
  position: relative;
}
 
p code {
  font-size: 0.9em;
}
 
/* ------------------------------------------------------------------ *
 * Code block copy button (see layouts/_markup/render-codeblock.html)  *
 * Progressive enhancement: the button is hidden until site-scripts.html
 * reveals it, so no inert button appears when JavaScript is disabled.  *
 * ------------------------------------------------------------------ */
 
.code-block {
  position: relative;
}
 
.code-block .code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #ddd;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
 
/* Reveal on hover and when focused for keyboard users. */
.code-block:hover .code-copy,
.code-block .code-copy:focus-visible {
  opacity: 1;
}
 
.code-block .code-copy:hover {
  background-color: rgba(255, 255, 255, 0.22);
}
 
.code-block .code-copy.is-copied {
  color: #fff;
  background-color: #19a974;
  border-color: #19a974;
}
 
/* Touch devices have no hover; keep the button visible but subtle. */
@media (hover: none) {
  .code-block .code-copy {
    opacity: 0.7;
  }
}
 
@media (prefers-reduced-motion: reduce) {
  .code-block .code-copy {
    transition: none;
  }
}