Skip to content

fix: FluentOverlay in Dark mode #3532

Closed

Description

🐛 Bug Report

I'm not sure if this is a bug or by design. When the theme is set to Dark Mode it seems like the background of the overlay should switch from light to dark as well. Since the text switches to white... the white text on a white background does not look ideal.

💻 Repro or Code Sample

On the Overlay demo page on the site. Change the theme to Dark and then show one of the overlays:

Image

🤔 Expected Behavior

Background of the overlay should change to black and have an opacity value similar to light theme (0.4 I believe). Here's an example of what I believe it should be:

Image

Right now it looks like:

Image

Activity

  1. added
    triage
    on Mar 17, 2025
  2. vnbaaij commented on Mar 17, 2025

    @vnbaaij
    Collaborator

    I think it should actually use the NeutralBaseColor as the default value. This one does not differ between Light or Dark mode and is automatically using a value that is respectful to the needed contrast:

    Image

    Image

    What do you think? (Denis Voituron (@dvoituron) as well)

  3. StevenRasmussen commented on Mar 17, 2025

    @StevenRasmussen
    ContributorAuthor

    I edited my original post to show an example with text. When the text changes from black to white for dark mode, the contrast seems off due to the white on grey. The white text on a dark background looks much better in my opinion.

  4. added a commit that references this issue on Mar 17, 2025
    f7dea32
  5. vnbaaij commented on Mar 17, 2025

    @vnbaaij
    Collaborator

    With the PR mentioned the background will follow the NeutralBaseColor. Default value is #808080 but you can set it to your own custom value with the DesignToken. See the SiteSettings in the preview site for an example of how you can change that color

  6. StevenRasmussen commented on Mar 18, 2025

    @StevenRasmussen
    ContributorAuthor

    This is definitely better ;) Thanks! That being said, I just noticed that when you open a dialog it does seem to use black as the color to "grey-out" the background... which is what I was thinking the overlay should do as well. Anyway, do with that as you please. You can see this when you go to the Settings menu on the demo site and the dialog opens on the right.

  7. vnbaaij commented on Mar 18, 2025

    @vnbaaij
    Collaborator

    The overlay from the dialog comes from the web component and can't be change easily

  8. added a commit that references this issue on Mar 19, 2025
    1f9083b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions