Skip to content

Commit 9d83a40

Browse files
committed
Update to handle dark mode
1 parent 009dfd1 commit 9d83a40

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

src/components/ReferenceDirectoryWithFilter/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { ReferenceDocContentItem } from "@/src/content/types";
22
import { useMemo, useRef, useState } from "preact/hooks";
3-
import type { JSX } from "preact";
3+
import { type JSX } from "preact";
44
import { Icon } from "../Icon";
5+
import flask from "@src/content/ui/images/icons/flask.svg?raw";
56

67
type ReferenceDirectoryEntry = ReferenceDocContentItem & {
78
data: {
@@ -94,12 +95,9 @@ export const ReferenceDirectoryWithFilter = ({
9495
class="text-body-mono group-hover:underline"
9596
>
9697
{entry.data.beta && (
97-
<img
98-
className="inline-block align-center mr-2"
99-
src="/icons/flask.svg"
100-
alt="(Experimental)"
101-
width={16}
102-
height={16}
98+
<div
99+
className="inline-block mr-2 w-[16px] h-[16px] mb-[-2px]"
100+
dangerouslySetInnerHTML={{ __html: flask }}
103101
/>
104102
)}
105103
<span dangerouslySetInnerHTML={{ __html: entry.data.title }} />
Lines changed: 1 addition & 1 deletion
Loading

src/layouts/ReferenceItemLayout.astro

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import type {
1919
} from "@/types/parsers.interface";
2020
import { setJumpToState } from "../globals/state";
2121
import { p5Version } from "../globals/p5-version";
22+
import flask from "@src/content/ui/images/icons/flask.svg?raw";
2223
2324
const { entry, relatedEntries } = Astro.props;
2425
const currentLocale = getCurrentLocale(Astro.url.pathname);
@@ -91,12 +92,9 @@ const seenParams: Record<string, true> = {};
9192
{entry.data.beta && (
9293
<div class="experimental">
9394
<h5>
94-
<img
95-
class="inline-block align-center"
96-
src="/icons/flask.svg"
97-
alt="(Experimental)"
98-
width={20}
99-
height={20}
95+
<div
96+
class="inline-block mr-2 w-[20px] h-[20px] mb-[-2px]"
97+
set:html={flask}
10098
/>
10199
{t('experimentalApi', 'title')}
102100
</h5>

0 commit comments

Comments
 (0)