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

Introduce default dark theme #9479

Merged
merged 24 commits into from
Dec 4, 2023
Merged

Introduce default dark theme #9479

merged 24 commits into from
Dec 4, 2023

Conversation

adguernier
Copy link
Contributor

@adguernier adguernier commented Nov 29, 2023

Problem

React-admin offers both a light and dark theme, but since only one theme is enabled by defaumt, the theme switcher doesn't appear in new admins.

Solution

Update the <Admin> component to include dark theme by default. This enables the theme switcher on all apps.

TODO

  • Add the defaultDarkTheme in AdminUI
  • Remove the default darkTheme in stories
  • Update documentation
  • Add upgrade guide

@adguernier adguernier added the WIP Work In Progress label Nov 29, 2023
@adguernier adguernier changed the title Introduce default dark theme 2 Introduce default dark theme Nov 29, 2023
docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/AppTheme.md Outdated Show resolved Hide resolved
docs/ToggleThemeButton.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/Admin.md Outdated Show resolved Hide resolved
docs/AppBar.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
docs/Upgrade.md Show resolved Hide resolved
docs/Upgrade.md Outdated Show resolved Hide resolved
packages/ra-ui-materialui/src/AdminContext.tsx Outdated Show resolved Hide resolved
@fzaninotto
Copy link
Member

We have many stories that set a custom dark theme. You should revisit these, too.

image

@fzaninotto
Copy link
Member

Interesting side effect: My OS defaults to dark theme, and so every story in the Storybook that uses <Admin> or <AdminContext> defaults to dark theme, too.

image

I suggest we systematically set the defaultTheme="light" in stories to avoid that.

@fzaninotto fzaninotto added the v5 label Nov 29, 2023
@adguernier
Copy link
Contributor Author

@fzaninotto I revisited stories and specs that used a custom dark theme.

docs/Upgrade.md Outdated Show resolved Hide resolved
@djhi djhi merged commit 47be3ac into next Dec 4, 2023
2 checks passed
@djhi djhi deleted the introduce-default-dark-theme-2 branch December 4, 2023 11:38
@fzaninotto fzaninotto added this to the 5.0.0 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants