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

Add display.theme option to control dark/light mode #2593

Merged
merged 2 commits into from
Jun 28, 2022

Conversation

killianhale
Copy link
Contributor

@killianhale killianhale commented Jun 25, 2022

  • Please check if the PR fulfills these requirements
  • [ ✔️ ] The PR is against the development branch
  • Tests for the changes have been added (for bug fixes / features)
  • [ ✔️ ] Docs have been added / updated (for bug fixes / features)
  • [ ✔️ ] Does NOT modify files under the "dist" folder.

Feature

This PR adds a display.theme option to control dark/light mode

Current Behavior

The current behavior is to always auto detect and change to dark mode based on the user's system settings

New Behavior

This introduces a new option, display.theme which controls the behavior for when to use dark mode instead of light. Setting the theme to auto, which is also the default when no theme is specified, is the current behavior of using dark mode based on the user's system settings.

Does this PR introduce a breaking change?

No, the default behavior is as it operates today.

Additional Context

It's awesome to support dark mode but not all consumers of this library may support it (or the opposite) in their styling. This allows them to not have to completely restyle the picker when they don't want to change it in any other way. This is actually the use case I find myself in. I'm on a legacy site that doesn't support dark mode currently and am upgrading from the old date picker which only had light mode.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@killianhale
Copy link
Contributor Author

I know the PR requirements ask for tests but I don't see any in this repo. Am I just missing them somewhere?

@Eonasdan Eonasdan merged commit 958118e into Eonasdan:development Jun 28, 2022
@Eonasdan
Copy link
Owner

Thanks for this, specially for docs examples :)

There's no test yet

@killianhale
Copy link
Contributor Author

No problem... happy to help! I'll be submitting two bug fixes here shortly too ^_^

@killianhale killianhale deleted the feature/theme branch June 28, 2022 20:18
Eonasdan added a commit that referenced this pull request Jul 11, 2022
* make viewMode optional (#2551)

* introduce a simple overridable function parseInput (#2552)

so that you don't have to know all the internal details when overriding
this just gets 1 input and can return another
Just as formatInput also works (its the opposite)

* fixed #2487, #2495

* fixed #2487, #2495

* fix for #2506

* fix for #2549

* fix for #2549

* pub npm

* pub npm

* package update

* * added locale from pr
* updated github templates
* updated link nav

* fixes #2583, #2578

* [IMP] adding support for Arabic locales (#2592)

* Add display.theme option to control dark/light mode (#2593)

* adding display.theme to control dark vs light mode

* removing changes in dist folder per contribution guidelines

* fixes #2547

* upstream

* fixing bug where side-by-side shows blank clock (#2596) (#2597)

* fix clock

* fix #2595

* fix #2563
fix #2563

* fix #2599

* fix #2576

* issue templates to forms

* fixes #2568

* nuget package

* fix spelling and oops

* remove commented out code

Co-authored-by: Johan Compagner <[email protected]>
Co-authored-by: Khaled Said <[email protected]>
Co-authored-by: Killian Hale <[email protected]>
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