Skip to content

Commit ed90862

Browse files
committed
feat: update styling with banner and other assets
1 parent 53734ff commit ed90862

15 files changed

+130
-427
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# TypeScript from Zero
22

3+
![TypeScript from Zero](./static/img/social-card.png)
4+
35
This repository serves as an interactive guide to TypeScript.
46
It contains written guides in the form of README.md files, as well as code examples in the form of `.ts` files.
57

docusaurus.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const config: Config = {
4949
],
5050

5151
themeConfig: {
52-
image: "img/docusaurus-social-card.jpg",
52+
image: "img/social-card.png",
5353
navbar: {
5454
title: "TypeScript from Zero",
5555
logo: {
@@ -61,7 +61,7 @@ const config: Config = {
6161
type: "docSidebar",
6262
sidebarId: "tutorialSidebar",
6363
position: "left",
64-
label: "Tutorial",
64+
label: "Guide",
6565
},
6666
{
6767
href: "https://github.com/jeffsieu/typescript-from-zero",

src/components/HomepageFeatures/index.tsx

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,46 @@
1-
import type {ReactNode} from 'react';
2-
import clsx from 'clsx';
3-
import Heading from '@theme/Heading';
4-
import styles from './styles.module.css';
1+
import type { ReactNode } from "react";
2+
import clsx from "clsx";
3+
import Heading from "@theme/Heading";
4+
import styles from "./styles.module.css";
55

66
type FeatureItem = {
77
title: string;
8-
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
98
description: ReactNode;
109
};
1110

1211
const FeatureList: FeatureItem[] = [
1312
{
14-
title: 'Easy to Use',
15-
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default,
13+
title: "Learn TypeScript Basics",
1614
description: (
1715
<>
18-
Docusaurus was designed from the ground up to be easily installed and
19-
used to get your website up and running quickly.
16+
Start your journey with TypeScript by learning the fundamental concepts
17+
and syntax to build strong foundations.
2018
</>
2119
),
2220
},
2321
{
24-
title: 'Focus on What Matters',
25-
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default,
22+
title: "Intermediate Concepts",
2623
description: (
2724
<>
28-
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go
29-
ahead and move your docs into the <code>docs</code> directory.
25+
Dive deeper into TypeScript with topics like union types, type guards,
26+
and advanced type manipulation.
3027
</>
3128
),
3229
},
3330
{
34-
title: 'Powered by React',
35-
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default,
31+
title: "Advanced TypeScript",
3632
description: (
3733
<>
38-
Extend or customize your website layout by reusing React. Docusaurus can
39-
be extended while reusing the same header and footer.
34+
Master TypeScript by exploring generics, conditional types, and
35+
declaration merging to write highly scalable code.
4036
</>
4137
),
4238
},
4339
];
4440

45-
function Feature({title, Svg, description}: FeatureItem) {
41+
function Feature({ title, description }: FeatureItem) {
4642
return (
47-
<div className={clsx('col col--4')}>
48-
<div className="text--center">
49-
<Svg className={styles.featureSvg} role="img" />
50-
</div>
43+
<div className={clsx("col col--4")}>
5144
<div className="text--center padding-horiz--md">
5245
<Heading as="h3">{title}</Heading>
5346
<p>{description}</p>

src/css/custom.css

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66

77
/* You can override the default Infima variables here. */
88
:root {
9-
--ifm-color-primary: #2e8555;
10-
--ifm-color-primary-dark: #29784c;
11-
--ifm-color-primary-darker: #277148;
12-
--ifm-color-primary-darkest: #205d3b;
13-
--ifm-color-primary-light: #33925d;
14-
--ifm-color-primary-lighter: #359962;
15-
--ifm-color-primary-lightest: #3cad6e;
9+
--ifm-color-primary: #0556ad;
10+
--ifm-color-primary-dark: #044d9c;
11+
--ifm-color-primary-darker: #044993;
12+
--ifm-color-primary-darkest: #043c79;
13+
--ifm-color-primary-light: #055fbe;
14+
--ifm-color-primary-lighter: #0663c7;
15+
--ifm-color-primary-lightest: #0670e1;
1616
--ifm-code-font-size: 95%;
1717
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
1818
}
1919

2020
/* For readability concerns, you should choose a lighter palette in dark mode. */
2121
[data-theme='dark'] {
22-
--ifm-color-primary: #25c2a0;
23-
--ifm-color-primary-dark: #21af90;
24-
--ifm-color-primary-darker: #1fa588;
25-
--ifm-color-primary-darkest: #1a8870;
26-
--ifm-color-primary-light: #29d5b0;
27-
--ifm-color-primary-lighter: #32d8b4;
28-
--ifm-color-primary-lightest: #4fddbf;
22+
--ifm-color-primary: #80bdff;
23+
--ifm-color-primary-dark: #5aa9ff;
24+
--ifm-color-primary-darker: #479fff;
25+
--ifm-color-primary-darkest: #0d81ff;
26+
--ifm-color-primary-light: #a6d1ff;
27+
--ifm-color-primary-lighter: #b9dbff;
28+
--ifm-color-primary-lightest: #f3f9ff;
2929
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
3030
}

src/pages/index.module.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,24 @@
44
*/
55

66
.heroBanner {
7-
padding: 4rem 0;
7+
padding: 2rem 0 4rem 0;
88
text-align: center;
99
position: relative;
1010
overflow: hidden;
11+
background-color: #333333;
12+
flex-direction: column;
13+
color: white;
14+
}
15+
16+
.heroTitle {
17+
display: none;
18+
}
19+
20+
.heroBannerImage {
21+
display: block;
22+
max-width: min(600px, 100%);
23+
align-self: center;
24+
margin-bottom: 2rem;
1125
}
1226

1327
@media screen and (max-width: 996px) {

src/pages/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ import styles from "./index.module.css";
1111
function HomepageHeader() {
1212
const { siteConfig } = useDocusaurusContext();
1313
return (
14-
<header className={clsx("hero hero--primary", styles.heroBanner)}>
14+
<header className={clsx("hero", styles.heroBanner)}>
15+
<img
16+
alt="TypeScript from Zero"
17+
className={styles.heroBannerImage}
18+
src="img/banner-uncropped.svg"
19+
/>
1520
<div className="container">
16-
<Heading as="h1" className="hero__title">
21+
<Heading as="h1" className={clsx("hero__title", styles.heroTitle)}>
1722
{siteConfig.title}
1823
</Heading>
1924
<p className="hero__subtitle">{siteConfig.tagline}</p>
@@ -33,10 +38,7 @@ function HomepageHeader() {
3338
export default function Home(): ReactNode {
3439
const { siteConfig } = useDocusaurusContext();
3540
return (
36-
<Layout
37-
title={`Hello from ${siteConfig.title}`}
38-
description="Description will go into a meta tag in <head />"
39-
>
41+
<Layout title="Home" description={siteConfig.tagline}>
4042
<HomepageHeader />
4143
<main>
4244
<HomepageFeatures />

static/img/banner-uncropped.svg

Lines changed: 39 additions & 0 deletions
Loading
-54.4 KB
Binary file not shown.

static/img/docusaurus.png

-5.02 KB
Binary file not shown.

static/img/favicon.ico

11.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)