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: MudThemeProvider and Theming documentation should state that ObserveSystemThemeChange is on by default #10442

Open
1 of 2 tasks
Juz3 opened this issue Dec 13, 2024 · 2 comments
Labels
docs Related to docs

Comments

@Juz3
Copy link

Juz3 commented Dec 13, 2024

Feature request type

Other

Component name

MudThemeProvider

Is your feature request related to a problem?

Dark theme functionality is described in these docs:
https://mudblazor.com/customization/overview
https://mudblazor.com/api/MudThemeProvider#properties

While it is stated in the docs, that dark mode is integrated to MudBlazor, it is not made clear, that it is the default functionality for MudThemeProvider to observe system theme change.

I feel it is misleading to only state how MudBlazor can be set to watch system theme preference, while it is the default functionality of current version of MudBlazor.

We found this out after receiving a report of a user having dark mode toggled before we even implemented it properly.

This default functionality was only found after checking that in the current implementation of MudThemeProvider this default value is set: (https://github.com/MudBlazor/MudBlazor/blob/dev/src/MudBlazor/Components/ThemeProvider/MudThemeProvider.razor.cs)

public bool ObserveSystemThemeChange { get; set; } = true;

Describe the solution you'd like

I suggest stating in the theming documentation or in MudThemeProvider API reference that the default value for ObserveSystemThemeChange is true and therefore the system theme change is observed by default.

Have you seen this feature anywhere else?

No response

Describe alternatives you've considered

No response

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Juz3 Juz3 added the enhancement New feature or request label Dec 13, 2024
@Anu6is
Copy link
Contributor

Anu6is commented Dec 13, 2024

This should be handled after the update. As you can see in the XML docs from the last link you provided, the summary mentions the default is true. The docs pull directly from the XML comments.

see - https://dev.mudblazor.com/api/MudThemeProvider#properties

@ScarletKuro
Copy link
Member

If you'd like it to be explicitly mentioned on the Theme Provider page, a PR is welcome. If an API description is sufficient, it will be included once we release the v8 branch, as v7 doesn't have the capability to read XML docs.
The ObserveSystemThemeChange setting is relatively new. Previously, there was no option to opt out of this behavior, which is why it is set to true by default.

@danielchalmers danielchalmers added docs Related to docs and removed enhancement New feature or request labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Related to docs
Projects
None yet
Development

No branches or pull requests

4 participants