Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax highlighting light theme in API ref #1067

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion site/api/components/Class/Constructors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function Constructors({
{v.accessibility
? <StyleKw>{v.accessibility}{" "}</StyleKw>
: undefined}
<span style="color: rgb(98, 232, 132);">{v.name}</span>(
<span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">
{v.name}
</span>(
<Params getLink={getLink}>{v.params}</Params>);
</CodeBlock>
{"jsDoc" in v && <P doc>{v.jsDoc?.doc}</P>}
Expand Down
16 changes: 13 additions & 3 deletions site/api/components/Class/Method.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,23 @@ export function Def(
return (
<>
{method.kind == "setter"
? <span style="color: #F286C4;">set{" "}</span>
? (
<span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">
set{" "}
</span>
)
: method.kind == "getter"
? <span style="color: #F286C4;">get{" "}</span>
? (
<span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">
get{" "}
</span>
)
: (
""
)}
<span style="color: #62E884">{method.name}</span>
<span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">
{method.name}
</span>
<TypeParams_ getLink={getLink}>
{typeParams}
</TypeParams_>(
Expand Down
9 changes: 5 additions & 4 deletions site/api/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ export function CodeBlock({ children }: { children?: ComponentChildren }) {
return (
<>
{"\n\n"}
<div class="language-ts">
<div class="language-ts vp-adaptive-theme">
<button title="Copy Code" class="copy"></button>
<span class="lang">ts</span>
{"\n\n"}
<pre class="shiki dracula-soft">
<code>{children}</code>
<pre class="shiki shiki-themes github-light github-dark vp-code">
<code style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{children}</code>
</pre>
{"\n\n"}
</div>
{"\n\n"}
</>
Expand Down
4 changes: 2 additions & 2 deletions site/api/components/PropertyName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function PropertyName({
}) {
return (
<>
<span style={klass ? "" : "color:#FFB86C;font-style:italic;"}>
<span style={klass ? "" : "--shiki-light:#24292E;--shiki-dark:#E1E4E8;"}>
{name}
</span>
{(optional || hasType) && (
<span style="color:#F286C4;">
<span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">
{optional && <>?</>}
{hasType && <>:</>}
</span>
Expand Down
18 changes: 13 additions & 5 deletions site/api/components/styles.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
import { ComponentChildren } from "preact";

export function StyleKw({ children }: { children?: ComponentChildren }) {
return <span style="color:#F286C4;">{children}</span>;
return (
<span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">{children}</span>
);
}

export function StyleStrLit({ children }: { children?: ComponentChildren }) {
return <span style="color:#E7EE98;">{children}</span>;
return (
<span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">{children}</span>
);
}

export function StyleTypeRef({ children }: { children?: ComponentChildren }) {
return (
<span style="color:#97E1F1;font-style:italic;">
<span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">
{children}
</span>
);
}

export function StyleCallee({ children }: { children?: ComponentChildren }) {
return <span style="color:#62E884">{children}</span>;
return (
<span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">{children}</span>
);
}

export function StyleNum({ children }: { children?: ComponentChildren }) {
return <span style="color:#BF9EEE">{children}</span>;
return (
<span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{children}</span>
);
}
Loading