Motivation
The API Reference component accepts a darkMode configuration option that should allow developers to control the initial color mode of the documentation interface.
When darkMode: false is explicitly set but ignored, it creates a confusing developer experience and prevents proper theming control.
Current Behavior
When the darkMode configuration is set to false, the API Reference component does not initialize in light mode as expected. Instead, it behaves as if no preference was set, potentially defaulting to dark mode or using system preferences.
Reproduction Steps
- Configure the API Reference component with
darkMode: false in your integration
- Load the API Reference page in a browser
- Observe: The UI does not initialize in light mode as expected. It may appear in dark mode or follow system preferences instead of respecting the explicit
false setting
Expected Behavior
When darkMode is explicitly set to false, the API Reference should initialize in light mode regardless of system preferences or other factors. The configuration should support three distinct states:
darkMode: true → Force dark mode
darkMode: false → Force light mode
darkMode: undefined (or omitted) → Auto-detect based on user preferences
Acceptance Criteria
Steps to Test
- Create or modify an API Reference integration to explicitly set
darkMode: false
- Load the page in a browser and verify the UI appears in light mode on initial load
- Test with
darkMode: true and verify dark mode is applied
- Test with
darkMode omitted and verify automatic detection works
- Verify the color mode toggle button still allows users to switch modes after initial load
Submission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx
Motivation
The API Reference component accepts a
darkModeconfiguration option that should allow developers to control the initial color mode of the documentation interface.When
darkMode: falseis explicitly set but ignored, it creates a confusing developer experience and prevents proper theming control.Current Behavior
When the
darkModeconfiguration is set tofalse, the API Reference component does not initialize in light mode as expected. Instead, it behaves as if no preference was set, potentially defaulting to dark mode or using system preferences.Reproduction Steps
darkMode: falsein your integrationfalsesettingExpected Behavior
When
darkModeis explicitly set tofalse, the API Reference should initialize in light mode regardless of system preferences or other factors. The configuration should support three distinct states:darkMode: true→ Force dark modedarkMode: false→ Force light modedarkMode: undefined(or omitted) → Auto-detect based on user preferencesAcceptance Criteria
darkMode: falseinitializes the API Reference in light modedarkMode: trueinitializes the API Reference in dark modedarkModesetting allows automatic color mode detectionfalseandundefinedvaluesSteps to Test
darkMode: falsedarkMode: trueand verify dark mode is applieddarkModeomitted and verify automatic detection worksSubmission
Download https://cap.so/ to record your screen (use Studio mode). Export as an mp4, and drag and drop into an issue comment below.
Guide to submitting pull requests: https://hackmd.io/@timothy1ee/Hky8kV3hlx