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

Modular CSS with LESS


All class names and IDs in CSS are global, which makes it extremely difficult to maintain in large-scale projects. No matter how well you specify your naming conventions, vanilla CSS is a pretty messy language to work with.

Some of the ways we can solve that problem, or at least minimize it, is by implementing CSS preprocessor frameworks, such as Sass and LESS. Both of them are allowing us to separate the style sheets into logical modules (files), create variables, mix in classes, and generate CSS with loops and conditions. At the end of the development cycle, we can compile all the files into one or many plain CSS files before moving the styles to production.

Let's set up a simple Meteor app and implement the same grid with LESS.

In the terminal, run the following command:

>> meteor create less_app;

We need to add the less package, as follows, to allow Meteor to compile the LESS files into CSS:

>> meteor add less;

Here's a screenshot of the folders and files...

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