feat: added darkTheme prop for dark mode support#6265
Open
roshidhmohammed wants to merge 1 commit intoHacker0x01:mainfrom
Open
feat: added darkTheme prop for dark mode support#6265roshidhmohammed wants to merge 1 commit intoHacker0x01:mainfrom
roshidhmohammed wants to merge 1 commit intoHacker0x01:mainfrom
Conversation
Adds built-in dark theme support to DatePicker components using the darkTheme prop.
- When darkTheme={true}, the DatePicker renders with dark theme styles
- When darkTheme={false} or not provided, defaults to existing light theme (ensures backward compatibility)
- Applies to all DatePicker subcomponents (time, day, month, year, etc.)
- No changes required to existing implementations
- Enables easy theme switching without modifying styles
- Default behaviour remains unchanged (no breaking changes)
- Provides optional dark theme support across the entire DatePicker UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds built-in dark theme support to DatePicker components using the darkTheme prop.
name: Pull Request
about: Create a pull request to improve this repository
title: "new feature: added dark theme support via
darkThemeprop"labels: ""
assignees: ""
Description
This PR introduces a new
darkThemeprop to the DatePicker component, enabling built-in dark mode support across all DatePicker UI elements.Problem
Currently, developers need to manually override styles to implement dark mode.
This feature provides a simple, built-in way to enable dark theme support, improving developer experience and usability in low-light environments.
Changes
darkThemepropdoc-site: Added an example component for the new propsrc/apply_dark_theme.tsx: Added function to apply theme when thedarkThemeprop changessrc/index.tsx: AddeddarkThemeprop and invokedapplyDarkThemewhen the prop changessrc/test/apply_dark_theme.test.tsx: Added test cases for the new propsrc/stylesheets/datepicker.scss: Refactored existing color styles into SCSS variables and applied themingsrc/stylesheets/variables.scss: Added new SCSS variables for dynamic color themingBehaviour
darkTheme={true}→ Renders the DatePicker with dark theme stylesdarkTheme={false}or not provided → Defaults to existing light themeBackward Compatibility
Testing
Screenshots
To Reviewers
datepicker.scss, some previously committed color values have been refactored into SCSS variables and moved tovariables.scssfor better maintainability and theming support.Contribution Checklist