I just found the amazing Stackblitz online VS Code editor. I created an Angular project and under dependencies installed the Bootstrap CSS framework but how should I import Bootstrap in to my project? Usually I do it by adding this line of code to angular-cli.json:
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
But how does it work on Stackblitz?
Thanks
Stackblitz has an in-browser NPM client that consists in a simple input where we can add NPM packages just by typing in the NPM package name. Finally, we include bootstrap. min.
Under the "Files" tree is a "Dependencies" section. You can add your dependencies there. If you just want the latest version you can just use the package name (ex: ngx-bootstrap ) or you can target a specific version (ex: [email protected] ).
In dependencies add "bootstrap" then click enter.
then write following line in styles.css in src
folder
@import '~bootstrap/dist/css/bootstrap.min.css';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With