Skip to content

Commit f2c897a

Browse files
committed
feat: Integrate Expressive Code with site design
- Configure comprehensive style overrides to match site's clean, minimal aesthetic - Use pure white backgrounds and site's CSS variables (--nextflow-green colors) - Set proper text marker highlighting with site's light green accent color - Remove frame titles and switch to 'nextflow' language for syntax highlighting - Maintain advanced highlighting functionality while achieving visual integration - Result: Code blocks now blend seamlessly with site design while providing enhanced educational features The example pages now have clean, professional code blocks that match the site's design system perfectly, with clearly visible line highlighting using the site's signature green color scheme.
1 parent e219f3d commit f2c897a

File tree

4 files changed

+378
-11
lines changed

4 files changed

+378
-11
lines changed

astro.config.mjs

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from "astro/config";
33
import remarkDescription from "astro-remark-description";
44
import remarkDirective from "remark-directive";
55
import sitemap from "@astrojs/sitemap";
6-
import { transformerNotationDiff, transformerNotationFocus, transformerMetaHighlight } from "@shikijs/transformers";
6+
import expressiveCode from "astro-expressive-code";
77
import react from "@astrojs/react";
88
import tailwind from "@astrojs/tailwind";
99

@@ -12,12 +12,6 @@ export default defineConfig({
1212
site: "https://nextflow.io/",
1313
outDir: "./output",
1414
markdown: {
15-
shikiConfig: {
16-
// Choose from Shiki's built-in themes (or add your own)
17-
// https://shiki.style/themes
18-
theme: "light-plus",
19-
transformers: [transformerNotationDiff(), transformerNotationFocus(), transformerMetaHighlight()],
20-
},
2115
remarkPlugins: [
2216
remarkDirective,
2317
admonitionsPlugin,
@@ -52,6 +46,71 @@ export default defineConfig({
5246
],
5347
},
5448
integrations: [
49+
expressiveCode({
50+
// Use light theme for consistency with site design
51+
themes: ["github-light"],
52+
// Enable advanced features
53+
plugins: ["text-markers", "frames"],
54+
// Comprehensive styling to match site's clean, minimal design
55+
styleOverrides: {
56+
// Core background and text styling - pure white like site
57+
codeBackground: "#ffffff",
58+
codeForeground: "#24292f", // GitHub light theme text color
59+
60+
// Typography - match site's exact monospace stack
61+
codeFontFamily: "Menlo, Monaco, Consolas, 'Courier New', monospace",
62+
codeFontSize: "0.875rem", // 14px - readable code size
63+
codeLineHeight: "1.5",
64+
65+
// Borders - subtle gray matching site's container styling
66+
borderColor: "#e5e7eb", // rgb(229, 231, 235) - light gray
67+
borderWidth: "1px",
68+
borderRadius: "0.375rem", // Tailwind rounded-md
69+
70+
// Text markers - use site's green color scheme for highlighting
71+
textMarkers: {
72+
// Use the site's actual light green color for highlighting
73+
markBackground: "var(--nextflow-light-green)", // Direct use of site color
74+
markBorderColor: "transparent", // Clean, no borders
75+
76+
// Make highlighting more visible but still clean
77+
backgroundOpacity: "0.4", // More visible highlighting
78+
borderOpacity: "0", // No border opacity
79+
},
80+
81+
// Frames - clean, minimal styling
82+
frames: {
83+
// Remove all shadows and heavy styling
84+
shadowColor: "transparent",
85+
frameBoxShadowCssValue: "none",
86+
87+
// Clean frame styling matching site containers
88+
editorBackground: "#ffffff",
89+
editorActiveTabBackground: "#f9fafb", // Very light gray for active tab
90+
editorActiveTabBorderColor: "#e5e7eb", // Match border color
91+
editorTabBarBackground: "#ffffff",
92+
editorTabBarBorderColor: "#e5e7eb",
93+
94+
// Terminal-style frame styling
95+
terminalBackground: "#ffffff",
96+
terminalTitlebarBackground: "#f9fafb",
97+
terminalTitlebarForeground: "#6b7280", // Subtle gray text
98+
terminalTitlebarBorderColor: "#e5e7eb",
99+
},
100+
101+
// Focus and selection states
102+
focusBorder: "var(--nextflow-green)", // Use site's green for focus
103+
codeSelectionBackground: "var(--nextflow-light-green)", // Use site's light green
104+
105+
// Scrollbar styling
106+
scrollbarThumbColor: "#d1d5db", // Light gray
107+
scrollbarThumbHoverColor: "#9ca3af", // Slightly darker on hover
108+
109+
// Ensure clean, minimal appearance throughout
110+
uiSelectionBackground: "var(--nextflow-light-green)",
111+
uiSelectionForeground: "#1f2937", // Dark text for contrast
112+
},
113+
}),
55114
react(),
56115
tailwind(),
57116
sitemap({

0 commit comments

Comments
 (0)