Skip to content

Commit 2d7f79a

Browse files
committed
initial
1 parent aaf3adc commit 2d7f79a

13 files changed

+737
-45
lines changed

astro.config.mjs

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import starlight from '@astrojs/starlight';
2+
import tailwind from "@astrojs/tailwind";
23
import { defineConfig } from 'astro/config';
34

4-
import tailwind from "@astrojs/tailwind";
5+
import react from "@astrojs/react";
56

67
// https://astro.build/config
78
export default defineConfig({
89
integrations: [starlight({
910
title: 'fullstackhero',
1011
editLink: {
11-
baseUrl: 'https://github.com/fullstackhero/docs/edit/astro/',
12+
baseUrl: 'https://github.com/fullstackhero/docs/edit/astro/'
1213
},
1314
social: {
1415
github: 'https://github.com/withastro/starlight'
1516
},
16-
customCss: [
17-
'./src/styles/tailwind.css',
18-
'./src/styles/base.css'
19-
],
17+
customCss: ['./src/styles/tailwind.css', './src/styles/custom.scss'],
2018
sidebar: [{
2119
label: 'General',
2220
autogenerate: {
@@ -28,10 +26,7 @@ export default defineConfig({
2826
directory: '/dotnet-starter-kit/webapi/'
2927
}
3028
}]
31-
}),
32-
tailwind(
33-
{
34-
applyBaseStyles: false,
35-
}
36-
)]
29+
}), tailwind({
30+
applyBaseStyles: false
31+
}), react()]
3732
});

package-lock.json

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

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111
},
1212
"dependencies": {
1313
"@astrojs/check": "^0.7.0",
14+
"@astrojs/react": "^3.6.0",
1415
"@astrojs/starlight": "^0.24.2",
1516
"@astrojs/starlight-tailwind": "^2.0.3",
1617
"@astrojs/tailwind": "^5.1.0",
18+
"@types/react": "^18.3.3",
19+
"@types/react-dom": "^18.3.0",
1720
"astro": "^4.10.2",
21+
"classnames": "^2.5.1",
22+
"react": "^18.3.1",
23+
"react-dom": "^18.3.1",
1824
"sharp": "^0.32.5",
1925
"tailwindcss": "^3.4.4",
2026
"typescript": "^5.4.5"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@import '../../../styles/variables.scss';
2+
3+
.link {
4+
--outline-color-hsl: 0, 0%, 100%;
5+
--outline-opacity: 0.08;
6+
display: flex;
7+
align-items: center;
8+
justify-content: center;
9+
height: 40px;
10+
padding: 1px 20px 0;
11+
border-radius: 8px;
12+
color: var(--custom-color-text-strong);
13+
font-size: 15px;
14+
font-weight: 400;
15+
text-align: center;
16+
text-decoration: none;
17+
box-shadow: inset 0 0 0 1px hsla(var(--outline-color-hsl), var(--outline-opacity));
18+
background-color: hsla(224, 32%, 28%, 0.24);
19+
backdrop-filter: blur(8px);
20+
transition: var(--transition-fast);
21+
transition-property: background-color, box-shadow, color;
22+
23+
[data-theme='light'] & {
24+
--outline-color-hsl: 0, 0%, 0%;
25+
background-color: hsla(224, 32%, 28%, 0.08);
26+
}
27+
28+
&:hover {
29+
--outline-opacity: 0.1;
30+
color: var(--custom-color-text-strong) !important; // !important for starlight override only
31+
background-color: hsla(224, 32%, 28%, 0.54);
32+
[data-theme='light'] & {
33+
--outline-opacity: 0.16;
34+
background-color: hsla(224, 32%, 28%, 0.04);
35+
}
36+
}
37+
38+
&.accent {
39+
color: #fff !important; // !important for starlight override only
40+
background-color: #3eaf7c;
41+
42+
&:hover {
43+
background-color: #3eaf7c;
44+
}
45+
}
46+
}

src/components/ui/button/Button.tsx

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import type { ButtonTheme } from '@components/ui/button/ButtonTheme';
2+
import type { FC, ReactNode } from 'react';
3+
4+
import cn from 'classnames';
5+
import styles from './Button.module.scss';
6+
7+
interface Props {
8+
children?: ReactNode;
9+
theme?: ButtonTheme;
10+
url: string;
11+
}
12+
13+
export const Button: FC<Props> = ({ children, theme = 'default', url }) => (
14+
<a href={url} className={cn(styles.link, { [styles[theme]]: true })}>
15+
{children}
16+
</a>
17+
);
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type ButtonTheme = 'default' | 'accent';

0 commit comments

Comments
 (0)