Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cohere Docs Theme #1105

Merged
merged 29 commits into from
Jul 6, 2024
Merged

feat: Cohere Docs Theme #1105

merged 29 commits into from
Jul 6, 2024

Conversation

abvthecity
Copy link
Contributor

@abvthecity abvthecity commented Jul 2, 2024

This PR forks the default theme to construct a custom theme for Cohere.

Click here for preview - compare to Cohere's dashboard

Screenshot 2024-07-05 at 5 26 54 PM

I've decided to make this a big PR because it creating the Cohere theme required a lot of rethinking around architecture. We'll rely on in-depth smoke-testing (including mobile/responsive layouts) to ensure there are no regressions.

Also in this PR

  • more global state has been moved into Jotai atoms. Jotai is well-suited for Fern Docs because it support SSR hydration, and enables complex selector logic that also reduces rerendering (greatly improved performance). This makes it possible to reason about responsive layout logic, especially wrt whether or not there's a header offset that needs to be accounted for when triggering scrollTo(), which was needed for cohere's theme.
  • a lot more css classnames are now set so that the stylesheet can be controlled across separate themes. This will make it possible to generate more themes in the future.
  • mobile sidebar is fixed on changelog pages (it's completely rewritten)
  • FernLink is more resilient to mistakes; fixes table of contents bugs
  • refactored rehypeLayout to use react components instead
  • lots of optimizations as a result of using jotai— excess re-rendering cycles on endpoint pages has been eliminated.
Before After
Screen.Recording.2024-07-06.at.12.45.42.PM.mov
Screen.Recording.2024-07-06.at.12.46.53.PM.mov

Copy link

vercel bot commented Jul 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fern-dashboard-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 8:13pm
fern-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 8:13pm
fern-prod ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2024 8:13pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
fern-dashboard ⬜️ Ignored (Inspect) Jul 6, 2024 8:13pm
fontawesome-cdn ⬜️ Ignored (Inspect) Visit Preview Jul 6, 2024 8:13pm
private-docs ⬜️ Ignored (Inspect) Jul 6, 2024 8:13pm

@abvthecity abvthecity changed the title stash: cohere layout feat: Cohere Docs Theme Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants