-3

I am new to both Meteor and Sass. I apologize if this is a question with an obvious answer.

Looking at the basics of sass.

I see some cool features, such as extending classes and using partials. But I am curious as to how to integrate these features with Meteor.

Doesn't Meteor automatically compress and concatenate all of your CSS? So is there really a need for partials or @import?

My second question concerns organizing your files.

Say I have a css class: .overlay and I want to create a class called blah that extends overlay, but blah and overlay are in different files. If I am not using import (because Meteor is doing it for me) Should I just make sure that the overlay class comes before my blah class by putting the file that overlay is declared in at client/lib or is there some config file I should be modifying?

Luke
  • 5,567
  • 4
  • 37
  • 66
  • You're asking 2 different unrelated questions: if you would like to ask 2, then post 2 separate questions. On SO, we expect you to *try* something *before* you ask. Did you try doing either part of your 2nd question? Quite often, the answer is obvious when you try something. – cimmanon Aug 01 '15 at 12:07
  • Yes I tried putting it in `client/lib` and it didn't work, but I couldn't see why it wouldn't, so I asked here. – Luke Aug 01 '15 at 12:21
  • So then you should have posted a question like "I tried to do X, but I got error Y". The question you asked instead comes off as incredibly lazy. As a result, you're unlikely to get an answer that will help you with your *actual problem*. – cimmanon Aug 01 '15 at 12:32
  • @cimmanon Sorry, I was trying to make it more general because I feel like there has to be other people in my position. I was trying to create a resource for the future. I will make my questions more specific in the future – Luke Aug 01 '15 at 12:34

1 Answers1

2

Your second concern is precisely why you should use imports... not just in meteor but in general. In meteor, your .scss files are processed and concatenated in the same order as javascript files (http://docs.meteor.com/#/full/structuringyourapp), which is not all that intuitive. By having a master .scss file that imports all other _*.css files, you are guaranteed that your styles are listed in the desired order, that they are not accidentally overridden, and that you don't have to worry about nesting them in a specific way.

GPicazo
  • 6,516
  • 3
  • 21
  • 24
  • If I use an import in my main.scss, wont I end up with multiple definitions? – Luke Aug 01 '15 at 13:19
  • No, most sass compilers ignore processing .scss files that start with an '_' (underscore) unless they are explicitly imported into another .scss file. So all the non-main .scss files should be prefixed with underscore character and imported into the main file. – GPicazo Aug 01 '15 at 17:19