Search code examples
plunkerkendo-ui-angular2

How shoud I include css file of kendo-theme-bootstrap in plunker?


In plunker, I could include css file of kendo-theme-default from here. Now I want to include css file of kendo-theme-bootstrap.

Maybe I include it from https://unpkg.com, but I don't know how to do this.

For npm package authors, unpkg relieves the burden of publishing your code to a CDN in addition to the npm registry. All you need to do is include your UMD build in your npm package (not your repo, that's different!).

You can do this easily using the following setup:
- Add the umd (or dist) directory to your .gitignore file
- Add the umd directory to your files array in package.json
- Use a build script to generate your UMD build in the umd directory when you publish

That's it! Now when you npm publish you'll have a version available on unpkg as well.

This quotation is a little difficult to understand for me. Could anyone explain this?


Solution

  • Yes, themes can be included from unpkg -- just as any file that is in a npm package. The correct paths for the Default and Bootstrap themes are:

    https://unpkg.com/@telerik/kendo-theme-default/dist/all.css
    https://unpkg.com/@telerik/kendo-theme-bootstrap/dist/all.css
    

    You may want to lock them to a specific version, otherwise you'll always get the latest version (which may contain breaking changes, if the theme gets a new major version.