Skip to content

Commit f0fd6d7

Browse files
committed
docs: add expressive code styling and dark mode support
1 parent 48da6d8 commit f0fd6d7

File tree

2 files changed

+75
-12
lines changed

2 files changed

+75
-12
lines changed

docs/astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default defineConfig({
1616
},
1717
plugins: [starlightThemeRapide()],
1818
customCss: ["./src/styles/custom.css"],
19+
expressiveCode: {
20+
themes: ["github-dark"],
21+
},
1922
social: [{ icon: "github", label: "GitHub", href: "https://github.com/mgcrea/react-native-tailwind" }],
2023
sidebar: [
2124
{

docs/src/styles/custom.css

Lines changed: 72 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,74 @@
11
/* Custom theme colors - Blue accent */
2-
:root {
3-
/* Light mode accent colors */
4-
--sl-color-accent-low: #1e3a5f;
5-
--sl-color-accent: #3b82f6;
6-
--sl-color-accent-high: #60a5fa;
7-
}
8-
9-
/* Dark mode accent colors */
10-
:root[data-theme="dark"] {
11-
--sl-color-accent-low: #1e40af;
12-
--sl-color-accent: #3b82f6;
13-
--sl-color-accent-high: #93c5fd;
2+
3+
/* Code Block Styling */
4+
5+
/* Code block container */
6+
.expressive-code {
7+
border-radius: 8px;
8+
margin: 1.5rem 0;
9+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
10+
}
11+
12+
/* Code block frame/background */
13+
.expressive-code .frame {
14+
border-radius: 8px;
15+
}
16+
17+
/* Code font styling */
18+
.expressive-code code {
19+
font-size: 0.875rem;
20+
line-height: 1.7;
21+
font-family:
22+
"SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
23+
font-variant-ligatures: common-ligatures;
24+
}
25+
26+
/* Inline code (backticks in text) */
27+
code:not(pre code) {
28+
background-color: var(--sl-color-gray-6);
29+
color: var(--sl-color-text-gray-1);
30+
padding: 0.125rem 0.375rem;
31+
border-radius: 0.25rem;
32+
font-size: 0.875em;
33+
border: 1px solid var(--sl-color-gray-5);
34+
font-weight: 500;
35+
font-family:
36+
"SF Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
37+
}
38+
39+
/* Dark mode inline code */
40+
:root[data-theme="dark"] code:not(pre code) {
41+
background-color: var(--sl-color-gray-5);
42+
border-color: var(--sl-color-gray-4);
43+
}
44+
45+
/* Hero Section Styling */
46+
47+
/* Reduce hero height */
48+
.hero {
49+
padding-top: 3rem !important;
50+
padding-bottom: 3rem !important;
51+
}
52+
53+
/* Make hero title more compact */
54+
.hero h1 {
55+
font-size: 2.5rem !important;
56+
margin-bottom: 1rem !important;
57+
}
58+
59+
/* Reduce tagline spacing */
60+
.hero .tagline {
61+
font-size: 1.125rem !important;
62+
margin-bottom: 1.5rem !important;
63+
}
64+
65+
/* Reduce hero image size */
66+
.hero .hero-image {
67+
max-width: 300px !important;
68+
}
69+
70+
/* Make action buttons more compact */
71+
.hero .actions {
72+
margin-top: 1.5rem !important;
73+
gap: 0.75rem !important;
1474
}

0 commit comments

Comments
 (0)