Skip to content

Commit 4c18d66

Browse files
committed
Color fade effect for function & event pages
1 parent 819632b commit 4c18d66

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

web/src/pages/reference/[event].astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ const needsChecking =
8282
tableOfContents: false,
8383
}}
8484
>
85+
<div class={`fading-bg fade-${eventType}`}></div>
86+
8587
{
8688
needsChecking && (
8789
<div class="notes-section">

web/src/pages/reference/[func].astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ const oopList = Array.isArray(funcInfo.oop) ? funcInfo.oop : funcInfo.oop ? [fun
9797
tableOfContents: false,
9898
}}
9999
>
100+
<div class={`fading-bg fade-${funcType}`}></div>
101+
100102
{needsChecking && (
101103
<div class="notes-section">
102104
<NoteBox type="needs_checking">

web/src/styles/custom.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,44 @@
1717
/* Override Starlight styling */
1818
--sl-content-width: 70rem;
1919
}
20+
2021
.small-text {
2122
font-size: 0.7em;
2223
}
2324

25+
.fading-bg {
26+
position: absolute;
27+
inset: 0;
28+
z-index: -1;
29+
pointer-events: none;
30+
background: linear-gradient(to bottom, var(--fade-color), transparent 50%);
31+
opacity: 0.25;
32+
}
33+
34+
:root[data-theme='dark'] .fade-shared {
35+
--fade-color: var(--color-type-shared-background-high-light);
36+
}
37+
38+
:root[data-theme='dark'] .fade-client {
39+
--fade-color: var(--color-type-client-background-high-light);
40+
}
41+
42+
:root[data-theme='dark'] .fade-server {
43+
--fade-color: var(--color-type-server-background-high-light);
44+
}
45+
46+
:root[data-theme='light'] .fade-shared {
47+
--fade-color: var(--color-type-shared-background-high-dark);
48+
}
49+
50+
:root[data-theme='light'] .fade-client {
51+
--fade-color: var(--color-type-client-background-high-dark);
52+
}
53+
54+
:root[data-theme='light'] .fade-server {
55+
--fade-color: var(--color-type-server-background-high-dark);
56+
}
57+
2458
.function-syntax,
2559
.function-oop,
2660
.notes-section,

0 commit comments

Comments
 (0)