Skip to content

Commit bd4ef16

Browse files
committed
feat(SocialIcons): add SocialIcons component for social media links
1 parent 02ce54d commit bd4ef16

3 files changed

Lines changed: 75 additions & 2 deletions

File tree

website/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default defineConfig({
2020
Sidebar: './src/components/starlight/Sidebar.astro',
2121
Footer: './src/components/starlight/Footer.astro',
2222
MobileMenuFooter: './src/components/starlight/MobileMenuFooter.astro',
23+
SocialIcons: './src/components/starlight/SocialIcons.astro',
2324
},
2425
sidebar: [
2526
{
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
import config from 'virtual:starlight/user-config';
3+
4+
const links = config.social || [];
5+
---
6+
7+
{
8+
links.map(({ label, href, icon }) => (
9+
<a {href} rel="me" target="_blank" class="sl-flex" aria-label={label}>
10+
<span class="sr-only">{label}</span>
11+
{icon === 'github' && (
12+
<svg
13+
xmlns="http://www.w3.org/2000/svg"
14+
width="1.25rem"
15+
height="1.25rem"
16+
viewBox="0 0 16 16"
17+
aria-hidden="true"
18+
fill="currentColor"
19+
>
20+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" />
21+
</svg>
22+
)}
23+
</a>
24+
))
25+
}
26+
27+
<a
28+
href="https://pinkpixel.dev"
29+
target="_blank"
30+
rel="noopener noreferrer"
31+
class="sl-flex"
32+
aria-label="Pink Pixel"
33+
title="pinkpixel.dev"
34+
>
35+
<span class="sr-only">Pink Pixel</span>
36+
<svg
37+
xmlns="http://www.w3.org/2000/svg"
38+
width="1.25rem"
39+
height="1.25rem"
40+
viewBox="0 0 24 24"
41+
fill="none"
42+
stroke="currentColor"
43+
stroke-width="2"
44+
stroke-linecap="round"
45+
stroke-linejoin="round"
46+
aria-hidden="true"
47+
>
48+
<circle cx="12" cy="12" r="10"></circle>
49+
<line x1="2" y1="12" x2="22" y2="12"></line>
50+
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"
51+
></path>
52+
</svg>
53+
</a>
54+
55+
<style>
56+
@layer starlight.core {
57+
a {
58+
color: var(--sl-color-text-accent);
59+
padding: 0.5em;
60+
margin: -0.5em;
61+
}
62+
a:hover {
63+
opacity: 0.66;
64+
}
65+
}
66+
</style>

website/src/styles/bytebox-docs.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
--sl-color-gray-5: #59647a;
1919
--sl-color-gray-6: #3f495c;
2020
--sl-color-black: #090b10;
21+
22+
--sl-nav-height: 5rem;
2123
}
2224

2325
body {
@@ -52,7 +54,7 @@ body {
5254
}
5355

5456
.site-title img {
55-
max-height: 2rem;
57+
max-height: 3.2rem;
5658
width: auto;
5759
filter: drop-shadow(0 4px 20px rgba(247, 37, 133, 0.25));
5860
}
@@ -117,8 +119,12 @@ body {
117119
padding: 1.25rem;
118120
}
119121

122+
:root {
123+
--sl-nav-height: 4rem;
124+
}
125+
120126
.site-title img {
121-
max-height: 1.75rem;
127+
max-height: 2.4rem;
122128
}
123129
}
124130

0 commit comments

Comments
 (0)