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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
/* ==========================================================================
scroll-to-top.css — floating "back to top" control
Loaded by assets/js/scroll-to-top.js on www and sibling *.sillylaird.ca hosts.
Self-contained so sibling pages that do not load site.css still look right.
Selectors are more specific than site.css's `a:hover` so the global link
glow / scale does not leak onto the control.
========================================================================== */
a.scroll-to-top {
--stt-bg: var(--bg, #000000);
--stt-ink: var(--gold, #8b0000);
--stt-border: var(--border, #3a0000);
--stt-hover: var(--accent-cyan, #8b0000);
position: fixed;
right: max(0.85rem, env(safe-area-inset-right, 0px));
bottom: max(1.1rem, env(safe-area-inset-bottom, 0px));
z-index: 10050;
box-sizing: border-box;
width: 2.75rem;
height: 2.75rem;
margin: 0;
padding: 0.2rem 0 0.15rem;
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.05rem;
border: 1px solid var(--stt-border);
border-radius: 6px;
background: var(--stt-bg);
color: var(--stt-ink);
font-family: "JetBrains Mono", "IBM Plex Mono", "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.58rem;
font-weight: 700;
letter-spacing: 0.14em;
line-height: 1;
text-decoration: none;
text-transform: uppercase;
text-shadow: none;
box-shadow:
0 0 0 1px rgba(160, 0, 0, .18),
0 0 14px -2px rgba(160, 0, 0, .4),
inset 0 0 10px rgba(160, 0, 0, .12);
opacity: 0;
visibility: hidden;
pointer-events: none;
transform: translateY(10px);
transition:
opacity .2s ease,
visibility .2s ease,
transform .2s ease,
color .15s ease,
border-color .15s ease,
box-shadow .25s ease,
background-color .15s ease;
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
}
a.scroll-to-top.is-visible {
opacity: 1;
visibility: visible;
pointer-events: auto;
transform: none;
}
a.scroll-to-top .scroll-to-top-caret {
font-size: 0.85rem;
letter-spacing: 0;
line-height: 1;
transform: translateY(1px);
}
a.scroll-to-top .scroll-to-top-label {
font-size: 0.52rem;
letter-spacing: 0.16em;
}
a.scroll-to-top:hover,
a.scroll-to-top:focus-visible {
background: var(--stt-bg);
color: var(--stt-hover);
text-decoration: none;
text-shadow:
0 0 6px rgba(255, 0, 0, .85),
0 0 14px rgba(139, 0, 0, .45);
border-color: rgba(255, 0, 0, .75);
border-radius: 6px;
transform: none;
box-shadow:
0 0 0 1px rgba(255, 0, 0, .45),
0 0 16px rgba(139, 0, 0, .4),
0 0 32px -6px rgba(139, 0, 0, .35),
inset 0 0 10px rgba(139, 0, 0, .08);
}
a.scroll-to-top:focus-visible {
outline: 2px solid var(--stt-hover);
outline-offset: 2px;
}
a.scroll-to-top:active {
transform: translateY(1px);
}
/* Light theme — www uses body.light-mode; blog uses data-blog-theme */
body.light-mode a.scroll-to-top,
html[data-blog-theme="light"] a.scroll-to-top {
--stt-bg: #fff8f1;
--stt-ink: #8b0000;
--stt-border: #e8c8c8;
--stt-hover: #5a0000;
box-shadow:
0 1px 0 rgba(255, 255, 255, .95) inset,
0 8px 22px rgba(139, 0, 0, .16);
}
body.light-mode a.scroll-to-top:hover,
body.light-mode a.scroll-to-top:focus-visible,
html[data-blog-theme="light"] a.scroll-to-top:hover,
html[data-blog-theme="light"] a.scroll-to-top:focus-visible {
background: #ffffff;
color: #5a0000;
text-shadow: none;
border-color: #8b0000;
box-shadow:
0 0 0 1px rgba(139, 0, 0, .35),
0 8px 22px rgba(139, 0, 0, .22);
}
/* When the visit-counter has no footer to live in, it docks bottom-right.
Lift it so the two chips do not sit on top of each other. */
body.has-scroll-to-top #site-visit-counter[data-stt-docked="1"] {
bottom: 4.65rem;
}
@media (max-width: 520px) {
a.scroll-to-top {
width: 2.55rem;
height: 2.55rem;
right: max(0.65rem, env(safe-area-inset-right, 0px));
bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
}
}
@media (prefers-reduced-motion: reduce) {
a.scroll-to-top,
a.scroll-to-top.is-visible,
a.scroll-to-top:hover,
a.scroll-to-top:focus-visible,
a.scroll-to-top:active {
transition: none;
transform: none;
}
}
@media print {
a.scroll-to-top,
.footer-back-to-top {
display: none !important;
}
}
|