Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Build Applications with Meteor

You're reading from   Build Applications with Meteor Isomorphic JavaScript web development

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781787129887
Length 388 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Dobrin Ganev Dobrin Ganev
Author Profile Icon Dobrin Ganev
Dobrin Ganev
Arrow right icon
View More author details
Toc

Bootstrap and Meteor


To style our shopping cart app, we will use Bootstrap 4 with Sass.

Open the shopping cart project and install Bootstrap.

At the time of writing this, Bootstrap 4 is still in alpha:

>> npm install bootstrap@4.0.0-alpha.5

Import it in the client/index.js file like any JavaScript module:

Meteor will add it to the head, and the browser will reload automatically; you will immediately note a difference in the design. The fonts and links will be styled and the app will look a little better.

As I mentioned earlier, everything in CSS is global.For example, what will happen if we, accidentally, have the same class name defined twice with a different value for the same property:

.shopping-cart-btn{
  background-color: red;
}

In another CSS file we have the same class name but this time we have a blue for background-color:

.shopping-cart-btn{
  background-color: blue;
}

The overriding priority in CSS is what makes it really hard to work with and difficult to scale. In the preceding...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime