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

[docs] Added a demo in Enable color on dark section. #29129

Closed
wants to merge 14 commits into from

Conversation

Wimukti
Copy link
Contributor

@Wimukti Wimukti commented Oct 18, 2021

close #28962

Summary

Previously it had only the steps to enable color on dark mode. By adding a demo, it will give more clarity to developers on this matter.

Changes

  • Added a demo - Demo contains a Switch to toggle between enabling and disabling of color on dark mode.

  • Also added a separate theme mode change button on the app bar to check the difference between light and dark modes.

Preview

Capture1
Capture2

@mui-pr-bot
Copy link

mui-pr-bot commented Oct 18, 2021

No bundle size changes

Generated by 🚫 dangerJS against c463b56

@Wimukti Wimukti changed the title Added a demo in Enable color on dark section. [AppBar] Added a demo in Enable color on dark section. Oct 18, 2021
@Wimukti Wimukti changed the title [AppBar] Added a demo in Enable color on dark section. [docs] Added a demo in Enable color on dark section. Oct 18, 2021
@danilo-leal danilo-leal added the docs Improvements or additions to the documentation label Oct 18, 2021
@siriwatknp
Copy link
Member

@Wimukti Thanks for your contribution! I have some suggestions about the demo. I think it is better to just show 2 app bars in the demo (without the switch and toggle).

Screen Shot 2564-10-19 at 09 42 34

I expect the demo code to be able to show the preview.

<AppBar enableColorOnDark />
<AppBar />

and at the bottom, add another section to describe theming to apply to all AppBar.

@Wimukti
Copy link
Contributor Author

Wimukti commented Oct 19, 2021

@siriwatknp sure. That would be much better. I will change the demo according to the suggestions asap.

@@ -139,24 +139,7 @@ function HideOnScroll(props) {

## Enable Color on Dark

Following the [Material Design guidelines](https://material.io/design/color/dark-theme.html), the `color` prop has no effect on the appearance of the AppBar in dark mode. You can override this behavior by setting the `enableColorOnDark` prop to `true`.
Following the [Material Design guidelines](https://material.io/design/color/dark-theme.html), the `color` prop has no effect on the appearance of the AppBar in dark mode.
You can override this behavior by setting the `enableColorOnDark` prop to `true`.

Copy link

Choose a reason for hiding this comment

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

There should be a code block showing how the AppBar color behavior in dark mode can be overwritten with enableColorOnDark, for both cases ;

  • Specific AppBar element via prop
  • Affecting all AppBar elements via theme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Kaid00 do these two cases need to have separate demos? or just needed to show them in the demo code preview? It would be much helpful if u elaborate more on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Capture

Any Suggestions @Kaid00

Copy link

Choose a reason for hiding this comment

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

@Kaid00 do these two cases need to have separate demos? or just needed to show them in the demo code preview? It would be much helpful if u elaborate more on this?

I think showing them in separate code blocks, will be at a glance more helpful for developers

Screen Shot 2021-10-20 at 5 08 20 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Capture

@Kaid00 is there anything that needs to be changed?

Copy link

Choose a reason for hiding this comment

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

Looking good, please take out the last code block, there's already a code block above showing how to enable color on dark for specific app bar elements, having another at the bottom is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@siriwatknp @Kaid00 I have made the PR. Let me know if anything needs to changed

const theme = createTheme({
palette: {
mode: themeMode,
primary: {
Copy link

Choose a reason for hiding this comment

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

The AppBar color should match MUI primary color and not red #FF0000

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Kaid00 sure will work on that

@Wimukti
Copy link
Contributor Author

Wimukti commented Oct 21, 2021

@Kaid00 I have committed the changes. Can you please recheck now?

@siriwatknp
Copy link
Member

@Wimukti I adjusted the example a bit. Looks good! Thanks for your first contribution 👏

@siriwatknp
Copy link
Member

siriwatknp commented Oct 25, 2021

cc @mui-org/core anyone knows how to fix Argos in this case?

@siriwatknp
Copy link
Member

siriwatknp commented Oct 27, 2021

@Wimukti I have no idea why the CI cannot find the token, I tried many times. Can you open another PR with the same changes? 🙏 sorry for the inconvenience.

I will close this one.

@siriwatknp siriwatknp closed this Oct 27, 2021
@siriwatknp siriwatknp reopened this Oct 27, 2021
@siriwatknp siriwatknp closed this Oct 27, 2021
@Wimukti
Copy link
Contributor Author

Wimukti commented Oct 27, 2021

@siriwatknp Sure no problem. I have opened another PR - #29340

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AppBar] Color does not apply in dark mode
5 participants