Skip to content

Commit b12352f

Browse files
cursoragentoskar.kwasniewski
andcommitted
Update dependencies and add global styles for documentation site
Co-authored-by: oskar.kwasniewski <[email protected]>
1 parent c1a0dd7 commit b12352f

27 files changed

+3478
-20403
lines changed

RSPRESS_THEME_UPDATE_SUMMARY.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Rspress Theme Update Summary
2+
3+
## Overview
4+
Successfully updated the rspress implementation to use the latest compatible version of the Callstack rspress-theme following the official README instructions.
5+
6+
## Changes Made
7+
8+
### 1. Theme Package Update
9+
- **Previous version**: `@callstack/[email protected]`
10+
- **Updated version**: `@callstack/[email protected]`
11+
- **Note**: Version 0.2.0 requires rspress v2.0.0-beta.21, but the current project uses rspress v1.45.0 (latest stable), so we used the latest compatible version.
12+
13+
### 2. Assets Installation
14+
- Ran `npx @callstack/rspress-theme copy-assets .` to copy theme assets
15+
- Assets copied to `docs/theme/assets/` directory
16+
- Includes SVG icons, shapes, and other theme-specific assets
17+
18+
### 3. Font Configuration
19+
- Created `docs/styles.css` with Alliance No. 2 font declarations
20+
- **Important**: Alliance No. 2 is a licensed font that must be added manually
21+
- Configured fallback fonts (Inter, system-ui) for immediate use
22+
- Updated `rspress.config.ts` to include `globalStyles` option
23+
24+
### 4. Configuration Updates
25+
- Updated `docs/rspress.config.ts`:
26+
- Added `globalStyles: path.join(__dirname, 'styles.css')`
27+
- Plugin already configured: `pluginCallstackTheme()`
28+
29+
### 5. Theme Customization (Optional)
30+
- Created `docs/theme/index.tsx` for custom theme components (currently backed up)
31+
- Provides ability to customize Layout, HomeLayout, and other components
32+
- Can be restored and customized as needed
33+
34+
### 6. Documentation
35+
- Created `docs/fonts/README.md` with instructions for adding Alliance No. 2 font
36+
- Includes alternative font suggestions and setup instructions
37+
38+
## Files Modified/Created
39+
40+
### Modified Files:
41+
- `docs/package.json` - Updated theme dependency
42+
- `docs/rspress.config.ts` - Added globalStyles configuration
43+
44+
### Created Files:
45+
- `docs/styles.css` - Font declarations and fallback styles
46+
- `docs/theme/assets/` - Theme assets (copied by CLI)
47+
- `docs/fonts/README.md` - Font installation instructions
48+
- `docs/theme/index.tsx.bak` - Custom theme components (backed up)
49+
50+
## Build Status
51+
**Build successful** - `npm run build` completes without errors
52+
**Development server** - `npm run dev` starts successfully
53+
⚠️ **Minor SSR warning** - Falls back to CSR, but doesn't affect functionality
54+
55+
## Next Steps
56+
57+
### To Complete the Theme Setup:
58+
1. **Add Alliance No. 2 Font** (optional but recommended):
59+
- Obtain Alliance No. 2 font files from [Klim Type Foundry](https://klim.co.nz/retail-fonts/alliance/)
60+
- Place `alliance-no-2-regular.ttf` and `alliance-no-2-medium.ttf` in `docs/fonts/`
61+
- Update `docs/styles.css` to use the actual font files instead of fallbacks
62+
63+
2. **Customize Theme Components** (optional):
64+
- Restore `docs/theme/index.tsx` from backup
65+
- Customize Layout, HomeLayout, and other components as needed
66+
- Follow the theme documentation for available components
67+
68+
3. **Test All Features**:
69+
- Verify all pages render correctly
70+
- Test responsive design
71+
- Check dark/light mode switching
72+
- Validate all theme components work as expected
73+
74+
## Theme Features Available
75+
- Custom Layout with Announcement bar
76+
- Home page components (Hero, Features, Banner, Footer)
77+
- Callstack branding and styling
78+
- Responsive design
79+
- Dark/light mode support
80+
- Custom SVG icons and graphics
81+
82+
## Troubleshooting
83+
- If build fails, check that all font files are present or use fallback fonts
84+
- If SSR issues persist, they don't affect the final build output
85+
- For theme customization issues, refer to the [Rspress theme documentation](https://rspress.dev/guide/advanced/custom-theme)
86+
87+
## Resources
88+
- [Callstack rspress-theme Repository](https://github.com/callstack/rspress-theme)
89+
- [Rspress Documentation](https://rspress.dev/)
90+
- [Theme README](https://github.com/callstack/rspress-theme/blob/main/packages/theme/README.md)

docs/fonts/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Alliance No. 2 Font
2+
3+
The Callstack rspress-theme uses **Alliance No. 2** as the header font family. This is a licensed font that needs to be added manually.
4+
5+
## Required Files
6+
7+
Place the following font files in this directory:
8+
9+
- `alliance-no-2-regular.ttf` - Regular weight (400)
10+
- `alliance-no-2-medium.ttf` - Medium weight (500)
11+
12+
## Where to Get the Font
13+
14+
Alliance No. 2 is a licensed font. You can obtain it from:
15+
- [Klim Type Foundry](https://klim.co.nz/retail-fonts/alliance/) (official source)
16+
- Or use alternative fonts that match the design aesthetic
17+
18+
## Alternative Fonts
19+
20+
If you don't have access to Alliance No. 2, you can use alternative fonts by updating the `styles.css` file in the project root. Some good alternatives include:
21+
22+
- Inter
23+
- Roboto
24+
- Source Sans Pro
25+
- Open Sans
26+
27+
Simply replace the font-family name in the `@font-face` declarations in `styles.css`.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"preview": "rspress preview"
99
},
1010
"dependencies": {
11-
"@callstack/rspress-theme": "^0.0.2",
11+
"@callstack/rspress-theme": "^0.1.4",
1212
"rspress": "^1.39.3"
1313
},
1414
"devDependencies": {

docs/rspress.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
logoText: 'React Native Bottom Tabs',
1212
icon: '/img/phone.png',
1313
logo: '/img/phone.png',
14+
globalStyles: path.join(__dirname, 'styles.css'),
1415
themeConfig: {
1516
enableContentAnimation: true,
1617
enableAppearanceAnimation: false,

docs/styles.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/* Fallback fonts for Alliance No. 2 */
2+
/* You can replace these with actual Alliance No. 2 font files when available */
3+
4+
@font-face {
5+
font-family: 'Alliance No. 2';
6+
font-style: normal;
7+
font-weight: 400;
8+
font-display: block;
9+
src: local('Inter'), local('system-ui'), local('sans-serif');
10+
}
11+
12+
@font-face {
13+
font-family: 'Alliance No. 2';
14+
font-style: normal;
15+
font-weight: 500;
16+
font-display: block;
17+
src: local('Inter Medium'), local('Inter'), local('system-ui'), local('sans-serif');
18+
}
19+
20+
/* Alternative: Use a web font as fallback */
21+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap');
22+
23+
/* Override the font-family if needed */
24+
:root {
25+
--font-family-heading: 'Alliance No. 2', 'Inter', system-ui, sans-serif;
26+
}

docs/theme/assets/alert.svg

Lines changed: 3 additions & 0 deletions
Loading

docs/theme/assets/arrow-down.svg

Lines changed: 3 additions & 0 deletions
Loading

docs/theme/assets/arrow-right.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)