Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 21, 2025

Description

Closes #8497

Adds support for light/dark mode variants for all image and icon fields in docs.yml configuration. Users can now specify different assets for light and dark themes using either a simple string path (backward compatible) or an object with separate light and dark properties.

Link to Devin run: https://app.devin.ai/sessions/8a0f273f51024c6e866e87ddb32e1601
Requested by: Catherine Deskur (catherine@buildwithfern.com)

Changes Made

  • Added ImageConfig and IconConfig union types to the Fern definition that accept either a string or themed object
  • Added ThemedImage and ThemedIcon interfaces to ParsedDocsConfiguration
  • Updated configuration parsing with helper functions (resolveThemedIcon, resolveThemedImage, resolveIconConfigToSingleValue)
  • Updated DocsDefinitionResolver with resolveIconFileId, resolveStringIconFileId, and resolveThemedImageFileId methods
  • Updated ApiReferenceNodeConverter and toPageNode.ts to handle ThemedIcon type
  • Updated file resolver to collect both light and dark image paths
  • Regenerated TypeScript SDK from updated Fern definition
  • Added CLI versions.yml entry for v3.31.0
  • Updated README.md generator (if applicable)

Example usage:

products:
  - display-name: ProductA
    path: ./products/prod-a.yml
    image:
      light: ./assets/icon-light.svg
      dark: ./assets/icon-dark.svg

Updates Since Last Revision

  • Fixed TypeScript compile errors in docs-resolver by updating resolveIconFileId to accept ThemedIcon | undefined
  • Added resolveStringIconFileId for navbar links (FDR SDK types expect string | undefined)
  • Added resolveThemedImageFileId for product images
  • Updated ApiReferenceNodeConverter.ts and toPageNode.ts to handle ThemedIcon type
  • Restored hidden property in PlaygroundSettings that was accidentally removed during SDK regeneration
  • Reverted stream wrapper files (Node18UniversalStreamWrapper.ts, UndiciStreamWrapper.ts) that had unrelated formatting changes from SDK regeneration
  • Fixed formatting issues flagged by biome

Testing

  • Lint checks pass (pnpm run check)
  • Local compile passes (pnpm -F @fern-api/docs-resolver compile)
  • Unit tests added/updated
  • Manual testing completed

Human Review Checklist

  • Verify backward compatibility: simple string icons/images should still work (code duplicates value for both light/dark)
  • Check if downstream consumers (docs renderer, FDR) need updates to handle the new ThemedIcon/ThemedImage types
  • Known limitation: Navbar link icons use resolveStringIconFileId which extracts a single icon (prefers light, then dark) because FDR SDK types expect string | undefined. Full themed support for navbar links would require FDR SDK updates.
  • Verify the stream wrapper file reverts don't affect functionality
  • Confirm PlaygroundSettings.hidden property restoration is correct

Add support for light/dark mode variants for all image and icon fields
in docs.yml configuration. This allows users to specify different assets
for light and dark themes using either a simple string path or an object
with separate 'light' and 'dark' properties.

Changes:
- Add ImageConfig and IconConfig union types to Fern definition
- Add ThemedImage and ThemedIcon types to ParsedDocsConfiguration
- Update configuration parsing to handle themed icons/images
- Update resolver to collect both light and dark image paths
- Add CLI versions.yml entry for the new feature

Closes #8497

Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 3 commits December 21, 2025 01:21
The SDK regeneration removed necessary type casts in the stream wrapper
files which caused TypeScript compile errors. Reverting these files to
the main branch version fixes the issue.

Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
…d compatibility layer for navbar links

- Replace resolveIconPath with resolveThemedIcon for section and page icons
- Add resolveIconConfigToSingleValue helper for navbar links that use FDR SDK types
- Navbar links use single icon value (prefers light, then dark) due to FDR SDK limitations

Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
Co-Authored-By: Catherine Deskur <catherine@buildwithfern.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add Light/Dark Options for Product Switcher Images

1 participant