Using toastr from npm, importing styles

I want to use toastr in my Meteor app. Although I see there is a atmosphere package (https://atmospherejs.com/chrismbeckett/toastr) the github for that package is now 404 so I’m not sure what the status of that is.

So I installed (https://github.com/CodeSeven/toastr) as a npm package with ‘meteor npm install --save toastr’. I can make the notification but there is no css/styling applied to the notification.

From the docs (https://guide.meteor.com/using-npm-packages.html) I should be able to import the .less from the npm package by doing

@import '{}/node_modules/toastr/toastr.less';

but that gives me a unexpected token error

import '{}/node_modules/toastr/toastr.less';

gives me a cannot find module error.

What am I missing?

Why is it when I’m searching for a solution and then post a question as a last resort I always figure it out as soon as I hit send? :slight_smile:

Looking in the package directory I found the .css in a build sub-directory. So doing

import 'toastr/build/toastr.css';

fixed it.

2 Likes

I use the meteor package by the way and it works fine. (chrismbeckett:toastr)