caroso1222 / notyf

👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
https://carlosroso.com/notyf/
MIT License
2.66k stars 197 forks source link

Add "style" attribute to package.json #140

Open Adevweb opened 5 months ago

Adevweb commented 5 months ago

Hello !

Thanks for this feature !

I try to use it with Symfony 6.4.2 and with AssetMapper 6.4.2 component who manage JS/CSS files with an importmap HTML script tag.

To add this feature in my importmap.php I run : php bin/console importmap:require notyf

This command search on https://cdn.jsdelivr.net any package who match and download the package. It works well, I have the notyf in my HTML but no CSS to view the toast on my screen :smile:

If the "style" attribute is defined in the package.json, it download the style file automatically.

Without this attribute, I have to manually run : php bin/console importmap:require notyf/notyf.min.css to add the css file in my vendor.

You can see more in official Symfony documentation here : https://symfony.com/doc/current/frontend/asset_mapper.html#handling-3rd-party-css

Sorry if my english is not perfect !

Thanks, have a nice day !