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

Web: dark-background.png is not generated but used if background_image_dark is missing #453

Closed
Bungeefan opened this issue Nov 18, 2022 · 3 comments

Comments

@Bungeefan
Copy link
Contributor

Describe the bug

In the web the following property overrides the background_image in any case when the browser is in dark mode.

background-image: url("img/dark-background.png");

However, when the config only includes the background_image property and no background_image_dark, the plugin doesn't generate the dark-background.png file.
Which then results in a black browser window without background, the logo is there as this gets generated even without any dark parameters.

In my opinion, the background should be generated and just be the same as the light background even if no explicit dark background is set, just like the logo.

Configuration

flutter_native_splash:

  background_image: assets/images/JVx_Bg.png

  image: assets/images/J.png

  android_12:
    image: assets/images/J.png
    color: "#E3E3E3"
    icon_background_color: "#DADADA"
    branding: assets/images/branding_sib_visions.png

Device (please complete the following information):

  • Device: Chrome/Firefox in Dark Mode (has to trigger prefers-color-scheme: dark)
  • OS: Linux (Manjaro)

To Reproduce
Steps to reproduce the behavior, using the example app:

  1. Set the config on the example app
  2. Run the generator
  3. Start browser in dark mode
  4. See missing background
@Bungeefan
Copy link
Contributor Author

Additional info: Workaround of manually copy and renaming the file only works as long as create isn't used again, as it deletes the file.

@jonbhanson
Copy link
Owner

@Bungeefan thanks for the bug report. I think a better approach is to not include any dark mode styling in styles.css if dark mode settings are not included in pubspec.yaml. I will push an update soon with this fix.

@jonbhanson
Copy link
Owner

Fixed in b662516.

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

No branches or pull requests

2 participants