Skip to content

Commit d372470

Browse files
committed
more fixes maybe
1 parent dead447 commit d372470

13 files changed

Lines changed: 140 additions & 76 deletions

app/routes/ApiRoute.res

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ let default = () => {
195195
<VersionSelect />
196196
</div>
197197
<button
198-
className="flex items-center" onClick={_ => NavbarUtils.closeMobileTertiaryDrawer()}
198+
className="flex items-center text-gray-60 dark:text-gray-30 hover:text-gray-80 dark:hover:text-gray-20"
199+
onClick={_ => NavbarUtils.closeMobileTertiaryDrawer()}
199200
>
200201
<Icon.Close />
201202
</button>

src/ApiDocs.res

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,18 @@ module RightSidebar = {
5252
switch item {
5353
| Value({name, deprecated}) as kind | Type({name, deprecated}) as kind =>
5454
let (icon, textColor, bgColor, href) = switch kind {
55-
| Type(_) => ("t", "text-fire-30", "bg-fire-5", `#type-${name}`)
56-
| Value(_) => ("v", "text-sky-30", "bg-sky-5", `#value-${name}`)
55+
| Type(_) => (
56+
"t",
57+
"text-fire-30 dark:text-fire-dark",
58+
"bg-fire-5 dark:bg-fire-100",
59+
`#type-${name}`,
60+
)
61+
| Value(_) => (
62+
"v",
63+
"text-sky-30 dark:text-water-dark",
64+
"bg-sky-5 dark:bg-sky-90",
65+
`#value-${name}`,
66+
)
5767
}
5868
let deprecatedIcon = switch deprecated->Null.toOption {
5969
| Some(_) =>
@@ -69,7 +79,7 @@ module RightSidebar = {
6979
<li className="my-3" key={href}>
7080
<ReactRouter.Link.String
7181
title
72-
className="flex items-center w-full font-normal text-14 text-gray-40 leading-tight hover:text-gray-80"
82+
className="flex items-center w-full font-normal text-14 text-gray-40 dark:text-gray-30 leading-tight hover:text-gray-80 dark:hover:text-gray-20"
7383
to=href
7484
onClick={_ => onLinkClick->Option.forEach(fn => fn())}
7585
>
@@ -109,8 +119,8 @@ module SidebarTree = {
109119

110120
let isCurrentlyAtRoot = currentPathname == moduleRoute
111121

112-
let summaryClassName = "truncate py-1 md:h-auto tracking-tight text-gray-60 font-medium text-14 rounded-sm hover:bg-gray-20 hover:-ml-2 hover:py-1 hover:pl-2 "
113-
let classNameActive = " bg-fire-5 text-red-500 -ml-2 pl-2 font-medium hover:bg-fire-70"
122+
let summaryClassName = "truncate py-1 md:h-auto tracking-tight text-gray-60 dark:text-gray-30 font-medium text-14 rounded-sm hover:bg-gray-20 dark:hover:bg-gray-90 hover:-ml-2 hover:py-1 hover:pl-2 "
123+
let classNameActive = " bg-fire-5 dark:bg-fire-100 text-red-500 dark:text-fire-dark -ml-2 pl-2 font-medium hover:bg-fire-70 dark:hover:bg-fire-90"
114124

115125
let subMenu = switch items->Array.length > 0 {
116126
| true =>
@@ -179,7 +189,10 @@ module SidebarTree = {
179189

180190
<aside className="px-4 w-full block">
181191
<div className="my-10">
182-
<div className="hl-overline block text-gray-80 mt-5 mb-2" dataTestId="overview">
192+
<div
193+
className="hl-overline block text-gray-80 dark:text-gray-20 mt-5 mb-2"
194+
dataTestId="overview"
195+
>
183196
{"Overview"->React.string}
184197
</div>
185198
<Link.String
@@ -190,7 +203,9 @@ module SidebarTree = {
190203
</Link.String>
191204
{isCurrentlyAtRoot ? subMenu : React.null}
192205
</div>
193-
<div className="hl-overline text-gray-80 mt-5 mb-2"> {"submodules"->React.string} </div>
206+
<div className="hl-overline text-gray-80 dark:text-gray-20 mt-5 mb-2">
207+
{"submodules"->React.string}
208+
</div>
194209
{node.children
195210
->Array.toSorted((v1, v2) => String.compare(v1.name, v2.name))
196211
->Array.filter(child => child.name !== node.name)
@@ -299,11 +314,13 @@ let make = (props: props) => {
299314
// This is the sidebar on the right side of the page for desktops showing types and values
300315
let rightSidebar = switch props {
301316
| Ok({module_: {items}}) if Array.length(items) > 0 =>
302-
<div className="hidden xl:block lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white">
317+
<div
318+
className="hidden xl:block lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white dark:bg-gray-95"
319+
>
303320
<aside
304-
className="relative pl-4 w-full block md:top-28 md:pt-4 md:sticky border-l border-gray-20 overflow-y-auto pb-24 h-[calc(100vh-7rem)]"
321+
className="relative pl-4 w-full block md:top-28 md:pt-4 md:sticky border-l border-gray-20 dark:border-gray-80 overflow-y-auto pb-24 h-[calc(100vh-7rem)]"
305322
>
306-
<div className="hl-overline block text-gray-80 mb-2">
323+
<div className="hl-overline block text-gray-80 dark:text-gray-20 mb-2">
307324
{"Types and values"->React.string}
308325
</div>
309326
<ul>
@@ -319,10 +336,10 @@ let make = (props: props) => {
319336
| Ok({toctree, module_: {items}}) =>
320337
<div
321338
id="sidebar"
322-
className="hidden md:block md:w-48 md:-ml-4 lg:w-1/5 h-auto md:relative overflow-y-visible bg-white"
339+
className="hidden md:block md:w-48 md:-ml-4 lg:w-1/5 h-auto md:relative overflow-y-visible bg-white dark:bg-gray-95"
323340
>
324341
<div
325-
className="w-80 h-full relative top-12 w-full md:top-28 md:sticky border-r border-gray-20 overflow-y-auto pb-24 max-h-[calc(100vh-7rem)]"
342+
className="w-80 h-full relative top-12 w-full md:top-28 md:sticky border-r border-gray-20 dark:border-gray-80 overflow-y-auto pb-24 max-h-[calc(100vh-7rem)]"
326343
>
327344
<SidebarTree node={toctree} items />
328345
</div>

src/components/CodeExample.res

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module CopyButton = {
6464
// and in the next tick, add the opacity-100 class, so the transition animation actually takes place.
6565
// If we don't do that, the banner will essentially pop up without any animation
6666
let bannerEl = WebAPI.Document.createElement(document, "div")
67-
bannerEl.className = "opacity-0 absolute -top-6 right-0 -mt-5 -mr-4 px-4 py-2 w-40 rounded-lg captions text-white bg-gray-100 text-gray-80-tr transition-all duration-1000 ease-in-out "
67+
bannerEl.className = "opacity-0 absolute -top-6 right-0 -mt-5 -mr-4 px-4 py-2 w-40 rounded-lg captions bg-gray-100 text-gray-20 shadow transition-all duration-1000 ease-in-out "
6868

6969
let textNode = WebAPI.Document.createTextNode(document, "Copied to clipboard")
7070

@@ -98,7 +98,7 @@ module CopyButton = {
9898
onClick
9999
>
100100
<Icon.Clipboard
101-
className="text-gray-30 mt-px hover:cursor-pointer hover:text-gray-60 hover:bg-gray-30 w-6 h-6 p-1 rounded transition-all duration-300 ease-in-out"
101+
className="text-gray-40 dark:text-gray-40 mt-px hover:cursor-pointer hover:text-gray-60 dark:hover:text-gray-20 hover:bg-gray-30 dark:hover:bg-gray-80 w-6 h-6 p-1 rounded transition-all duration-300 ease-in-out"
102102
/>
103103
</button>
104104
}
@@ -127,7 +127,7 @@ let make = (
127127
"top-0"
128128
}
129129
<div
130-
className={`absolute ${rightPosition} ${topPosition} p-1 font-sans text-12 font-bold text-gray-30 pointer-events-none`}
130+
className={`absolute ${rightPosition} ${topPosition} p-1 font-sans text-12 font-bold text-gray-30 dark:text-gray-40 pointer-events-none`}
131131
>
132132
{//RES or JS Label
133133
String.toUpperCase(label)->React.string}
@@ -146,7 +146,7 @@ let make = (
146146

147147
<div
148148
//normal code-text without tabs
149-
className="relative w-full flex-col rounded xs:rounded border border-gray-20 bg-gray-10 pt-2 text-gray-80"
149+
className="relative w-full flex-col rounded xs:rounded border border-gray-20 dark:border-gray-80 bg-gray-10 dark:bg-gray-95 pt-2 text-gray-80 dark:text-gray-20"
150150
>
151151
label
152152
copyButton
@@ -189,9 +189,9 @@ module Toggle = {
189189
}
190190

191191
let activeClass = if selected === i {
192-
"font-medium text-12 text-gray-40 bg-gray-5 border-t-2 first:border-l"
192+
"font-medium text-12 text-gray-40 dark:text-gray-20 bg-gray-5 dark:bg-gray-95 border-t-2 border-gray-20 dark:border-gray-80 first:border-l"
193193
} else {
194-
"font-medium text-12 hover:text-gray-60 border-t-2 bg-gray-20 hover:cursor-pointer"
194+
"font-medium text-12 text-gray-40 dark:text-gray-40 hover:text-gray-60 dark:hover:text-gray-20 border-t-2 bg-gray-20 dark:bg-gray-90 hover:cursor-pointer"
195195
}
196196

197197
let onClick = evt => {
@@ -208,7 +208,7 @@ module Toggle = {
208208
}
209209

210210
let borderColor = if selected === i {
211-
"border-t-gray-60"
211+
"border-t-gray-60 dark:border-t-fire-dark"
212212
} else {
213213
"border-t-transparent"
214214
}
@@ -253,7 +253,7 @@ module Toggle = {
253253
>
254254
// ICON Link to PLAYGROUND
255255
<Icon.ExternalLink
256-
className="text-gray-30 mt-px hover:cursor-pointer hover:text-gray-60 hover:bg-gray-30 w-6 h-6 p-1 rounded transition-all duration-300 ease-in-out"
256+
className="text-gray-40 dark:text-gray-40 mt-px hover:cursor-pointer hover:text-gray-60 dark:hover:text-gray-20 hover:bg-gray-30 dark:hover:bg-gray-80 w-6 h-6 p-1 rounded transition-all duration-300 ease-in-out"
257257
/>
258258
</Link.String>
259259
: React.null
@@ -267,18 +267,20 @@ module Toggle = {
267267
| None => React.null
268268
}
269269

270-
<div className="relative pt-6 w-full rounded-none text-gray-80">
270+
<div className="relative pt-6 w-full rounded-none text-gray-80 dark:text-gray-20">
271271
//text within code-box
272272
<div
273-
className="absolute flex w-full font-sans bg-transparent text-14 text-gray-40 mt-[-26px] overflow-x-auto"
273+
className="absolute flex w-full font-sans bg-transparent text-14 text-gray-40 dark:text-gray-30 mt-[-26px] overflow-x-auto"
274274
>
275275
<div className="flex xs:ml-0"> {React.array(tabElements)} </div>
276-
<div className="flex-1 w-full bg-gray-20 border-b rounded-tr border-gray-20 items-center">
276+
<div
277+
className="flex-1 w-full bg-gray-20 dark:bg-gray-90 border-b border-gray-20 dark:border-gray-80 rounded-tr items-center"
278+
>
277279
buttonDiv
278280
</div>
279281
</div>
280282
<div
281-
className="px-4 lg:px-5 text-14 pb-4 pt-4 overflow-x-auto bg-gray-10 border-gray-20 rounded-b border"
283+
className="px-4 lg:px-5 text-14 pb-4 pt-4 overflow-x-auto bg-gray-10 dark:bg-gray-95 border-gray-20 dark:border-gray-80 rounded-b border"
282284
>
283285
<pre> children </pre>
284286
</div>

src/components/DocsSidebar.res

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ let make = (
1111
<div className="flex flex-col text-fire font-medium">
1212
<VersionSelect />
1313
</div>
14-
<button className="flex items-center" onClick={_ => NavbarUtils.closeMobileTertiaryDrawer()}>
14+
<button
15+
className="flex items-center text-gray-60 dark:text-gray-30 hover:text-gray-80 dark:hover:text-gray-20"
16+
onClick={_ => NavbarUtils.closeMobileTertiaryDrawer()}
17+
>
1518
<Icon.Close />
1619
</button>
1720
</div>

src/components/Markdown.res

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
module P = {
55
@react.component
66
let make = (~children) =>
7-
<p className="md-p md:leading-5 tracking-[-0.015em] text-gray-80 md:text-16"> children </p>
7+
<p className="md-p md:leading-5 tracking-[-0.015em] text-gray-80 dark:text-gray-20 md:text-16">
8+
children
9+
</p>
810
}
911

1012
// Used for hero like introduction text in
@@ -30,13 +32,15 @@ module Cite = {
3032
module Info = {
3133
@react.component
3234
let make = (~children) =>
33-
<div className="infobox my-5 py-6 pl-8 pr-10 rounded-lg bg-sky-5"> children </div>
35+
<div className="infobox my-5 py-6 pl-8 pr-10 rounded-lg bg-sky-5 dark:bg-sky-90/25">
36+
children
37+
</div>
3438
}
3539

3640
module Warn = {
3741
@react.component
3842
let make = (~children) =>
39-
<div className="my-6 py-6 pl-8 pr-10 rounded-lg bg-orange-10"> children </div>
43+
<div className="my-6 py-6 pl-8 pr-10 rounded-lg bg-orange-10 dark:bg-orange-15"> children </div>
4044
}
4145

4246
module UrlBox = {
@@ -100,9 +104,11 @@ module UrlBox = {
100104
<Icon.ArrowRight className="ml-1" />
101105
</ReactRouter.Link.String>
102106
}
103-
<div className="md-url-box text-16 border-l-2 border-gray-60 my-6 py-6 pl-8 pr-10 bg-gray-5">
107+
<div
108+
className="md-url-box text-16 border-l-2 border-gray-60 dark:border-gray-40 my-6 py-6 pl-8 pr-10 bg-gray-5 dark:bg-gray-95"
109+
>
104110
content
105-
<div className="mt-4 text-sky hover:text-sky-30"> link </div>
111+
<div className="mt-4 text-sky dark:text-water-dark hover:text-sky-30"> link </div>
106112
</div>
107113
}
108114
}
@@ -114,11 +120,11 @@ module Anchor = {
114120
<span className="inline group relative" title=?title>
115121
<a
116122
title=?title
117-
className="scroll-mt-30 invisible text-gray-60 opacity-50 hover:opacity-100 hover:text-gray-60 hover:cursor-pointer group-hover:visible"
123+
className="scroll-mt-30 invisible text-gray-60 dark:text-gray-30 opacity-50 hover:opacity-100 hover:text-gray-60 dark:hover:text-gray-20 hover:cursor-pointer group-hover:visible"
118124
href={"#" ++ id}
119125
id={id}
120126
>
121-
<Icon.Hyperlink className="inline-block align-middle text-gray-40" />
127+
<Icon.Hyperlink className="inline-block align-middle text-gray-40 dark:text-gray-30" />
122128
</a>
123129
</span>
124130
}
@@ -175,7 +181,7 @@ module H5 = {
175181
let make = (~id, ~children, ~title=?) => {
176182
<h5
177183
id
178-
className="group mt-12 mb-3 text-12 leading-2 font-sans font-semibold uppercase tracking-wide text-gray-80"
184+
className="group mt-12 mb-3 text-12 leading-2 font-sans font-semibold uppercase tracking-wide text-gray-80 dark:text-gray-20"
179185
>
180186
children
181187
<span className="ml-2">
@@ -194,7 +200,7 @@ module InlineCode = {
194200
@react.component
195201
let make = (~children) =>
196202
<code
197-
className="md-inline-code px-2 py-0.5 text-gray-60 font-mono rounded-sm bg-gray-10-tr border border-gray-90/5"
203+
className="md-inline-code px-2 py-0.5 text-gray-60 dark:text-gray-20 font-mono rounded-sm bg-gray-10-tr dark:bg-gray-90 border border-gray-90/5 dark:border-gray-80"
198204
>
199205
children
200206
</code>
@@ -217,15 +223,20 @@ module Th = {
217223
@react.component
218224
let make = (~children) =>
219225
<th
220-
className="py-2 pr-8 text-12 text-gray-60 uppercase font-medium tracking-wide text-left border-b-2 border-gray-20"
226+
className="py-2 pr-8 text-12 text-gray-60 dark:text-gray-30 uppercase font-medium tracking-wide text-left border-b-2 border-gray-20 dark:border-gray-80"
221227
>
222228
children
223229
</th>
224230
}
225231

226232
module Td = {
227233
@react.component
228-
let make = (~children) => <td className="border-b border-gray-20 py-3 pr-8"> children </td>
234+
let make = (~children) =>
235+
<td
236+
className="border-b border-gray-20 dark:border-gray-80 py-3 pr-8 text-gray-80 dark:text-gray-20"
237+
>
238+
children
239+
</td>
229240
}
230241

231242
module Code = {
@@ -349,7 +360,7 @@ module Blockquote = {
349360

350361
module Hr = {
351362
@react.component
352-
let make = () => <hr className="my-4" />
363+
let make = () => <hr className="my-4 border-gray-20 dark:border-gray-80" />
353364
}
354365

355366
/*
@@ -381,15 +392,18 @@ module A = {
381392
<a
382393
href
383394
rel="noopener noreferrer"
384-
className="no-underline text-fire hover:underline"
395+
className="no-underline text-fire dark:text-fire-dark hover:underline"
385396
?target
386397
dataTestId="absolute-url"
387398
>
388399
children
389400
</a>
390401
} else {
391402
<ReactRouter.Link.String
392-
to={href} className="no-underline text-fire hover:underline" ?target relative="route"
403+
to={href}
404+
className="no-underline text-fire dark:text-fire-dark hover:underline"
405+
?target
406+
relative="route"
393407
>
394408
children
395409
</ReactRouter.Link.String>
@@ -518,7 +532,11 @@ module Image = {
518532
{switch caption {
519533
| None => React.null
520534
| Some(caption) =>
521-
<div className={`mt-4 text-14 text-gray-60 ${size === #large ? "md:ml-16" : ""}`}>
535+
<div
536+
className={`mt-4 text-14 text-gray-60 dark:text-gray-30 ${size === #large
537+
? "md:ml-16"
538+
: ""}`}
539+
>
522540
{React.string(caption)}
523541
</div>
524542
}}
@@ -538,7 +556,9 @@ module Video = {
538556
{switch caption {
539557
| None => React.null
540558
| Some(caption) =>
541-
<div className="mt-4 text-14 text-gray-80 md:ml-16"> {React.string(caption)} </div>
559+
<div className="mt-4 text-14 text-gray-80 dark:text-gray-20 md:ml-16">
560+
{React.string(caption)}
561+
</div>
542562
}}
543563
</div>
544564
}

src/components/NavbarSecondary.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let make = () => {
1515

1616
<nav
1717
dataTestId="navbar-secondary"
18-
className={"text-12 md:text-14 shadow h-12 w-full bg-white sticky z-95 top-16 transition-transform duration-300 px-4 " ++
18+
className={"text-12 md:text-14 shadow h-12 w-full bg-white dark:bg-gray-95 text-gray-60 dark:text-gray-30 border-b border-gray-20 dark:border-gray-80 sticky z-95 top-16 transition-transform duration-300 px-4 " ++
1919
navbarClasses}
2020
>
2121
<div className="flex gap-6 lg:gap-10 items-center h-full w-full max-w-1280 m-auto">

src/components/NavbarTertiary.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ let make = (~sidebar: option<React.element>=?, ~children) => {
2727
<>
2828
<nav
2929
dataTestId="navbar-tertiary"
30-
className={`shadow h-12 w-full bg-white sticky z-90 transition-transform duration-300 px-4
30+
className={`shadow h-12 w-full bg-white dark:bg-gray-95 text-gray-60 dark:text-gray-30 border-b border-gray-20 dark:border-gray-80 sticky z-90 transition-transform duration-300 px-4
3131
${navbarClasses}
3232
${isDocRoute(~route=pathname) ? "top-28" : "top-16"}`}
3333
>
3434
<div className="flex items-center h-full w-full max-w-1280 m-auto">
3535
<button
36-
className="md:hidden mr-3"
36+
className="md:hidden mr-3 text-gray-60 dark:text-gray-30"
3737
onClick={toggleMobileTertiaryDrawer}
3838
ariaLabel="Toggle navigation menu"
3939
type_="button"
4040
>
41-
<img className="h-4" src="/ic_sidebar_drawer.svg" />
41+
<img className="h-4 dark:invert" src="/ic_sidebar_drawer.svg" />
4242
</button>
4343
<div
4444
className="truncate overflow-x-auto touch-scroll flex items-center space-x-4 justify-between mr-4 w-full"
@@ -52,7 +52,7 @@ let make = (~sidebar: option<React.element>=?, ~children) => {
5252
onClick={handleBackdropClick}
5353
className={`${isDocRoute(~route=pathname)
5454
? "top-40"
55-
: "top-28"} flex-col h-full w-full z-50 bg-white overflow-y-auto pb-8 backdrop:bg-transparent`}
55+
: "top-28"} flex-col h-full w-full z-50 bg-white dark:bg-gray-95 text-gray-60 dark:text-gray-30 overflow-y-auto pb-8 backdrop:bg-transparent`}
5656
>
5757
{switch sidebar {
5858
| Some(sidebar) => sidebar

0 commit comments

Comments
 (0)