Skip to content

Commit b42b61a

Browse files
committed
chore: applied required style changes
1 parent f1b422a commit b42b61a

11 files changed

+149
-57
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "inkchain-docs",
3-
"packageManager": "pnpm@9.1.3",
3+
"packageManager": "pnpm@9.2.0",
44
"scripts": {
55
"dev": "next dev",
66
"build": "next build",
@@ -63,7 +63,7 @@
6363
"remark-code-import": "1.2.0",
6464
"remark-frontmatter": "5.0.0",
6565
"remark-gfm": "4.0.0",
66-
"remark-lint-frontmatter-schema": "3.15.3",
66+
"remark-lint-frontmatter-schema": "3.15.4",
6767
"remark-lint-heading-style": "4.0.0",
6868
"remark-lint-list-item-indent": "4.0.0",
6969
"remark-lint-table-cell-padding": "5.0.0",
@@ -72,7 +72,7 @@
7272
"remark-lint-unordered-list-marker-style": "4.0.0",
7373
"remark-preset-lint-consistent": "6.0.0",
7474
"remark-preset-lint-recommended": "7.0.0",
75-
"tailwindcss": "3.4.3",
75+
"tailwindcss": "3.4.4",
7676
"typescript": "5.4.5"
7777
}
7878
}

pnpm-lock.yaml

+29-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/AddNetworkButton.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { addNetwork } from "@/utils/add-network";
22

3+
import { Button } from "./Button";
4+
35
export const AddNetworkButton = () => {
46
return (
5-
<button
6-
className="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded inline-flex items-center"
7+
<Button
8+
variant="primary"
9+
// variant="secondary"
710
onClick={addNetwork}
811
>
912
Add Ink Sepolia Network
10-
</button>
13+
</Button>
1114
);
1215
};

src/components/Button.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { PropsWithChildren } from "react";
2+
import clsx from "clsx";
3+
4+
interface ButtonProps {
5+
variant: "primary" | "secondary";
6+
onClick?: () => void;
7+
}
8+
9+
export const Button: React.FC<PropsWithChildren<ButtonProps>> = ({
10+
children,
11+
variant,
12+
onClick,
13+
}) => {
14+
return (
15+
<button
16+
className={clsx(
17+
"font-semibold py-2 px-4 rounded-xl inline-flex items-center transition-all",
18+
{
19+
"text-magic-white bg-magic-purple": variant === "primary",
20+
"text-magic-purple bg-magic-semi-deep-purple/15 ":
21+
variant === "secondary",
22+
}
23+
)}
24+
onClick={onClick}
25+
>
26+
{children}
27+
</button>
28+
);
29+
};

