Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

PNG Icons may show black background/border #77

Closed
kevinmarrec opened this issue Dec 19, 2022 · 9 comments
Closed

PNG Icons may show black background/border #77

kevinmarrec opened this issue Dec 19, 2022 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@kevinmarrec
Copy link
Owner

Related to #48 (comment)

image

@kevinmarrec kevinmarrec added the bug Something isn't working label Dec 19, 2022
@raducretu
Copy link

This is a problem purely on the actual PNG being generated with inner empty space
Screenshot 2022-12-31 at 02 39 35

@raducretu
Copy link

This can be solved by documenting the maskablePadding parameter on the icon config option, which by default has 20

@kevinmarrec kevinmarrec added the documentation Improvements or additions to documentation label Jan 3, 2023
@kevinmarrec
Copy link
Owner Author

Thank you for your feedback @raducretu , I'm gonna work on a documentation website which will be the next iteration of https://pwa.nuxtjs.org.

@kevinmarrec kevinmarrec removed the bug Something isn't working label Jan 4, 2023
@kevinmarrec
Copy link
Owner Author

Solution in case of incoherent color behaviors with PNG icons

export default defineNuxtConfig({
  pwa: {
    icon: {
      maskablePadding: 0
    }
  }
})

Tracking documentation in #82 , closing this.

@larrasu
Copy link

larrasu commented Feb 7, 2023

Solution in case of incoherent color behaviors with PNG icons

export default defineNuxtConfig({
  pwa: {
    icon: {
      maskablePadding: 0
    }
  }
})

Tracking documentation in #82 , closing this.

Unfortunately, this doesn't solve it. I'm still getting the black background even though my icon doesn't have transparency.

image

@kevinmarrec
Copy link
Owner Author

kevinmarrec commented Feb 7, 2023

@larrasu Could you share full PWA options you're giving, as well as original icon ? thanks !

@kevinmarrec kevinmarrec reopened this Feb 7, 2023
@JamieCurnow
Copy link

@larrasu @kevinmarrec I had this same issue that the icon still had a black border after changing maskablePadding to 0. Turns out that the icons get cached in the node_modules/.cache directory and changing the padding did not purge the cache.

To fix it I deleted the node_modules/.cache dir, and the .nuxt dir (just for good measure) and then ran npm run dev again and the icons were re-generated.

Interestingly, I'm deploying on netlify and the cache dir was also being cached along with node_modules on netlify too so I still saw the issue once I pushed up to production. I fixed that by purging the netlify cache and rebuilding which re-installs node modules etc from scratch. Then it was working perfectly! 🙌

Thanks for your work on this module @kevinmarrec - it's great!!

@larrasu
Copy link

larrasu commented Feb 8, 2023

@JamieCurnow Omg, thank you!! I've been trying to figure out why it won't regenerate my icon.

@kevinmarrec I guess that solves the issue. It would be better to include this in the docs/README for good measure? I had to dig up this issue to fix this. Thank you so much for this amazing module by the way!

@kevinmarrec
Copy link
Owner Author

@JamieCurnow Thank you for catching this !

@larrasu I'm gonna have an update regarding the cache, some icon options should definitely rebuild the cache. And I will need to document it as well.

Keeping this open until I implement a better behavior, and sorry for the inconvenience !

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

No branches or pull requests

4 participants