Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 13107f2

Browse files
committed
more light mode fixes
1 parent 73b5c87 commit 13107f2

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

docs/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Oh, and it supports basically any language, like JavaScript, TypeScript, Python,
2020

2121
<CodeSwitcher className="xl:max-h-[300px]" tabs>
2222

23-
```javascript !! title:services/api.js
23+
```javascript title:services/api.js
2424
import { api } from '@nitric/sdk'
2525

2626
const main = api('main')
@@ -31,7 +31,7 @@ main.get('/hello/:name', async ({ req, res }) => {
3131
})
3232
```
3333

34-
```typescript !! title:services/api.ts
34+
```typescript title:services/api.ts
3535
import { api } from '@nitric/sdk'
3636

3737
const main = api('main')
@@ -42,7 +42,7 @@ main.get('/hello/:name', async ({ req, res }) => {
4242
})
4343
```
4444

45-
```python !! title:services/example.py
45+
```python title:services/example.py
4646
from nitric.application import Nitric
4747
from nitric.resources import api
4848
from nitric.context import HttpContext
@@ -57,7 +57,7 @@ async def hello_world(ctx: HttpContext):
5757
Nitric.run()
5858
```
5959

60-
```go !! title:services/example/main.go
60+
```go title:services/example/main.go
6161
// !collapse(1:5) collapsed
6262
import (
6363
"context"
@@ -78,7 +78,7 @@ func main() {
7878
}
7979
```
8080

81-
```dart !! title:services/example.dart
81+
```dart title:services/example.dart
8282
import 'package:nitric_sdk/nitric.dart';
8383
8484
void main() {

src/components/code/CodeContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const CodeContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
66
<div
77
tabIndex={0}
88
className={
9-
'not-prose group relative mb-6 w-full max-w-full overflow-hidden rounded-md border border-white/5 bg-code shadow-[inset_0px_0px_33px_-10px_#00000008,0px_0px_38px_-2px_#00000030]'
9+
'not-prose group relative mb-6 w-full max-w-full overflow-hidden rounded-md border bg-code shadow-md shadow-zinc-300/5 dark:border-white/5 dark:shadow-zinc-800/10'
1010
}
1111
>
1212
{children}

src/components/code/CopyButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function CopyButton({
3131
'group/button absolute right-3.5 top-2.5 z-10 h-8 rounded-md px-1.5 py-1 text-2xs font-medium backdrop-blur transition',
3232
copied
3333
? 'bg-primary-400/10 ring-primary-400/20'
34-
: 'bg-white/5 ring-1 ring-inset ring-zinc-300/10 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5',
34+
: 'bg-white/5 ring-1 ring-inset ring-zinc-300/80 hover:bg-white/7.5 dark:bg-white/2.5 dark:ring-zinc-300/10 dark:hover:bg-white/5',
3535
'opacity-0 focus:opacity-100 group-hover:opacity-100 group-focus:opacity-100',
3636
className,
3737
)}

src/components/code/Pre.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ type Props = {
2020
highlighted: HighlightedCode
2121
showPanel?: boolean
2222
className?: string
23-
copyButtonClassName?: string
2423
} & HandlerProps
2524

2625
const Pre: React.FC<Props> = ({
2726
highlighted,
2827
showPanel,
2928
enableTransitions,
3029
className,
31-
copyButtonClassName,
3230
}) => {
3331
const { title } = meta(highlighted)
3432

3533
let handlers = [callout, fold, collapse, collapseTrigger, collapseContent]
34+
35+
// Getting an issue with color transitions on the -code-text token
36+
// Note: this also won't work with the Tabs component, only the CodeSwitcherSelect
3637
if (enableTransitions) {
3738
handlers = [...handlers, tokenTransitions]
3839
}
@@ -47,23 +48,23 @@ const Pre: React.FC<Props> = ({
4748
<div className="relative flex h-9 items-center justify-start pr-12 font-display text-2xs text-zinc-300 sm:text-xs">
4849
{/* one-off breakpoint to hide the filename on extremely narrow screens - to avoid interfering with the lang select */}
4950
<div className="relative flex h-full items-center justify-center gap-x-1 px-4">
50-
<div className="size-[6px] rounded-full bg-zinc-300/10" />
51-
<div className="size-[6px] rounded-full bg-zinc-300/10" />
52-
<div className="size-[6px] rounded-full bg-zinc-300/10" />
51+
<div className="size-[6px] rounded-full bg-zinc-300 dark:bg-zinc-300/10" />
52+
<div className="size-[6px] rounded-full bg-zinc-300 dark:bg-zinc-300/10" />
53+
<div className="size-[6px] rounded-full bg-zinc-300 dark:bg-zinc-300/10" />
5354
</div>
54-
<div className="absolute bottom-0 h-[1px] w-full bg-zinc-300/5" />
55+
<div className="absolute bottom-0 h-px w-full bg-zinc-200 dark:bg-zinc-300/5" />
5556
</div>
5657
)}
5758
{showFileNamePanel && (
58-
<div className="relative flex h-10 items-center justify-start pr-12 font-display text-2xs text-zinc-300 sm:text-xs">
59+
<div className="relative flex h-10 items-center justify-start pr-12 font-display text-2xs dark:text-zinc-300 sm:text-xs">
5960
{/* one-off breakpoint to hide the filename on extremely narrow screens - to avoid interfering with the lang select */}
60-
<div className="relative flex h-full items-center border-r border-zinc-300/5">
61+
<div className="relative flex h-full items-center border-r dark:border-zinc-300/5">
6162
<span className="hidden whitespace-nowrap px-4 py-2 min-[320px]:block">
6263
{title}
6364
</span>
64-
<div className="absolute bottom-0 h-[1px] w-full bg-primary-300" />
65+
<div className="absolute bottom-0 z-10 h-px w-full bg-primary-300" />
6566
</div>
66-
<div className="absolute bottom-0 h-[1px] w-full bg-zinc-300/5" />
67+
<div className="absolute bottom-0 h-px w-full bg-zinc-200 dark:bg-zinc-300/5" />
6768
</div>
6869
)}
6970
<CopyButton

src/components/tabs/Tabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export const Tabs: React.FC<TabProps> = ({
4343
<TabsTrigger
4444
value={tab.props.label}
4545
key={tab.props.label}
46-
className="group/tab relative h-12 data-[state=active]:bg-transparent data-[state=active]:text-primary dark:hover:text-zinc-200 dark:data-[state=active]:text-primary-300"
46+
className="group/tab relative h-12 hover:text-zinc-600 data-[state=active]:bg-transparent data-[state=active]:text-primary data-[state=active]:shadow-none dark:hover:text-zinc-200 dark:data-[state=active]:text-primary-300"
4747
>
4848
{tab.props.label}
49-
<div className="absolute inset-x-0 bottom-0 h-px bg-primary opacity-0 transition-opacity group-data-[state=active]/tab:opacity-100 dark:bg-primary-300" />
49+
<div className="absolute inset-x-0 bottom-0 z-10 h-px bg-primary opacity-0 transition-opacity group-data-[state=active]/tab:opacity-100 dark:bg-primary-300" />
5050
</TabsTrigger>
5151
))}
52-
<div className="absolute inset-x-0 bottom-0 h-px bg-zinc-300/10" />
52+
<div className="absolute inset-x-0 bottom-0 h-px bg-zinc-200 dark:bg-zinc-300/10" />
5353
</TabsList>
5454
{children}
5555
</BaseTabs>

0 commit comments

Comments
 (0)