src/components/SidebarTitleComponent.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,19 @@ export const SidebarTitleComponent: React.FC<SidebarTitleComponentProps> = ({
1616
const isActive = route === asPath;
1717

1818
if (type === "separator") {
19-
return <div className="font-bold text-black dark:text-white">{title}</div>;
19+
return (
20+
<div className="font-bold text-black dark:text-magic-white">{title}</div>
21+
);
2022
}
2123

2224
return (
2325
<div
2426
className={clsx(
25-
"ink-sidebar-item px-2 py-1.5 rounded-sm w-full hover:bg-magic-purple/20 transition-all",
27+
"ink-sidebar-item px-2 py-1.5 rounded-sm w-full transition-all",
2628
{
27-
"bg-magic-purple/20": isActive,
29+
"text-ink-grey-400 dark:text-magic-white dark:hover:text-ink-grey-700 hover:text-ink-grey-700 hover:bg-ink-grey-100":
30+
!isActive,
31+
"bg-magic-semi-deep-purple/15 text-magic-purple": isActive,
2832
}
2933
)}
3034
>

src/components/ThemeToggle.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const ThemeToggle = () => {
3131
return (
3232
<button className="w-6 h-6" type="button" onClick={onToggleTheme}>
3333
{resolvedTheme === "light" ? (
34-
<SunIcon className="w-6 h-6 text-magic-purple" />
34+
<SunIcon className="w-6 h-6 text-magic-black" />
3535
) : (
3636
<MoonIcon className="w-6 h-6 text-white" />
3737
)}

src/components/Toc.tsx

+11-9
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ export const Toc: React.FC<TocProps> = ({ headings }) => {
1919
<div className="flex flex-col items-start justify-start py-5 sticky top-14">
2020
{headings.length > 0 && (
2121
<div className="flex flex-col gap-2 border-b pb-4 mb-6">
22-
<h5 className="font-bold text-magic-black">On this page</h5>
22+
<h5 className="font-bold text-magic-black dark:text-magic-white">
23+
On this page
24+
</h5>
2325

2426
<ul>
2527
{headings.map(({ id, value }) => (
26-
<li key={id} className="mb-2">
27-
<Link className="text-sm cursor-pointer" href={`#${id}`}>
28+
<li key={id} className="group mb-2">
29+
<Link className="text-sm toc-link" href={`#${id}`}>
2830
{value}
2931
</Link>
3032
</li>
@@ -35,18 +37,18 @@ export const Toc: React.FC<TocProps> = ({ headings }) => {
3537
<div className="flex flex-col gap-2">
3638
<Link
3739
href={URLS.developerWailistUrl}
38-
className="text-xs flex items-center gap-1"
40+
className="group text-xs flex items-center gap-1"
3941
>
40-
<ThumpUpIcon className="size-4 text-magic-purple" />
41-
Give us feedback
42+
<ThumpUpIcon className="size-4 toc-link" />
43+
<span className="toc-link">Give us feedback</span>
4244
</Link>
4345

4446
<Link
4547
href={URLS.editDocsOnGithub}
46-
className="text-xs flex items-center gap-1"
48+
className="group text-xs flex items-center gap-1"
4749
>
48-
<PencilIcon className="size-4 text-magic-purple" />
49-
Edit this page on Github
50+
<PencilIcon className="size-4 toc-link" />
51+
<span className="toc-link">Edit this page on Github</span>
5052
</Link>
5153
</div>
5254
</div>

src/globals.css

+25-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,35 @@
33
@tailwind utilities;
44

55
@layer base {
6+
h1,
7+
h2,
8+
h3,
9+
h4 {
10+
@apply !text-magic-deep-purple dark:!text-magic-white;
11+
}
12+
613
a {
7-
@apply !text-magic-purple dark:!text-magic-purple;
14+
@apply !text-magic-purple dark:!text-magic-semi-deep-purple;
15+
}
16+
17+
nav > a {
18+
@apply !text-ink-grey-400 dark:!text-magic-white dark:hover:!text-ink-grey-400 hover:!text-ink-grey-700;
19+
}
20+
21+
nav > a > svg {
22+
@apply !fill-magic-black dark:!fill-magic-white;
823
}
924

1025
nav {
11-
@apply bg-magic-white dark:bg-magic-black;
26+
@apply bg-white dark:bg-magic-black;
27+
}
28+
29+
pre {
30+
@apply !bg-magic-semi-deep-purple/15;
31+
}
32+
33+
.toc-link {
34+
@apply cursor-pointer !text-ink-grey-400 dark:!text-magic-white group-hover:!text-ink-grey-700 dark:group-hover:!text-ink-grey-700;
1235
}
1336
}
1437

src/pages/_app.tsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
// These styles apply to every route in the application
22
import type { AppProps } from "next/app";
3+
import { Inter } from "next/font/google";
34
import { ThemeProvider } from "next-themes";
45

56
import "../globals.css";
67

8+
const inter = Inter({
9+
subsets: ["latin"],
10+
variable: "--font-inter",
11+
});
12+
713
export default function App({ Component, pageProps }: AppProps) {
814
return (
915
<ThemeProvider attribute="class">
10-
<div className="bg-magic-white dark:bg-magic-black">
11-
<Component {...pageProps} />
16+
<div className={`${inter.variable} font-sans`}>
17+
<div className="bg-white dark:bg-magic-black">
18+
<Component {...pageProps} />
19+
</div>
1220
</div>
1321
</ThemeProvider>
1422
);

0 commit comments

Comments
 (0)